com.ca.jcs
Interface ConnectorFactory

All Known Implementing Classes:
MetaConnectorFactory

public interface ConnectorFactory

Factory responsible for creating ConnectorTypes and Connectors based on DNs and attributes passed in at the ConnectorType (aka Endpoint Type) and Connector levels of the DIT.


Method Summary
 Connector createConnector(ConnectorType type, String namingAttr, String name, LdapDN suffix, Attributes attrs)
          Return a new connector based on attributes saved for parent connector type combined with provided attrs.
 ConnectorType createConnectorType(String name, Attributes attrs)
          Return represents a single custom connector or particular configuration for a dynamic connector.
 Logger createLogger(String connTypeName, String connName)
          Create a logger for the connector with the provided name.
 void destroyConnectorType(String connTypeName)
          Shuts down specific connectorType on this factory.
 String getConfDirectory()
           
 String getConnectorFilePath(String connTypeName, String connName)
           
 ConnectorPersister getConnectorPersister()
           
 String getConnectorTypeFilePath(String connTypeName)
           
 ImplBundle getImplBundleFromConnectorTypeName(String connTypeName)
           
 ImplBundle getImplBundleFromName(String name)
           
 ImplBundle getImplBundleFromObjectClass(String objectClass)
           
 String[] getImplBundleNames()
           
 List<ImplBundle> getImplBundles()
           
 org.springframework.context.MessageSource getMessageSource()
           
 boolean isAllowMetadataModify(ImplBundle implBundle)
          To determine if the metadata files (eTMetadata and eTOpbindingMetadata) are allowed to modify based on the settings in isAllowMetadataModifyGlobally defined in server_jcs.xml and isAllowMetadataModify in connector.xml.
 boolean isDynamicConnectorType(LdapDN connTypeDn)
          Method to check if a connector type is dynamic based on it's DN.
 void setConfDirectory(String confDir)
           
 void setConnectorPersister(ConnectorPersister persister)
          Accessed internally as passed down to created ConnectorTypes and Connectors for use when they are changed.
 void setLogLevel(ConnectorType connectorType, Logger logger, Attributes attrs)
          Set logging level on a connector's logger using metadata (and possibly static configuration) combined with values contained in attrs, or do nothing if no logging related attributes are present in attrs.
 void setMessageSource(org.springframework.context.MessageSource msgSrc)
           
 

Method Detail

getMessageSource

org.springframework.context.MessageSource getMessageSource()

setMessageSource

void setMessageSource(org.springframework.context.MessageSource msgSrc)

setConnectorPersister

void setConnectorPersister(ConnectorPersister persister)
Accessed internally as passed down to created ConnectorTypes and Connectors for use when they are changed.


getConnectorPersister

ConnectorPersister getConnectorPersister()

setConfDirectory

void setConfDirectory(String confDir)

getConfDirectory

String getConfDirectory()

getImplBundleFromName

ImplBundle getImplBundleFromName(String name)

getImplBundleFromObjectClass

ImplBundle getImplBundleFromObjectClass(String objectClass)

getImplBundleFromConnectorTypeName

ImplBundle getImplBundleFromConnectorTypeName(String connTypeName)

getImplBundleNames

String[] getImplBundleNames()

getImplBundles

List<ImplBundle> getImplBundles()

createConnectorType

ConnectorType createConnectorType(String name,
                                  Attributes attrs)
                                  throws LdapConfigurationException
Return represents a single custom connector or particular configuration for a dynamic connector.

Parameters:
name - Name of connector type.
attrs - Attributes passed in through the LDAP front-end, possibly written over the top of attrs persisted previously if there are any.
Returns:
New empty connector type.
Throws:
LdapConfigurationException

destroyConnectorType

void destroyConnectorType(String connTypeName)
                          throws LdapConfigurationException
Shuts down specific connectorType on this factory.

Parameters:
connTypeName - Name of connector type.
Throws:
LdapConfigurationException

createConnector

Connector createConnector(ConnectorType type,
                          String namingAttr,
                          String name,
                          LdapDN suffix,
                          Attributes attrs)
                          throws LdapConfigurationException
Return a new connector based on attributes saved for parent connector type combined with provided attrs.

Parameters:
type - Parent connector type grouping all connector instances implemented by a common custom option, or sharing a common dynamic configuration.
namingAttr - Passed in so a sanity check can be done against the implementation bundle on the original DN.
name - Name specified for connector by end-user.
suffix -
attrs - Attributes for this connector.
Returns:
New connector which has been registered with its parent type.
Throws:
LdapConfigurationException

getConnectorTypeFilePath

String getConnectorTypeFilePath(String connTypeName)

getConnectorFilePath

String getConnectorFilePath(String connTypeName,
                            String connName)

createLogger

Logger createLogger(String connTypeName,
                    String connName)
Create a logger for the connector with the provided name.


setLogLevel

void setLogLevel(ConnectorType connectorType,
                 Logger logger,
                 Attributes attrs)
Set logging level on a connector's logger using metadata (and possibly static configuration) combined with values contained in attrs, or do nothing if no logging related attributes are present in attrs. Note the signature of this method may seem a little odd, but this is to handle the usescase where logger must be configured for a connector prior to it actually being created so that any problems encountered during its creation also end up in its dedicated log file.

Parameters:
connectorType - Parent type for connector which owns (or will later be made to own) the provided logger which is to be configured.
logger - Logger on which level should be updated.
attrs - Attributes containing attribute associated with logging (either it has MetaDataDefs.MD_CONN_MAP_TO=MetaConnector.CONN_LOG_SEVERITY_ATTR or it's name was statically assigned via MetaConnectorFactory.setLogLevelAttr(String)) from which new level will be taken (other attributes also come into play in this case).

isAllowMetadataModify

boolean isAllowMetadataModify(ImplBundle implBundle)
To determine if the metadata files (eTMetadata and eTOpbindingMetadata) are allowed to modify based on the settings in isAllowMetadataModifyGlobally defined in server_jcs.xml and isAllowMetadataModify in connector.xml.

Parameters:
implBundle -
Returns:

isDynamicConnectorType

boolean isDynamicConnectorType(LdapDN connTypeDn)
Method to check if a connector type is dynamic based on it's DN.

This method uses information from the connector type ImplBundle.

Parameters:
connTypeDn - the connector type DN.
Returns:
true if dynamic.


Created 2011-07-14 13:27 EST