com.ca.jcs.cfg
Class ConnectorConfig

java.lang.Object
  extended by com.ca.jcs.cfg.ConnectorConfig
Direct Known Subclasses:
MetaConnectorConfig

public class ConnectorConfig
extends Object

Common configuration settings shared by all connector implementations.


Field Summary
static Logger CONFIG_LOG
          Centralized point of control for logging of configuration information, for instance to verify that override connector.xml is being used etc.
 
Constructor Summary
ConnectorConfig()
           
 
Method Summary
 List<String> getAcceptedUnknownAttrIds()
           
 Boolean getAllowMetadataModify()
           
 String getAttrHeaderMsgFormatId()
           
 Class<? extends CacheManager> getCacheManagerClass()
           
 String getCacheManagerConfigReference()
           
 MetaPluginConfigSuite getConverters()
           
 Map<String,ExceptionRetryGroup> getExceptionRetryMap()
          Most connectors need to handle some exceptions specially, and this map allows list of messages strings / class names to be defined via configuration to allow maximum flexibility, including adding to entries in this map when new native endpoint vendors are added or higher level support libraries such as drivers are changed etc.
 String getObjHeaderMsgFormatId()
           
 long getResilientDelay()
          Deprecated. Now configure in a more fine-grained manner using ExceptionRetryGroup.
 long getResilientMaxRetries()
          Deprecated. Now configure in a more fine-grained manner using ExceptionRetryGroup.
 boolean getRollbackConnectionAttrs()
           
 String getStaticMetadataFile()
           
 String getStaticMethodScriptStyleMetaDataFile()
           
 int getStreamingQueryThreshold()
           
 AttributeConverter getTypeConverter(String typeString)
           
 MetaPluginConfigSuite getValidators()
           
 boolean isCachingRequired()
          Use is primarily to force caching to be deactivated, even when it is applicable.
 boolean isCaseSensitive()
           
 Boolean isCheckObjectExistenceForDeletion()
           
 boolean isFailOnUnknownAttrIds()
           
 boolean isImmediateQueryFlush()
           
 boolean isLazyConnect()
           
 boolean isMapAcceptedUnknownAttrIds()
           
 boolean isSearchExpensiveAttrs()
          Only return cheap attributes unless explicitly mention expensive ones in one-level/subtree searches.
 boolean isTransactional()
          For connectors supporting a notion of transactions, this field allows them to be expliclty turned off so the steps involved in processing an LDAP operation are not grouped into a single top level transaction as would normally happen.
 boolean isValidateFromConnector()
          Validate ldap attributes outbound from the connector before passing them back, as opposed inbound traffic passed in to the connector.
 boolean isValidateToConnector()
          Validate ldap attributes inbound to the connector as per registered validator configuration.
 void mergeMap(Map<String,List<String>> dest, Map<String,List<String>> src)
          Merge provided maps, concatenating value lists where the same key exists in both.
 void setAcceptedUnknownAttrIds(List<String> acceptedUnknownAttrIds)
          When isFailOnUnknownAttrIds() is true then this list can be used to define attribute ids which aren't mapped, but shouldn't cause an add() or modify() operation to fail when they are mentioned.
 void setAllowMetadataModify(Boolean allowMetadataModify)
          When set to true, values provided to setStaticMetadataFile(java.lang.String) and setStaticMethodScriptStyleMetaDataFile(java.lang.String) can be overridden by LDAP modifies operations on the ConnectorType.
 void setAttrHeaderMsgFormatId(String attrHeaderFmt)
           
 void setCacheManagerClass(Class<? extends CacheManager> cacheManagerClass)
          Can be set to a class which extends CacheManager, but will be ignored unless connector's BaseConnector.isCachingRequired() returns true (signifying that caching makes sense for it's domain).
 void setCacheManagerConfigReference(String cacheManagerConfigReference)
          Optional configuration string which can be passed to concrete implementation of CacheManager, to be interpretted by it (expectation is that it will usually be some kind of URL or reference to a resource or file containing configuration settings).
 void setCachingRequired(boolean cachingRequired)
           
 void setCaseSensitive(boolean caseSensitive)
           
 void setCheckObjectExistenceForDeletion(Boolean checkObjectExistenceForDeletion)
           
 void setConverters(MetaPluginConfigSuite converters)
           
 void setExceptionRetryMap(Map<String,ExceptionRetryGroup> exceptionRetryMap)
          Store provided map of entries taken from settings in connector.xml.
 void setFailOnUnknownAttrIds(boolean failOnUnknownAttrIds)
          If set to true then unknown attributes (excluding any defined in getAcceptedUnknownAttrIds()) appearing in add() and modify() calls will cause these operations to fail with an exception, if set to false then only a warning is logged but the operation continues.
 void setImmediateQueryFlush(boolean immediateQueryFlush)
          Read and process all results in an internal list cache, and then have NamingEnumeration just return the results from the buffer, may be useful when debugging to help synchronize processing to the call stack.
 void setLazyConnect(boolean lazyConnect)
          When true a connector implementation should not attempt to get a connection from the pool immediately.
 void setMapAcceptedUnknownAttrIds(boolean mapAcceptedUnknownAttrIds)
           
 void setObjHeaderMsgFormatId(String objHeaderMsgFormatId)
           
 void setResilientDelay(long resilientDelay)
          Deprecated. Now configure in a more fine-grained manner using ExceptionRetryGroup.
 void setResilientMaxRetries(long resilientMaxRetries)
          Deprecated. Now configure in a more fine-grained manner using ExceptionRetryGroup.
 void setRollbackConnectionAttrs(boolean rollbackConnectionAttrs)
           
 void setSearchExpensiveAttrs(boolean searchExpensiveAttrs)
           
 void setStaticMetadataFile(String staticMetadataFile)
          Non-dynamic options may have their datamodel.xsd metadata stored in a local file rather then managed as an attribute.
 void setStaticMethodScriptStyleMetaDataFile(String staticMethodScriptStyleMetaDataFile)
          Non-dynamic options may have their opbindings.xsd metadata stored in a local file rather then managed as an attribute.
 void setStreamingQueryThreshold(int streamingQueryThreshold)
          Threshold on count of number of instances of an objectclass, at which list() and search() on the objectclass should be dealt with using streaming of results on-by-one rather then a single immediate query.
 void setTransactional(boolean transactional)
           
 void setValidateFromConnector(boolean validateFromConnector)
           
 void setValidateToConnector(boolean validateToConnector)
          Set validation of ldap attributes inbound to the connector as per registered validator configuration - turn off only with extreme caution (defaults to true)!
 void setValidators(MetaPluginConfigSuite validators)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_LOG

