com.ca.jcs.sdk
Class SDKMetaConnector

java.lang.Object
  extended by org.apache.directory.server.core.partition.AbstractPartition
      extended by com.ca.jcs.BaseConnector
          extended by com.ca.jcs.meta.MetaConnector
              extended by com.ca.jcs.sdk.SDKMetaConnector
All Implemented Interfaces:
Activatable, CachingConnector, Connector, PartitionOps, OpProcessorStyleFactory, QuoteStringHandler, Partition

public class SDKMetaConnector
extends MetaConnector

This sample connector uses flat files as its target managed endpoint system. All accounts and groups for the directory are stored as files under the filesystem directory specified by ${eTSDKPath}\SDK\<SDK Directory Name>", where ${eTSDKPath} is the value of this LDAP attribute and specifies a path local to the machine running the JCS. Account objects are stored in files with the extension ".sdk", and group in files with the extension ".grp".


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ca.jcs.meta.MetaConnector
MetaConnector.FilterAware, MetaConnector.SearchFinishedException
 
Field Summary
static String BASE_OUT_DIRECTORY
           
static String CONN_FILE_PREFIX
           
 
Fields inherited from class com.ca.jcs.meta.MetaConnector
ALIAS_ACCOUNT_OBJECT, ALIAS_GROUP_OBJECT, CONN_BASE_DN_ATTR, CONN_DESCRIPTION_ATTR, CONN_HOST_ATTR, CONN_LOG_SEVERITY_ATTR, CONN_NAME_ATTR, CONN_PASSWORD_ATTR, CONN_PORT_ATTR, CONN_REMOTE_VERSION_ATTR, CONN_SECURE_ATTR, CONN_URL_ATTR, CONN_USERNAME_ATTR, dailyLog, DYNAMIC_ATTR_INFO_ATTR, logConnAttrs, READ_ONLY_VALIDATOR, virtualContainers
 
Fields inherited from class com.ca.jcs.BaseConnector
acceptedUnknownAttrIds, attributeStyleOpProcessor, CONN_ACTIVATION_TIMEOUT, CONN_DN, CONN_NAME, CONN_NAME_ID, CONN_PASS_THROUGH_SUFFIX, CONN_PASS_THROUGH_SUFFIX_LEN, CONN_ROLLBACK_CONNECTION_ATTRS, CONN_SKIP_PERSISTER_DELETE_ATTR, CONN_SPEC, CONN_SPEC_INTERNAL, CONNECTOR_ATTR_INDEX, connectorBaseDn, EMPTY_DN, LDAP_ATTR_INDEX, LDAP_CONN_DN, ldapExceptionPrefix, log, SEARCH_RESULTS_STREAMING
 
Fields inherited from interface com.ca.jcs.Connector
STATE_DELETING
 
Fields inherited from interface org.apache.directory.server.core.partition.Partition
ALIAS_ATTRIBUTE, ALIAS_OBJECT
 
Constructor Summary
SDKMetaConnector(ConnectorType type, String name, Logger log, ConnectorConfig config)
          have to implement this constructor signiture, otherwise JCS will fail to load.
 
Method Summary
 void activate()
          This sample creates the base output directory here.
 AttributeStyleOpProcessor createAttributeStyleOpProcessor()
          Must implement this method to create a attribute style processor so JCS can delegate LDAP operations to it.
 ConnectionManager createConnectionManager()
          Create a connection manager, which is a concept expected to be supported by the vast majority of connectors.
 void deactivate()
          This sample does not need to do much here, noting that super.deactivate() handles cleaning up the connection pool.
 Collection<? extends MetaConnector.FilterAware> getFilterAwareness()
          Override in a connector to flag whether connector fully implements search filter support.
 boolean isBehaviourImperfectFilter()
           
 boolean isBehaviourSearchObjAsLookup()
          Behavioural method which should be overridden by derived classes if they want object-scope searches to be treated as lookup()s on the object referred to by the baseName.
 boolean isBehaviourSearchSingleClass()
          If a derived connector's implementational approach requires that it's OpProcessor.doSearch(com.ca.jcs.ObjectInfo, com.ca.jcs.filter.FilterInfo, java.util.Map, javax.naming.directory.SearchControls) method is called is only called for a single objectclass at a time, then they should override this method to return true.
 
