com.ca.jcs.stub
Class StubMetaConnector

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.stub.StubMetaConnector
All Implemented Interfaces:
Activatable, CachingConnector, Connector, PartitionOps, OpProcessorStyleFactory, QuoteStringHandler, Partition

public class StubMetaConnector
extends MetaConnector

Stub metaconnector useful in method-style and scripting-style opbindings demonstrations. For production will most probably need to be extended so a ConnectionManager implementation can be coded. This connector is usually configured using a StubMetaConnectorConfig instance so that any values configured will override the default behaviours in BaseConnector (normally connectors statically define these behavioural parameters as part of their implementation, but this class is used more flexibly).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ca.jcs.meta.MetaConnector
MetaConnector.FilterAware, MetaConnector.SearchFinishedException
 
Field Summary
 
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
StubMetaConnector(ConnectorType type, String name, Logger log, ConnectorConfig config)
          have to implement this constructor signiture, otherwise JCS will fail to load.
 
Method Summary
 AttributeStyleOpProcessor createAttributeStyleOpProcessor()
          Returns a StubAttributeStyleOpProcessor instance.
 ConnectionManager createConnectionManager()
          Creates connector's custom connection pooling class.
 HashSet<OpProcessor.MethodName> getAutoDirectAssocExlusions()
          Used by connectors for which BaseConnector.isAutoDirectAssocRequired() returns true, where updates of associations after Delete / Rename or other operations are not required due to clean-up performed by the native system or because of special processing needs.
 StubMetaConnectorConfig getStubMetaConnectorConfig()
           
 boolean isAutoDirectAssocRequired()
          Defaults to BaseConnector.isIndirectAssociations()==Boolean.FALSE.
 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.
 boolean isHiddenLdapBaseDn()
           
 Boolean isIndirectAssociations()
          Never returns null, defaults to false unless overridden by stubMetaConnectorConfig.
 boolean isObjectClassRequired()
          True if connector need the "objectClass" attribute passed through to them when a) updating a child object or b) in search filters, otherwise false if this information is known contextually and this attribute should not be passed through.
 
Methods inherited from class com.ca.jcs.meta.MetaConnector
activate, add, convertAttributes, convertAttributesFromConnector, convertDNFromConnector, convertDNToConnector, convertDNToConnector, convertModificationItems, convertToException, convertToException, deactivate, delete, getAssocReverseConnectorAttrId, getAttributeStyleOpProcessorChain, getCacheableStatus, getClassMappingFromConnectorAttrs, getClassMappingFromConnectorObjectClass, getClassMappings, getConnectorAttributesProcessor, getConnectorClassMap, getConnectorObjectClass, getConnectorObjectClasses, getDefaultConnectorSearchAttrIds, getDefaultSearchLdapAttrIds, getDNAttrIds, getEhCacheManager, getErrClassId, getFilterAwareness, 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, getCacheManager, getConnectionManager, getConnectorBaseDn, getConnectorConfig, getConnectorDnRdn, getConnectorPassThroughValue, getLdapExceptionPrefix, getLdapNamingAttr, getLdapObjectClass, getLogger, getMethodStyleOpProcessor, getName, getPartition, getPassThroughAttrIdToConnector, getScriptStyleOpProcessor, getStateFlags, getStoredSuffix, getTransactionManager, getType, getUpSuffix, isActivated, isBehaviourCachingRequired, isBehaviourStrictConnectorDns, isCachingActive, isCachingPossible, isCachingRequired, isCheckObjectExistenceForDeletion, isConnectorPassThrough, 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
 

Constructor Detail

StubMetaConnector

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

Method Detail

getStubMetaConnectorConfig

public StubMetaConnectorConfig getStubMetaConnectorConfig()

createConnectionManager

public ConnectionManager createConnectionManager()
                                          throws NamingException
Creates connector's custom connection pooling class. Can either override this class and implement it for production or use base default implementation which can load and initialize connection pooling class nominated in 'connectionManagerClass' property in connector.xml. Any such class must have a constructor with signature: (Attributes, GenericObjectPool.Config , Logger ) and be able to create a connection factory from connector level attributes passed in.

Specified by:
createConnectionManager in interface Connector
Overrides:
createConnectionManager in class BaseConnector
Returns:
Connection manager instance.
Throws:
NamingException
See Also:
com.ca.jcs.StubMetaConnectionPool

createAttributeStyleOpProcessor

public AttributeStyleOpProcessor createAttributeStyleOpProcessor()
Returns a StubAttributeStyleOpProcessor instance.


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.

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

isObjectClassRequired

public boolean isObjectClassRequired()
True if connector need the "objectClass" attribute passed through to them when a) updating a child object or b) in search filters, otherwise false if this information is known contextually and this attribute should not be passed through. Unless overridden returns !isBehaviourSearchSingleClass().

Overrides:
isObjectClassRequired in class BaseConnector

isHiddenLdapBaseDn

public boolean isHiddenLdapBaseDn()
Overrides:
isHiddenLdapBaseDn in class BaseConnector
Returns:
True if the LDAP equivalent to the value contained in the attribute attribute mapped to MetaConnector.CONN_BASE_DN_ATTR should be hidden in DNs (distinguished names) returned by the managed system, and not expected to be present in LDAP DNs passed in. By default it is false so that LDAP DNs can be persistently stored and then later used against the same managed system, even if a different connector base DN is used to access it.

isIndirectAssociations

public Boolean isIndirectAssociations()
Never returns null, defaults to false unless overridden by stubMetaConnectorConfig.

Overrides:
isIndirectAssociations in class BaseConnector
Returns:
Null if no special checks are required on associative attributes, otherwise derived connectors should return:
  1. Boolean.TRUE if only indirect associations are allowed
  2. Boolean.FALSE if only direct associations are allowed
  3. NULL if a mixture of both is allowed, as dictated by the metadata
      See Also:
      Association

isAutoDirectAssocRequired

public boolean isAutoDirectAssocRequired()
Description copied from class: BaseConnector
Defaults to BaseConnector.isIndirectAssociations()==Boolean.FALSE. Derived connectors for which this condition is true, but which want to handle reverse virtual associations directly rather then relying on generic logic in AssocAttributeOpProcessorProxy should override to return false.

Overrides:
isAutoDirectAssocRequired in class BaseConnector
Returns:
True if reverse virtual attributes for direct associations should be handled generically by AssocAttributeOpProcessorProxy.
See Also:
BaseConnector.getAutoDirectAssocExlusions()

getAutoDirectAssocExlusions

public HashSet<OpProcessor.MethodName> getAutoDirectAssocExlusions()
Description copied from class: BaseConnector
Used by connectors for which BaseConnector.isAutoDirectAssocRequired() returns true, where updates of associations after Delete / Rename or other operations are not required due to clean-up performed by the native system or because of special processing needs. When exclusions are put into effect due to this method's return value, the concrete connector itself needs to take over responsibility for any splitting and processing of association values required. Some example exclusions are the AS4 endpoint which looks after the membership association itself when accounts or groups are deleted, as does the LND endpoint which cleans up natively after deletes and renames (the latter of which take an unknowable amount of time to be approved).

Overrides:
getAutoDirectAssocExlusions in class BaseConnector
Returns:
Map of operation method names for which auto association handling should not be activated, or null if there are no such exclusions. Defaults to null unless overridden in derived classes.
See Also:
BaseConnector.isAutoDirectAssocRequired()


Created 2011-07-14 13:27 EST