public static final Logger CONFIG_LOG
Centralized point of control for logging of configuration information, for instance to verify that override connector.xml is being used etc.

Constructor Detail

ConnectorConfig

public ConnectorConfig()
Method Detail

getValidators

public MetaPluginConfigSuite getValidators()

setValidators

public void setValidators(MetaPluginConfigSuite validators)

getConverters

public MetaPluginConfigSuite getConverters()

setConverters

public void setConverters(MetaPluginConfigSuite converters)

getTypeConverter

public AttributeConverter getTypeConverter(String typeString)

isSearchExpensiveAttrs

public boolean isSearchExpensiveAttrs()
Only return cheap attributes unless explicitly mention expensive ones in one-level/subtree searches.


setSearchExpensiveAttrs

public void setSearchExpensiveAttrs(boolean searchExpensiveAttrs)

isValidateToConnector

public boolean isValidateToConnector()
Validate ldap attributes inbound to the connector as per registered validator configuration.

Returns:
Current setting for inbound validation.

setValidateToConnector

public void setValidateToConnector(boolean validateToConnector)
Set validation of ldap attributes inbound to the connector as per registered validator configuration - turn off only with extreme caution (defaults to true)!


isValidateFromConnector

public boolean isValidateFromConnector()
Validate ldap attributes outbound from the connector before passing them back, as opposed inbound traffic passed in to the connector.

Returns:
Current setting for outbound validation.

setValidateFromConnector

public void setValidateFromConnector(boolean validateFromConnector)

isCaseSensitive

public boolean isCaseSensitive()

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)

getAllowMetadataModify

public Boolean getAllowMetadataModify()

setAllowMetadataModify