Methods inherited from class com.ca.jcs.meta.MetaConnector
add, convertAttributes, convertAttributesFromConnector, convertDNFromConnector, convertDNToConnector, convertDNToConnector, convertModificationItems, convertToException, convertToException, delete, getAssocReverseConnectorAttrId, getAttributeStyleOpProcessorChain, getCacheableStatus, getClassMappingFromConnectorAttrs, getClassMappingFromConnectorObjectClass, getClassMappings, getConnectorAttributesProcessor, getConnectorClassMap, getConnectorObjectClass, getConnectorObjectClasses, getDefaultConnectorSearchAttrIds, getDefaultSearchLdapAttrIds, getDNAttrIds, getEhCacheManager, getErrClassId, getFilterInfo, getFilterInfo, getFilterInfo, getFilterInfo, getFilterInfo, getFilterInfo, getFilterInfo, getFilterObjClass, getIncludedDnLdapAttrId, getMetaConnectorConfig, getMetaConnectorType, getModifyMonitorCache, getObjectClassFromAmbiguousConnAttr, getObjectClassFromConnAttr, getObjectInfo, getObjectInfo, getObjectInfo, getObjectInfo, getObjectInfo, getOpProcessor, getOpProcessorForSearch, getPostQueryAttributesProcessor, getRequestedConnAttrIds, getRootObjectInfo, getSearchBaseObjectInfo, getSearchBaseObjectInfo, getVirtualContainers, hasMetaOpBindingsProxy, isAcceptedUnknownAttrId, isAmibguousLdapDn, isFilterSingleClassMatching, isLockedModify, isLockedModify, isRootDN, isRootDN, isSearchAsLookup, isSearchOutsideClassContainer, isValidContainmentSearchResult, lookup, mapAttributeIdsToConnector, mapAttributeIdsToConnector, mapAttributeIdToConnector, mapAttributeIdToLdap, mapAttributesIdsToConnector, mapAttributesIdsToLdap, mapModificationItems, mapObjectClassAttributeIdsToConnector, matchDNToClassMap, modify, modifyRn, move, move, normalizeConnDn, normalizeConnDnAttr, normalizeConnectorDn, normalizeConnectorDnAttrs, notifyMetaData, performLockedOperation, resolveObjectClass, search, search, searchImpl, searchObjectScopeAsLookup, searchOneClass, searchVirtualContainers, setAttributeStyleOpProcessor, setClassMappings, setConnectorAttributesProcessor, setMethodStyleOpProcessor, setScriptStyleOpProcessor, validateAttributes, validateAttributes, validateDNForSearchContainer
 
Methods inherited from class com.ca.jcs.BaseConnector
addConnectorBaseDN, appQuoted, appQuoted, bind, convertConnectorDNFromNativeName, convertConnectorDNToNativeName, createConnectorDn, createConnectorDn, createMethodStyleOpProcessor, createObjectInfo, createScriptStyleOpProcessor, createTransactionManager, doInit, formatConnectorPassThroughAttrId, formatConnectorPassThroughValue, getAcceptedUnknownAttrIds, getAttributes, getAttributeStyleOpProcessor, getAttributeTypeRegistry, getAutoDirectAssocExlusions, getCacheManager, getConnectionManager, getConnectorBaseDn, getConnectorConfig, getConnectorDnRdn, getConnectorPassThroughValue, getLdapExceptionPrefix, getLdapNamingAttr, getLdapObjectClass, getLogger, getMethodStyleOpProcessor, getName, getPartition, getPassThroughAttrIdToConnector, getScriptStyleOpProcessor, getStateFlags, getStoredSuffix, getTransactionManager, getType, getUpSuffix, isActivated, isAutoDirectAssocRequired, isBehaviourCachingRequired, isBehaviourStrictConnectorDns, isCachingActive, isCachingPossible, isCachingRequired, isCheckObjectExistenceForDeletion, isConnectorPassThrough, isHiddenLdapBaseDn, isIndirectAssociations, isObjectClassRequired, isSuffix, list, mapAttributeIdsToConnector, modifyAttributes, noQuote, passThroughAttrIdToConnector, postProcessLdapSearchResult, removeConnectorBaseDN, setAcceptedUnknownAttrIds, setActivated, setAttributes, setCacheManager, setCachingRequired, setConnectionManager, setConnectorBaseDn, setConnectorConfig, setLdapNamingAttr, setLdapObjectClass, setLogger, setName, setQuoteString, setStateFlags, setStoredSuffix, setTransactionManager, setType, splitConnectorPassThroughAttrId, toString, unbind, upName
 
Methods inherited from class org.apache.directory.server.core.partition.AbstractPartition
destroy, doDestroy, getConfiguration, getFactoryConfiguration, getSuffix, hasEntry, init, isInitialized, lookup, modify, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ca.jcs.PartitionOps
lookup, modify, sync
 
Methods inherited from interface org.apache.directory.server.core.partition.Partition
destroy, getSuffix, hasEntry, init, isInitialized, lookup, modify, sync
 

Field Detail

BASE_OUT_DIRECTORY

public static final String BASE_OUT_DIRECTORY
See Also:
Constant Field Values

CONN_FILE_PREFIX

public static final String CONN_FILE_PREFIX
See Also:
Constant Field Values
Constructor Detail

SDKMetaConnector

public SDKMetaConnector(ConnectorType type,
                        String name,
                        Logger log,
                        ConnectorConfig config)
have to implement this constructor signiture, otherwise JCS will fail to load. ConnectorType is the Namesapce type; Name is the directory name.

Method Detail

isBehaviourSearchObjAsLookup

public boolean isBehaviourSearchObjAsLookup()
Description copied from class: BaseConnector
Behavioural method which should be overridden by derived classes if they want object-scope searches to be treated as lookup()s on the object referred to by the baseName.

Overrides:
isBehaviourSearchObjAsLookup in class BaseConnector
Returns:
True if object-scope searches are to be implemented as lookups, false (the default) otherwise.

isBehaviourImperfectFilter

public boolean isBehaviourImperfectFilter()

isBehaviourSearchSingleClass

public boolean isBehaviourSearchSingleClass()
Description copied from class: BaseConnector
If a derived connector's implementational approach requires that it's OpProcessor.doSearch(com.ca.jcs.ObjectInfo, com.ca.jcs.filter.FilterInfo, java.util.Map, javax.naming.directory.SearchControls) method is called is only called for a single objectclass at a time, then they should override this method to return true. This will cause the framework, for example, to decompose a subtree search with a filter like (objectclass=*) into a separate doSearch() call for each defined objectclass.

Overrides:
isBehaviourSearchSingleClass in class BaseConnector

activate

public final void activate()
                    throws NamingException
This sample creates the base output directory here. However, your connector might need to create connection (or connection pool) for your target system here based on the connection details passed as directory attributes. Call BaseConnector.getAttributes() to get the directory attributes. Note that there is no need to check that attributes marked as "isRequired" in the metadata are defined here; they are guaranteed to be because the framework applies validation and conversion before this method is called.

Specified by:
activate in interface Activatable
Specified by:
activate in interface Connector
Overrides:
activate in class MetaConnector
Throws:
NamingException

deactivate

public final void deactivate()
                      throws NamingException
This sample does not need to do much here, noting that super.deactivate() handles cleaning up the connection pool.

Specified by:
deactivate in interface Activatable
Specified by:
deactivate in interface Connector
Overrides:
deactivate in class MetaConnector
Throws:
NamingException

createConnectionManager

public ConnectionManager createConnectionManager()
Description copied from class: BaseConnector
Create a connection manager, which is a concept expected to be supported by the vast majority of connectors. Some exceptional cases like JDBC in which many APIs take a DataSource (like a connection manager / pool itself) rather then a connection may throw a LdapOperationNotSupportedException exception when called.

Note that this method is defined to make the contract explicit for connector developers and for internal use with in the connector and its op processors, rather then to be called by components external to the connector. Default 'base' implementation below uses 'connectionManagerClass' spring property from connector.xml to locate the nominated connection manager (pooling) class and load/instantiate it for subsequent use. Specific connector implementations can override this and perform their own connection manager creation.

Specified by:
createConnectionManager in interface Connector
Overrides:
createConnectionManager in class BaseConnector
Returns:
Connection manager instance.

createAttributeStyleOpProcessor

public AttributeStyleOpProcessor createAttributeStyleOpProcessor()
Must implement this method to create a attribute style processor so JCS can delegate LDAP operations to it.


getFilterAwareness

public Collection<? extends MetaConnector.FilterAware> getFilterAwareness()
Description copied from class: MetaConnector
Override in a connector to flag whether connector fully implements search filter support. This means an ability to work with complex filters and support for various types of filter expressions. When a complex search filter is encountered and connector is not filter aware the framework will impose post filtering on any search results. Note that post filtering always achieves correctness at a cost of effiency because connector is going to supply all the data (filter is ignored) for the post filtering to deal with. It's always a good idea to not have to rely on isFilterAware=false and implement the filtering in the connector itself using native semantics. Note that any simple filters will not result in post filtering unless the connector is sufficiently dumbed down such that use of non filterable attributes is imposed (isConnectorFilterable=false) or use of filter types to complex for a given connector.

Overrides:
getFilterAwareness in class MetaConnector
Returns:
Collection of FilterAware levels corresponding to the state of connector's filter support


Created 2011-07-14 13:27 EST