public void setAllowMetadataModify(Boolean allowMetadataModify)
When set to true, values provided to setStaticMetadataFile(java.lang.String) and setStaticMethodScriptStyleMetaDataFile(java.lang.String) can be overridden by LDAP modifies operations on the ConnectorType.

Think carefully about implications of leaving this set to true in production.


getObjHeaderMsgFormatId

public String getObjHeaderMsgFormatId()

setObjHeaderMsgFormatId

public void setObjHeaderMsgFormatId(String objHeaderMsgFormatId)

getAttrHeaderMsgFormatId

public String getAttrHeaderMsgFormatId()

setAttrHeaderMsgFormatId

public void setAttrHeaderMsgFormatId(String attrHeaderFmt)

isLazyConnect

public boolean isLazyConnect()

setLazyConnect

public void setLazyConnect(boolean lazyConnect)
When true a connector implementation should not attempt to get a connection from the pool immediately.


isFailOnUnknownAttrIds

public boolean isFailOnUnknownAttrIds()

setFailOnUnknownAttrIds

public void setFailOnUnknownAttrIds(boolean failOnUnknownAttrIds)
If set to true then unknown attributes (excluding any defined in getAcceptedUnknownAttrIds()) appearing in add() and modify() calls will cause these operations to fail with an exception, if set to false then only a warning is logged but the operation continues.

Parameters:
failOnUnknownAttrIds - True for strict handling.

getAcceptedUnknownAttrIds

public List<String> getAcceptedUnknownAttrIds()

setAcceptedUnknownAttrIds

public void setAcceptedUnknownAttrIds(List<String> acceptedUnknownAttrIds)
When isFailOnUnknownAttrIds() is true then this list can be used to define attribute ids which aren't mapped, but shouldn't cause an add() or modify() operation to fail when they are mentioned.

Parameters:
acceptedUnknownAttrIds - List of legal, but never-the-less unmapped, LDAP attribute ids.

getStreamingQueryThreshold

public int getStreamingQueryThreshold()

isImmediateQueryFlush

public boolean isImmediateQueryFlush()

setImmediateQueryFlush

public void setImmediateQueryFlush(boolean immediateQueryFlush)
Read and process all results in an internal list cache, and then have NamingEnumeration just return the results from the buffer, may be useful when debugging to help synchronize processing to the call stack.

Parameters:
immediateQueryFlush - If true, then results will be readn and processed immediately and place in cache.

setStreamingQueryThreshold

public void setStreamingQueryThreshold(int streamingQueryThreshold)
Threshold on count of number of instances of an objectclass, at which list() and search() on the objectclass should be dealt with using streaming of results on-by-one rather then a single immediate query.

Parameters:
streamingQueryThreshold - When there are more instances of an objectclass then this threshold, then query results should be streamed. If it is set to 0 then streaming will be exclusively for all objectclasses, if set to -1 then streaming will never be used. Connectors can decide to ignore this threshold for one or more objectclasses but if so, they must clearly document this fact.

getResilientDelay

public long getResilientDelay()
Deprecated. Now configure in a more fine-grained manner using ExceptionRetryGroup.

A value <=0 signifies that resiliency is configured to be off.


setResilientDelay

public void setResilientDelay(long resilientDelay)
Deprecated. Now configure in a more fine-grained manner using ExceptionRetryGroup.


getResilientMaxRetries

public long getResilientMaxRetries()
Deprecated. Now configure in a more fine-grained manner using ExceptionRetryGroup.

A value of 0 signifies there is no limit to the number of retries (not recommended in production).


setResilientMaxRetries

public void setResilientMaxRetries(long resilientMaxRetries)
Deprecated. Now configure in a more fine-grained manner using ExceptionRetryGroup.


isTransactional

public boolean isTransactional()
For connectors supporting a notion of transactions, this field allows them to be expliclty turned off so the steps involved in processing an LDAP operation are not grouped into a single top level transaction as would normally happen.


setTransactional

public void setTransactional(boolean transactional)

isCachingRequired

public boolean isCachingRequired()
Use is primarily to force caching to be deactivated, even when it is applicable.


setCachingRequired

public void setCachingRequired(boolean cachingRequired)

getCacheManagerClass

public Class<? extends CacheManager> getCacheManagerClass()

setCacheManagerClass

public void setCacheManagerClass(Class<? extends CacheManager> cacheManagerClass)
Can be set to a class which extends CacheManager, but will be ignored unless connector's BaseConnector.isCachingRequired() returns true (signifying that caching makes sense for it's domain). Currently expected that caching will only make sense for connectors making use of connectorMapToAmbiguous= metadata settings, particularly when one or more naming attributes are ambiguous and the native system is heirarchical. Can be set to null (or simply omitted) to explicitly turn off caching for a connector for which caching makes sense, for instance when trying to compare performance tests with and without. The recommended default class is EHCacheManager (just use the string <cacheManagerClass>com.ca.jcs.cache.EHCacheManager</cacheManagerClass> in conf/connector.xml).

Parameters:
cacheManagerClass -

getCacheManagerConfigReference

public String getCacheManagerConfigReference()

setCacheManagerConfigReference

public void setCacheManagerConfigReference(String cacheManagerConfigReference)
Optional configuration string which can be passed to concrete implementation of CacheManager, to be interpretted by it (expectation is that it will usually be some kind of URL or reference to a resource or file containing configuration settings).


mergeMap

public void mergeMap(Map<String,List<String>> dest,
                     Map<String,List<String>> src)
Merge provided maps, concatenating value lists where the same key exists in both.


getExceptionRetryMap

public Map<String,ExceptionRetryGroup> getExceptionRetryMap()
Most connectors need to handle some exceptions specially, and this map allows list of messages strings / class names to be defined via configuration to allow maximum flexibility, including adding to entries in this map when new native endpoint vendors are added or higher level support libraries such as drivers are changed etc.

Returns:
Map of exception related strings organised in groups with their own timeout values, where keys are expected to end in "ExceptionMessages" or "ExceptionClasses" to signify what kind of strings are stored in their related entries.

setExceptionRetryMap

public void setExceptionRetryMap(Map<String,ExceptionRetryGroup> exceptionRetryMap)
Store provided map of entries taken from settings in connector.xml.

Parameters:
exceptionRetryMap - Map containing exception maps.

getRollbackConnectionAttrs

public boolean getRollbackConnectionAttrs()

setRollbackConnectionAttrs

public void setRollbackConnectionAttrs(boolean rollbackConnectionAttrs)

isCheckObjectExistenceForDeletion

public Boolean isCheckObjectExistenceForDeletion()

setCheckObjectExistenceForDeletion

public void setCheckObjectExistenceForDeletion(Boolean checkObjectExistenceForDeletion)

isMapAcceptedUnknownAttrIds

public boolean isMapAcceptedUnknownAttrIds()
Returns:
whether to map accepted unknown attribute IDs.

setMapAcceptedUnknownAttrIds

public void setMapAcceptedUnknownAttrIds(boolean mapAcceptedUnknownAttrIds)

getStaticMetadataFile

public String getStaticMetadataFile()

setStaticMetadataFile

public void setStaticMetadataFile(String staticMetadataFile)
Non-dynamic options may have their datamodel.xsd metadata stored in a local file rather then managed as an attribute.

Parameters:
staticMetadataFile - Name of file on local filesystem (to the machine on which the JCS is installed) containing static metadata for implemented connector type. If null then connector is dynamic and metadata must instead be provided in an attribute when new ConnectorType is created via LDAP add.
See Also:
setAllowMetadataModify(java.lang.Boolean), #isAllowMetadataModify

getStaticMethodScriptStyleMetaDataFile

public String getStaticMethodScriptStyleMetaDataFile()

setStaticMethodScriptStyleMetaDataFile

public void setStaticMethodScriptStyleMetaDataFile(String staticMethodScriptStyleMetaDataFile)
Non-dynamic options may have their opbindings.xsd metadata stored in a local file rather then managed as an attribute.

Parameters:
staticMetadataFile - Name of file on local filesystem (to the machine on which the JCS is installed) containing static metadata for implemented connector type. If null then connector is dynamic and metadata must instead be provided in an attribute when new ConnectorType is created via LDAP add.
See Also:
setAllowMetadataModify(java.lang.Boolean), #isAllowMetadataModify


Created 2011-07-14 13:27 EST