|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.server.core.partition.AbstractPartition
com.ca.jcs.BaseConnector
com.ca.jcs.meta.MetaConnector
public abstract class MetaConnector
A connector which is configured via metadata, encompassing both flat (eg SDK, JDBC connector) and hierarchical (eg JNDI, LDA connector) varieties. Flat connectors typically:
conf/connector.xml descriptors or metadata (refer to the SDK sample connector for an example) and
BaseConnector.isBehaviourSearchSingleClass() to return true so that searches over multiple objectclasses are
broken up into sub-searches over one objectclass at a time.
BaseConnector.isBehaviourSearchSingleClass() if the native systems to which they talk have search
filter semantics that map well to LDAP.
Every effort should be made to ensure that NamingExceptions thrown by this class and any derived classes
(concrete connectors, in particular) must implement LdapException so
that valid LDAP result codes are known and can be passed back to the client. These codes are then sanity
checked by PartitionLoaderService against the per-operation sets
of allowable codes defined in ResultCodeEnum.
| Nested Class Summary | |
|---|---|
static class |
MetaConnector.FilterAware
Identifies filter awareness levels of a given connector |
protected static class |
MetaConnector.SearchFinishedException
|
| Field Summary | |
|---|---|
static String |
ALIAS_ACCOUNT_OBJECT
Standard ConnectorMapToAlias= values expected in Connector class metadata. |
static String |
ALIAS_GROUP_OBJECT
|
static String |
CONN_BASE_DN_ATTR
|
static String |
CONN_DESCRIPTION_ATTR
|
static String |
CONN_HOST_ATTR
Standard connectorMapTo value for endpoint host. |
static String |
CONN_LOG_SEVERITY_ATTR
Can be mapped to an attribute containing Log4j Level string. |
static String |
CONN_NAME_ATTR
Standard connectorMapTo= values expected in Connector class' metadata. |
static String |
CONN_PASSWORD_ATTR
Standard connectorMapTo value for endpoint password. |
static String |
CONN_PORT_ATTR
Standard connectorMapTo value for endpoint port. |
static String |
CONN_REMOTE_VERSION_ATTR
Version of interface running on managed sytem. |
static String |
CONN_SECURE_ATTR
Secure communications to managed system, eg TLS for JNDI. |
static String |
CONN_URL_ATTR
Where possible connection based on a flexible URL is preferred on the server-side to a large collection of specific fields, as it provides a much easier means of handling extensions to the set of attributes and deals naturally with different attributes required by different vendors. |
static String |
CONN_USERNAME_ATTR
Standard connectorMapTo value for endpoint username. |
static Logger |
dailyLog
Logs all fully converted values on the way to/from the connector. |
static String |
DYNAMIC_ATTR_INFO_ATTR
connectorMapTo value for multi-valued attribute in which easily parsed summary of custom attribute values will be returned (each value is a pair of the form "ldap attr id;display name"). |
static Logger |
logConnAttrs
|
protected static ReadOnlyPropertyValidator |
READ_ONLY_VALIDATOR
|
protected VirtualContainers |
virtualContainers
|
| 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 | |
|---|---|
MetaConnector(ConnectorType type,
String name,
Logger log,
ConnectorConfig config)
Create a connector, including settings from a configuration object. |
|
| Method Summary | ||
|---|---|---|
void |
activate()
Calls super.activate() which creates and registers the connection manager, as well as notifying this connector instance
of its metadata. |
|
void |
add(LdapDN name,
Attributes attrs)
Handle an LDAP ADD request for a connector itself, or a child object of a connector. |
|
protected static void |
convertAttributes(MetaObjectClassMapping classMap,
Attributes attrs,
boolean toConnector)
Handle conversion of attributes in either direction, as dictated by the toConnector. |
|
Attributes |
convertAttributesFromConnector(Name connDn,
String ldapDnStr,
MetaObjectClassMapping classMap,
Set<String> requestedConnAttrIds,
Attributes connAttrs,
boolean strict)
Handles taking connector-speak attributes and fully converting them into LDAP equivalent. |
|
LdapDN |
convertDNFromConnector(Name connDn,
MetaObjectClassMapping leafClassMap,
SearchResult sr,
Boolean isRelative)
Convert a DN (distinguished name) from connector-speak to it's LDAP equivalent, where this is required for: Each search result returned by list() or search() Any attribute values stored on the connector end that contain DN values. |
|
Name |
convertDNToConnector(LdapDN ldapDn)
Call convertDNToConnector(org.apache.directory.shared.ldap.name.LdapDN, boolean) with last arg (tryCache) =true. |
|
Name |
convertDNToConnector(LdapDN ldapDn,
boolean queryCache)
Convert LDAP DN to connector-speak equivalent, which means stripping the partition suffix from it when present. |
|
ModificationItem[] |
convertModificationItems(ObjectInfo objInfo,
ModificationItem[] items)
Run all relevant converters on items passed to modify operation. |
|
NamingException |
convertToException(ObjectInfo objInfo,
ErrorMessages errs)
Initialize headers from objInfo and generate an exception to be thrown back to the client. |
|
NamingException |
convertToException(String name,
MetaObjectClassMapping classMap,
ErrorMessages errs)
Initialize headers from name and classMap, and generate an exception to be thrown back to the client. |
|
void |
deactivate()
Deactivates this connector's connection manager if one exists. |
|
void |
delete(LdapDN name)
|
|
String |
getAssocReverseConnectorAttrId(ObjectInfo referencingObjInfo,
Association assoc)
Have to override this method (which updates group membership based on the assignment to the person.memberOf attribute), because eTLDAGroup has an ambiguous objectclass
mapping to either of groupOfUniqueNames or groupOfNames which use
the different membership attributes uniqueMember and member
respectively. |
|
AttributeStyleOpProcessorChain |
getAttributeStyleOpProcessorChain()
|
|
CacheableStatus |
getCacheableStatus(ObjectInfo objInfo)
Is the provided object potentially cacheable? |
|
MetaObjectClassMapping |
getClassMappingFromConnectorAttrs(String name,
Attributes attrs)
|
|
protected MetaObjectClassMapping |
getClassMappingFromConnectorObjectClass(Attribute objectClassAttr)
|
|
MetaObjectClassMappings |
getClassMappings()
|
|
ConnectorAttributesProcessor |
getConnectorAttributesProcessor()
|
|
MetaObjectClassMapping |
getConnectorClassMap()
Deprecated. Use MetaObjectClassMappings.getConnectorClassMap() instead. |
|
String |
getConnectorObjectClass(ObjectInfo objInfo)
Return a single connector speak objectClass value |
|
String[] |
getConnectorObjectClasses(ObjectInfo objInfo)
Return a list of all objectClass values present on the native object |
|
protected String[] |
getDefaultConnectorSearchAttrIds(MetaObjectClassMapping classMap)
|
|
protected String[] |
getDefaultSearchLdapAttrIds(MetaObjectClassMapping classMap)
|
|
String[] |
getDNAttrIds(Collection<MetaObjectClassMapping> classMaps,
String[] connAttrIds)
Given a set of conn-speak attr Ids, return all DN typed attr Ids given the classMaps |
|
net.sf.ehcache.CacheManager |
getEhCacheManager()
This manager is for general use and implemented using EHCache (com.ca.jcs.cache.CacheManager deals with caching endpoint data and is configurable). |
|
protected static String |
getErrClassId(MetaObjectClassMapping classMap)
|
|
Collection<? extends MetaConnector.FilterAware> |
getFilterAwareness()
Override in a connector to flag whether connector fully implements search filter support. |
|
FilterInfo |
getFilterInfo(ExprNode filter)
Determine objectClass information from filter, and also map attribute names in the filter to their connector-speak equivalents. |
|
FilterInfo |
getFilterInfo(ExprNode filter,
boolean needObjClassesInFilter)
|
|
FilterInfo |
getFilterInfo(ObjectInfo baseObjInfo,
SearchControls searchControls,
ExprNode filter)
|
|
FilterInfo |
getFilterInfo(ObjectInfo baseObjInfo,
SearchControls searchControls,
ExprNode filter,
boolean needObjClassesInFilter,
boolean searchSingleClass,
MetaObjectClassMapping searchSingleClassMap)
|
|
FilterInfo |
getFilterInfo(ObjectInfo baseObjInfo,
SearchControls searchControls,
ExprNode filter,
ExprNode origClonedFilter,
boolean needObjClassesInFilter,
boolean searchSingleClass,
MetaObjectClassMapping searchSingleClassMap)
|
|
FilterInfo |
getFilterInfo(ObjectInfo baseObjInfo,
SearchControls searchControls,
String ldapFilterStr)
|
|
FilterInfo |
getFilterInfo(String ldapFilterStr)
Return information for provided (ldap-speak) LDAP filter string; useful for connectors which need to use filter strings of their own devising, possibly so to make use of the framework's ability to expand ambiguous connector mappings starting from an ldap-speak filter. |
|
protected FilterInfo |
getFilterObjClass(ExprNode filter)
Determine objectClass information from filter without changing it. |
|
String |
getIncludedDnLdapAttrId(MetaObjectClassMapping classMap,
String[] ldapAttrIds)
Return it if any provided attribute id maps to BaseConnector.CONN_DN on the connector
side, including the special BaseConnector.LDAP_CONN_DN attribute which will always serve
this role regardless of metadata settings. |
|
MetaConnectorConfig |
getMetaConnectorConfig()
|
|
MetaConnectorType |
getMetaConnectorType()
|
|
net.sf.ehcache.Cache |
getModifyMonitorCache()
This cache provides monitor to stop collision of MODIFY requests: for instance guards multiple DELTA MODIFY requests for SAP Roles which has forceModificationMode=REPLACE so that each (lookup of current values + modify of values using delta) sequence happens atomically. |
|
String[] |
getObjectClassFromAmbiguousConnAttr(MetaObjectClassMapping classMap,
String connAttrId)
Return connector objectClass value given a classMap and an ambiguous connector speak attribute |
|
String[] |
getObjectClassFromConnAttr(MetaObjectClassMapping classMap,
String connAttrId)
Return objectClass value to which a connector speak attribute is mapped to either via ambiguous mappings or not. |
|
ObjectInfo |
getObjectInfo(LdapDN ldapDn)
Return null when passed the top-level connector DN, and otherwise break it up into separate components and automatically perform lookups based on these components. |
|
ObjectInfo |
getObjectInfo(LdapDN ldapDn,
boolean mapDN)
Return null when passed the top-level connector DN, and otherwise break it up into separate components and determine object class for object |
|
ObjectInfo |
getObjectInfo(LdapDN ldapDn,
Name connDn)
Create object information using as already-known connDn. |
|
ObjectInfo |
getObjectInfo(Name connDn)
Construct ObjectInfo for a connector DN |
|
ObjectInfo |
getObjectInfo(Name connDn,
MetaObjectClassMapping classMap)
|
|
OpProcessor |
getOpProcessor(ObjectInfo objInfo)
Delegate processing according to level in DIT, connector level will be handled by ConnectorAttributesProcessor. and deeper levels will be handled by AttributeStyleOpProcessor. |
|
protected OpProcessor |
getOpProcessorForSearch(MetaObjectClassMapping classMap)
Get the correct op processor to use for a search. |
|
PostQueryAttributesProcessor |
getPostQueryAttributesProcessor()
Return null if this optional interface isn't implemented by connector's AttributeStyleProcessor or if it is flagged as inactive, otherwise return the active implementation of the interface. |
|
protected Set<String> |
getRequestedConnAttrIds(String[] mapAttrIds,
String dnLdapAttrId)
|
|
ObjectInfo |
getRootObjectInfo()
Return object information for the root node in the DIT, ie the connector itself. |
|
ObjectInfo |
getSearchBaseObjectInfo(MetaObjectClassMapping classMap)
Work out suitable search base for a class and return equivalent ObjectInfo representing this search base |
|
ObjectInfo |
getSearchBaseObjectInfo(ObjectInfo baseObjInfo,
MetaObjectClassMapping classMap)
Work out suitable search base for a class and return equivalent ObjectInfo 'baseObjInfo' is used to determine if any defined search container base should take effect over current search base |
|
VirtualContainers |
getVirtualContainers()
|
|
boolean |
hasMetaOpBindingsProxy()
|
|
boolean |
isAcceptedUnknownAttrId(String ldapAttrId)
|
|
boolean |
isAmibguousLdapDn(LdapDN ldapDn)
Returns true if any RDN in ldapDN has ambiguous mappings. |
|
protected boolean |
isFilterSingleClassMatching(FilterInfo filterInfo)
Check if a filter is targetting a single class |
|
boolean |
isLockedModify(ObjectInfo objInfo,
Association assoc)
By default virtual associations are modified in a locked context |
|
boolean |
isLockedModify(ObjectInfo objInfo,
String[] attrIds)
Allows connector to identify on a per attribute basis whether modifications of the attribute always require locking to prevent data integrity violations during concurrent modifies where native attribute only supports REPLACE style modify semantics. |
|
boolean |
isRootDN(LdapDN name)
|
|
boolean |
isRootDN(Name name)
|
|
protected boolean |
isSearchAsLookup(ObjectInfo baseObjInfo)
Detect if a search qualifies to be replaced by a lookup |
|
boolean |
isSearchOutsideClassContainer(ObjectInfo baseObjInfo,
MetaObjectClassMapping classMap)
Check if current search base is outside any search container DNs defined for the target class |
|
boolean |
isValidContainmentSearchResult(SearchResult sr,
Name mapName,
Name baseDN,
SearchControls searchControls)
Verifies a SearchResult validity |
|
Attributes |
lookup(LdapDN name,
String[] attrIds)
|
|
String[] |
mapAttributeIdsToConnector(Collection<MetaObjectClassMapping> classMaps,
String[] ldapAttrIds,
boolean objectScope)
Map ldapAttrIds belonging to the LDAP object class
matching objectInfo to their connector-speak equivalents,
where the naming attribute is always forced to be present in the first
position. |
|
protected String[] |
mapAttributeIdsToConnector(Collection<MetaObjectClassMapping> classMaps,
String[] ldapAttrIds,
boolean objectScope,
boolean translateSpecialAttrs)
|
|
protected Attribute |
mapAttributeIdToConnector(String objName,
MetaObjectClassMapping classMap,
Attribute attr)
|
|
protected Attribute |
mapAttributeIdToLdap(MetaObjectClassMapping classMap,
Attribute connAttr)
|
|
protected Attributes |
mapAttributesIdsToConnector(ObjectInfo objInfo,
Attributes attrs)
Map attributes from LDAP to connector speak before passing them to the concrete connector for processing, which involves the following steps: Map attribute names from LDAP to connector-speak (note we use the less-strict BasicAttributes
instead of ApacheDS LockableAttributesImpl in order to handle cases like JDBC where
column names which may include multi-byte characters are used as attribute ids). |
|
protected Attributes |
mapAttributesIdsToLdap(Name dn,
MetaObjectClassMapping classMap,
Set<String> requestedConnAttrIds,
Attributes attrs)
Does the reverse of mapAttributesIdsToConnector(com.ca.jcs.ObjectInfo, javax.naming.directory.Attributes), so attributes
passed back by the concrete connector are mapped back into a form
suitable for passing back to the LDAP client, which involves the
following steps:
Map attribute names from connector-speak to LDAP. |
|
protected ModificationItem[] |
mapModificationItems(ObjectInfo objInfo,
ModificationItem[] items)
Clone items and remap to connector-speak attr names, resolving an ambiguous to-connector
mappings as required. |
|
protected String |
mapObjectClassAttributeIdsToConnector(ObjectInfo objInfo,
Attribute connObjClassAttr)
|
|
protected MetaObjectClassMapping |
matchDNToClassMap(Name dn,
String connNamingAttrId)
A helper method that attempts to match a conn-speak DN to a classMap via a lookup |
|
void |
modify(LdapDN name,
ModificationItem[] rawItems)
|
|
void |
modifyRn(LdapDN name,
String newRdnStr,
boolean deleteOldRn)
|
|
void |
move(LdapDN oldName,
LdapDN newParentName)
Simply calls move(LdapDN, LdapDN, String, boolean) with null and true
as the last two parameters. |
|
void |
move(LdapDN oldName,
LdapDN newParentName,
String newRdnStr,
boolean deleteOldRn)
Move an existing object called oldName under new container newParentName,
also changing its RDN (renaming it) if newRdnStr ! |
|
String |
normalizeConnDn(String dnStr,
MetaDataDefs.NormalizeConnValue normalizeMode,
MetaDataDefs.NormalizeConnValueStyle normalizeStyle)
Perform normalization of a conn-speak DN value defined by mode and style |
|
Attribute |
normalizeConnDnAttr(Attribute attr,
MetaDataDefs.NormalizeConnValue normalizeMode,
MetaDataDefs.NormalizeConnValueStyle normalizeStyle)
Perform normalization of a conn-speak DN attribute defined by mode and style |
|
String |
normalizeConnectorDn(MetaObjectClassMapping classMap,
String dnStr,
String ldapAttrId)
Perform conn-speak DN/attribute value normalization given the value and the ldap-speak id Required for JNDI-ADAM which returns attributes from search/lookup with DN values uppercased: CN=foo,OU=bar,DC=baz. |
|
void |
normalizeConnectorDnAttrs(MetaObjectClassMapping classMap,
Attributes attrs)
Perform conn-speak DN/attribute value normalization given the Attributes Required for JNDI-ADAM which returns attributes from search/lookup with DN values uppercased: CN=foo,OU=bar,DC=baz. |
|
void |
notifyMetaData(MetaObjectClassMappings mappings,
boolean opBindChange)
Used to inform connector of new metadata, which may trigger the creation / destruction of various styles of op processors depending on the exact content of the new metadata (and whether concrete connector implements each style). |
|
|
performLockedOperation(ObjectInfo objInfo,
T[] items,
Callable<C> callback)
Performs operation in a locked context on target entry using callback |
|
MetaObjectClassMapping |
resolveObjectClass(String ldapAttributeId,
Name connDN,
Collection<MetaObjectClassMapping> classMaps)
Can be used by connectors that support association attributes containing references to more then one objectclass (refer MetaDataDefs.MD_DN_LDAP_OBJECT_CLASSES
which can't be distinguished by their connector-speak naming attributes alone. |
|
NamingEnumeration<SearchResult> |
search(LdapDN baseName,
Map environment,
ExprNode filter,
SearchControls searchControls)
|
|
protected NamingEnumeration<SearchResult> |
search(ObjectInfo baseObjInfo,
Map<String,String> environment,
FilterInfo filterInfo,
SearchControls searchControls)
Submit single search over multiple classMaps to concrete connector. |
|
protected NamingEnumeration<SearchResult> |
searchImpl(ObjectInfo baseObjInfo,
Map<String,String> environment,
FilterInfo filterInfo,
SearchControls searchControls)
Note that this method can not return null, but must instead return an empty NamingEnumeration if there are no results. |
|
NamingEnumeration<SearchResult> |
searchObjectScopeAsLookup(Name ldapBaseDn,
Name connBaseDn,
Attributes attrs,
String includeDnLdapAttrId)
Turn lookup results (attributes) into query results. |
|
protected NamingEnumeration<SearchResult> |
searchOneClass(ObjectInfo baseObjInfo,
Map<String,String> environment,
FilterInfo filterInfo,
SearchControls searchControls,
MetaObjectClassMapping classMap)
Search over a single class of object specified either by the filter (objectClass assertion) or because it is implied by the baseName. |
|
protected NamingEnumeration<SearchResult> |
searchVirtualContainers(ObjectInfo objInfo,
Map<String,String> environment,
FilterInfo filterInfo,
SearchControls searchControls)
|
|
void |
setAttributeStyleOpProcessor(AttributeStyleOpProcessor asp)
Remember the provided processor, possibly proxying it depending on resiliency configuration settings. |
|
void |
setClassMappings(MetaObjectClassMappings classMappings)
|
|
void |
setConnectorAttributesProcessor(ConnectorAttributesProcessor connectorAttributesProcessor)
Handles operation on connector level of the DIT. |
|
void |
setMethodStyleOpProcessor(MethodStyleOpProcessor obp)
Should be called by connectors that implement method operation bindings (eg JDBC stored procedures), where the actual reference stored may be proxied depending on resiliency / deployment configuration settings from connector.xml. |
|
void |
setScriptStyleOpProcessor(ScriptStyleOpProcessor sop)
Should be called by connectors that implement connector-executed script operation bindings, where the actual reference stored may be proxied depending on resiliency / deployment configuration settings from connector.xml. |
|
protected void |
validateAttributes(String name,
MetaObjectClassMapping classMap,
Attributes attrs,
boolean isQuery)
Run all relevant validators against the provided LDAP domain attributes (never connector-speak) in either direction as dictated by isQuery which, if true, causes class-level validators to
be skipped. |
|
protected void |
validateAttributes(String name,
MetaObjectClassMapping classMap,
Attributes attrs,
boolean isQuery,
ErrorMessages errs)
Run all relevant validators against the provided LDAP domain attributes (never connector-speak) in either direction as dictated by isQuery which, if true, causes class-level validators to
be skipped. |
|
boolean |
validateDNForSearchContainer(MetaObjectClassMapping classMap,
String connDnStr,
boolean throwOnError)
|
|
| 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 |
| Methods inherited from interface com.ca.jcs.processor.OpProcessorStyleFactory |
|---|
createAttributeStyleOpProcessor |
| Field Detail |
|---|
public static final Logger dailyLog
public static final Logger logConnAttrs
protected VirtualContainers virtualContainers
public static final String CONN_NAME_ATTR
connectorMapTo= values expected in Connector class' metadata. Not all connectors
have to use all these values, and some may choose slightly different mapped names for the
same logical placeholder, but this list provides a useful library to encourage standardisation.
Of course, connector-specific derivations of this class are free to add their own extra values
(or override these constants with different strings) as required.
public static final String CONN_URL_ATTR
public static final String CONN_BASE_DN_ATTR
public static final String CONN_DESCRIPTION_ATTR
public static final String CONN_LOG_SEVERITY_ATTR
Level string.
public static final String CONN_SECURE_ATTR
public static final String CONN_REMOTE_VERSION_ATTR
public static final String CONN_HOST_ATTR
public static final String CONN_PORT_ATTR
public static final String CONN_PASSWORD_ATTR
public static final String CONN_USERNAME_ATTR
public static final String ALIAS_ACCOUNT_OBJECT
ConnectorMapToAlias= values expected in Connector class metadata.
public static final String ALIAS_GROUP_OBJECT
public static final String DYNAMIC_ATTR_INFO_ATTR
protected static final ReadOnlyPropertyValidator READ_ONLY_VALIDATOR
| Constructor Detail |
|---|
public MetaConnector(ConnectorType type,
String name,
Logger log,
ConnectorConfig config)
type - Parent connector type for new connector.name - Name of new connector as seen by clients and used in logging messages.log - Logger created specifically for the output from this connector
(name will appear in the filename containing the output).config - Configuration object for the connector, usually taken from a
connector's /conf/connector.xml XML descriptor file.| Method Detail |
|---|
public VirtualContainers getVirtualContainers()
public MetaConnectorConfig getMetaConnectorConfig()
public CacheableStatus getCacheableStatus(ObjectInfo objInfo)
mapLdapDNToConn(com.ca.jcs.ObjectInfo, java.lang.String, java.lang.String, boolean) objInfo.getLdapDn() might be
null as resolving one RDN level at a time.
getCacheableStatus in interface CachingConnectorgetCacheableStatus in class BaseConnectorpublic boolean isAcceptedUnknownAttrId(String ldapAttrId)
public ConnectorAttributesProcessor getConnectorAttributesProcessor()
public void setConnectorAttributesProcessor(ConnectorAttributesProcessor connectorAttributesProcessor)
public AttributeStyleOpProcessorChain getAttributeStyleOpProcessorChain()
public PostQueryAttributesProcessor getPostQueryAttributesProcessor()
public MetaObjectClassMappings getClassMappings()
public void setClassMappings(MetaObjectClassMappings classMappings)
public boolean hasMetaOpBindingsProxy()
MetaOpBindingsProxyHandler sits
between this class and a registered attribute style processor, false otherwise.public void setAttributeStyleOpProcessor(AttributeStyleOpProcessor asp)
setAttributeStyleOpProcessor in interface ConnectorsetAttributeStyleOpProcessor in class BaseConnectorasp - Processor to be used for future attribute-style operations.public void setMethodStyleOpProcessor(MethodStyleOpProcessor obp)
setMethodStyleOpProcessor in interface ConnectorsetMethodStyleOpProcessor in class BaseConnectorobp - Processor to be called after guard conditions have been
checked against an operation to determine relevance.public void setScriptStyleOpProcessor(ScriptStyleOpProcessor sop)
setScriptStyleOpProcessor in interface ConnectorsetScriptStyleOpProcessor in class BaseConnectorsop - Processor to be called after guard conditions have been
checked against an operation to determine relevance.public MetaConnectorType getMetaConnectorType()
public net.sf.ehcache.CacheManager getEhCacheManager()
public net.sf.ehcache.Cache getModifyMonitorCache()
public void activate()
throws NamingException
super.activate() which creates and registers the connection manager, as well as notifying this connector instance
of its metadata.
activate in interface Activatableactivate in interface Connectoractivate in class BaseConnectorNamingException
public void deactivate()
throws NamingException
BaseConnector
deactivate in interface Activatabledeactivate in interface Connectordeactivate in class BaseConnectorNamingExceptionpublic OpProcessor getOpProcessor(ObjectInfo objInfo)
ConnectorAttributesProcessor. and deeper levels will be handled by AttributeStyleOpProcessor.
public Name convertDNToConnector(LdapDN ldapDn,
boolean queryCache)
throws NamingException,
LdapNoSuchAttributeException
Where ambiguous naming attributes are involved, this method may have to go all the way to the managed system in order to determine which choice is the right one at each level of the DN (up to N look-ups may be required for each ambiguous DN component, where N is the number of possible choices). Consequently a cache of connector DNs/objectclasses is going to be added to the JCS framework.
ldapDn - DN to be converted.queryCache - Should the cache be queried (if it is active) to determine if the connector DN
has been previously determined (false if DN returned by cache previously turns out to be stale).
NamingException
LdapNoSuchAttributeExceptionconvertDNToConnector(LdapDN)
@NotNull
public String normalizeConnectorDn(@NotNull
MetaObjectClassMapping classMap,
@NotNull
String dnStr,
@NotNull
String ldapAttrId)
throws NamingException
NamingException
public void normalizeConnectorDnAttrs(@NotNull
MetaObjectClassMapping classMap,
@NotNull
Attributes attrs)
throws NamingException
NamingException
@Nullable
public String normalizeConnDn(@NotNull
String dnStr,
@NotNull
MetaDataDefs.NormalizeConnValue normalizeMode,
@NotNull
MetaDataDefs.NormalizeConnValueStyle normalizeStyle)
@NotNull
public Attribute normalizeConnDnAttr(@NotNull
Attribute attr,
@NotNull
MetaDataDefs.NormalizeConnValue normalizeMode,
@NotNull
MetaDataDefs.NormalizeConnValueStyle normalizeStyle)
throws NamingException
NamingException
public Name convertDNToConnector(LdapDN ldapDn)
throws NamingException,
LdapNoSuchAttributeException
convertDNToConnector(org.apache.directory.shared.ldap.name.LdapDN, boolean) with last arg (tryCache) =true.
NamingException
LdapNoSuchAttributeException
public LdapDN convertDNFromConnector(Name connDn,
MetaObjectClassMapping leafClassMap,
SearchResult sr,
Boolean isRelative)
throws NamingException,
LdapNoSuchAttributeException
connDn - DN to be converted.leafClassMap - Mappings for objectClass which DN is a references an instance of.
In the presence of ambiguous naming attributes this may be critical in performing the
DN resolution, and consequently search results must always include an "objectClass="
attribute to disambiguate. In the second case above (connector-speak DN values) the author of the metadata
is responsible for providing the objectClass name when creating
a DNPropertyConverter for the containing attribute.sr - Connector-speak search results provided when available (i.e. when stepping through
search results as opposed to converting DNs in an association attribute like
group.members), as some connectors may need to know some attribute values in order to
compute LDAP DN (for example UniqueOU support for LND). When null means DN is absolute otherwise sr.isRelative() is
used to determine if a relative, rather then an absolute, DN returned.
Note either way that any specified connectorBaseDn is ignored
(see convertDNToConnector(LdapDN) for discussion of why). Expect
absolute case will be useful for query results only, and that persistently stored DNs
will always be relative.isRelative - If sr is null then this argument can be used used to specify whether
connDn is relative or absolute (see comments on searchResult above), otherwise it should be null.
connDn converted to LDAP.
NamingException
LdapNoSuchAttributeException
public String[] getDNAttrIds(Collection<MetaObjectClassMapping> classMaps,
String[] connAttrIds)
protected MetaObjectClassMapping matchDNToClassMap(Name dn,
String connNamingAttrId)
throws NamingException
NamingException
public boolean isRootDN(LdapDN name)
throws NamingException
NamingException
public boolean isRootDN(Name name)
throws NamingException
NamingExceptionpublic MetaObjectClassMapping getConnectorClassMap()
MetaObjectClassMappings.getConnectorClassMap() instead.
public ObjectInfo getObjectInfo(LdapDN ldapDn,
boolean mapDN)
throws NamingException
NamingException
public ObjectInfo getObjectInfo(LdapDN ldapDn)
throws NamingException
NamingException
public ObjectInfo getObjectInfo(LdapDN ldapDn,
Name connDn)
throws NamingException
NamingException
public ObjectInfo getObjectInfo(Name connDn)
throws NamingException
NamingException
public ObjectInfo getObjectInfo(Name connDn,
MetaObjectClassMapping classMap)
throws NamingException
NamingException
public ObjectInfo getRootObjectInfo()
throws NamingException
NamingException
public void delete(LdapDN name)
throws NamingException
NamingException
public String getAssocReverseConnectorAttrId(ObjectInfo referencingObjInfo,
Association assoc)
throws NamingException
person.memberOf attribute), because eTLDAGroup has an ambiguous objectclass
mapping to either of groupOfUniqueNames or groupOfNames which use
the different membership attributes uniqueMember and member
respectively.
NamingException
protected String mapObjectClassAttributeIdsToConnector(ObjectInfo objInfo,
Attribute connObjClassAttr)
throws NamingException
NamingException
protected Attributes mapAttributesIdsToConnector(ObjectInfo objInfo,
Attributes attrs)
throws NamingException
BasicAttributes
instead of ApacheDS LockableAttributesImpl in order to handle cases like JDBC where
column names which may include multi-byte characters are used as attribute ids).
objInfo - Information about the target object owning the
attributes.attrs - The attributes to be passed to the connector.
NamingException
protected Attribute mapAttributeIdToConnector(String objName,
MetaObjectClassMapping classMap,
Attribute attr)
throws NamingException
NamingException
protected Attributes mapAttributesIdsToLdap(Name dn,
MetaObjectClassMapping classMap,
Set<String> requestedConnAttrIds,
Attributes attrs)
throws NamingException
mapAttributesIdsToConnector(com.ca.jcs.ObjectInfo, javax.naming.directory.Attributes), so attributes
passed back by the concrete connector are mapped back into a form
suitable for passing back to the LDAP client, which involves the
following steps:
classMap - Mapping for object returned by the connector.requestedConnAttrIds - Connectorattrs - Attributes mapped from connector-speak to
JCS's LDAP format.
attrs.
NamingException - Problem reading values provided by the
connector.
protected Attribute mapAttributeIdToLdap(MetaObjectClassMapping classMap,
Attribute connAttr)
public boolean isAmibguousLdapDn(LdapDN ldapDn)
throws NamingException
NamingException
public void add(LdapDN name,
Attributes attrs)
throws NamingException
NamingException
public NamingException convertToException(String name,
MetaObjectClassMapping classMap,
ErrorMessages errs)
public NamingException convertToException(ObjectInfo objInfo,
ErrorMessages errs)
protected void validateAttributes(String name,
MetaObjectClassMapping classMap,
Attributes attrs,
boolean isQuery,
ErrorMessages errs)
throws NamingException
isQuery which, if true, causes class-level validators to
be skipped. Note only called by modify() for compound values, where a MODIFY is really
an ADD.
NamingException
protected void validateAttributes(String name,
MetaObjectClassMapping classMap,
Attributes attrs,
boolean isQuery)
throws NamingException
isQuery which, if true, causes class-level validators to
be skipped.
NamingExceptionprotected static String getErrClassId(MetaObjectClassMapping classMap)
protected static void convertAttributes(MetaObjectClassMapping classMap,
Attributes attrs,
boolean toConnector)
throws NamingException
toConnector.
NamingException
protected ModificationItem[] mapModificationItems(ObjectInfo objInfo,
ModificationItem[] items)
throws NamingException
items and remap to connector-speak attr names, resolving an ambiguous to-connector
mappings as required.
NamingException
public void modify(LdapDN name,
ModificationItem[] rawItems)
throws NamingException
NamingException
public boolean isLockedModify(ObjectInfo objInfo,
String[] attrIds)
MetaDataDefs.MD_IS_IMPLEMENTED_AS_ASSOC
and virtual association attributes are locked.
public boolean isLockedModify(ObjectInfo objInfo,
Association assoc)
@Nullable
public <T,C> C performLockedOperation(@NotNull
ObjectInfo objInfo,
@NotNull
T[] items,
@NotNull
Callable<C> callback)
throws NamingException
NamingException
public ModificationItem[] convertModificationItems(ObjectInfo objInfo,
ModificationItem[] items)
throws NamingException
NamingException
public String[] getObjectClassFromConnAttr(MetaObjectClassMapping classMap,
String connAttrId)
classMap - ClassMap from which the objectClass is determinedconnAttrId - Connector speak attribute for which the objectClass is determined
public String[] getObjectClassFromAmbiguousConnAttr(MetaObjectClassMapping classMap,
String connAttrId)
classMap - ClassMap from which the objectClass is determinedconnAttrId - One of the ambiguous connector speak attribute values
public FilterInfo getFilterInfo(ExprNode filter,
boolean needObjClassesInFilter)
throws LdapNamingException
LdapNamingException
public FilterInfo getFilterInfo(ObjectInfo baseObjInfo,
SearchControls searchControls,
ExprNode filter,
boolean needObjClassesInFilter,
boolean searchSingleClass,
MetaObjectClassMapping searchSingleClassMap)
throws LdapNamingException
LdapNamingException
public FilterInfo getFilterInfo(ObjectInfo baseObjInfo,
SearchControls searchControls,
ExprNode filter,
ExprNode origClonedFilter,
boolean needObjClassesInFilter,
boolean searchSingleClass,
MetaObjectClassMapping searchSingleClassMap)
throws LdapNamingException
LdapNamingException
public FilterInfo getFilterInfo(ExprNode filter)
throws LdapNamingException
BaseConnector.isObjectClassRequired() is false the object class assertions
are also pruned too.
LdapNamingException
public FilterInfo getFilterInfo(ObjectInfo baseObjInfo,
SearchControls searchControls,
ExprNode filter)
throws LdapNamingException
LdapNamingException
public NamingEnumeration<SearchResult> searchObjectScopeAsLookup(Name ldapBaseDn,
Name connBaseDn,
Attributes attrs,
String includeDnLdapAttrId)
throws NamingException
eTDYNGroupName=grp1,eTDYNDirectoryName=dir,eTNamespaceName=NS,dc=DOM,dc=etasa
yielding search results with DN
eTDYNGroupName=grp1,eTDYNGroupContainerName=Groups,eTDYNDirectoryName=dir,eTNamespaceName=NS,dc=DOM,dc=etasa
by converting the search result DN into a bizarre LDAP referral:
ldap://[host]:[port]/eTDYNGroupName=grp1,eTDYNGroupContainerName=Groups,eTDYNDirectoryName=dir,
eTNamespaceName=NS,dc=DOM,dc=etasa,eTDYNGroupName=grp1,eTDYNDirectoryName=dir,eTNamespaceName=NS,
dc=DOM,dc=etasa
.
NamingExceptionprotected FilterInfo getFilterObjClass(ExprNode filter)
public ObjectInfo getSearchBaseObjectInfo(MetaObjectClassMapping classMap)
throws NamingException
NamingException
public ObjectInfo getSearchBaseObjectInfo(ObjectInfo baseObjInfo,
MetaObjectClassMapping classMap)
throws NamingException
NamingException
public boolean isSearchOutsideClassContainer(ObjectInfo baseObjInfo,
MetaObjectClassMapping classMap)
protected NamingEnumeration<SearchResult> searchOneClass(ObjectInfo baseObjInfo,
Map<String,String> environment,
FilterInfo filterInfo,
SearchControls searchControls,
MetaObjectClassMapping classMap)
throws NamingException
NamingException
protected NamingEnumeration<SearchResult> searchVirtualContainers(ObjectInfo objInfo,
Map<String,String> environment,
FilterInfo filterInfo,
SearchControls searchControls)
throws NamingException,
MetaConnector.SearchFinishedException
NamingException
MetaConnector.SearchFinishedException
protected NamingEnumeration<SearchResult> search(ObjectInfo baseObjInfo,
Map<String,String> environment,
FilterInfo filterInfo,
SearchControls searchControls)
throws NamingException
NamingExceptionpublic Collection<? extends MetaConnector.FilterAware> getFilterAwareness()
public NamingEnumeration<SearchResult> search(LdapDN baseName,
Map environment,
ExprNode filter,
SearchControls searchControls)
throws NamingException
NamingExceptionprotected boolean isSearchAsLookup(ObjectInfo baseObjInfo)
@NotNull
protected NamingEnumeration<SearchResult> searchImpl(ObjectInfo baseObjInfo,
Map<String,String> environment,
FilterInfo filterInfo,
SearchControls searchControls)
throws NamingException
NamingException
public MetaObjectClassMapping getClassMappingFromConnectorAttrs(String name,
Attributes attrs)
throws NamingException
NamingException
protected MetaObjectClassMapping getClassMappingFromConnectorObjectClass(Attribute objectClassAttr)
throws NamingException
NamingException
public String[] mapAttributeIdsToConnector(Collection<MetaObjectClassMapping> classMaps,
String[] ldapAttrIds,
boolean objectScope)
ldapAttrIds belonging to the LDAP object class
matching objectInfo to their connector-speak equivalents,
where the naming attribute is always forced to be present in the first
position.
mapAttributeIdsToConnector in class BaseConnectorclassMaps - List of MetaObjectClassMappings for all objectclasses that
may be returned by a query.ldapAttrIds - Ldap attributes ids requested by the client.objectScope - If true null ldapAttrIds list is interpretted as meaning "all attributes".
If false a null ldapAttrIds list is interpretted as meaning "all cheap attributes".
ldapAttrIds mapped to connector speak, where the special attribute
BaseConnector.CONN_DN will be deleted if it is mapped to.
protected String[] mapAttributeIdsToConnector(Collection<MetaObjectClassMapping> classMaps,
String[] ldapAttrIds,
boolean objectScope,
boolean translateSpecialAttrs)
protected String[] getDefaultSearchLdapAttrIds(MetaObjectClassMapping classMap)
protected String[] getDefaultConnectorSearchAttrIds(MetaObjectClassMapping classMap)
public Attributes lookup(LdapDN name,
String[] attrIds)
throws NamingException
NamingException
protected Set<String> getRequestedConnAttrIds(String[] mapAttrIds,
String dnLdapAttrId)
public Attributes convertAttributesFromConnector(Name connDn,
String ldapDnStr,
MetaObjectClassMapping classMap,
Set<String> requestedConnAttrIds,
Attributes connAttrs,
boolean strict)
throws NamingException
connDn - Connector-speak DN for this object.ldapDnStr - LDAP equivalent to connDn.classMap - Details about object's objectClass mappings.requestedConnAttrIds - Connector-speak attribute ids originally requested by the client.connAttrs - Connector-speak attributes to be converted.strict - should it return error when empty attribute values are found?
NamingException
public void modifyRn(LdapDN name,
String newRdnStr,
boolean deleteOldRn)
throws NamingException
NamingException
public void move(LdapDN oldName,
LdapDN newParentName,
String newRdnStr,
boolean deleteOldRn)
throws NamingException
oldName under new container newParentName,
also changing its RDN (renaming it) if newRdnStr != null (otherwise it keeps the most nested
RDN it had in oldName). Calls OpProcessor#doMove(ObjectInfo, Name) on this connector's
attribute-style processor, where implementations need to check both that the object referenced by oldName exists, and that
there is no object already existing with the destination name.
move in interface PartitionOpsmove in interface Partitionmove in class AbstractPartitionNamingException
public void move(LdapDN oldName,
LdapDN newParentName)
throws NamingException
move(LdapDN, LdapDN, String, boolean) with null and true
as the last two parameters.
move in interface PartitionOpsmove in interface Partitionmove in class AbstractPartitionNamingException
public String getIncludedDnLdapAttrId(MetaObjectClassMapping classMap,
String[] ldapAttrIds)
BaseConnector.CONN_DN on the connector
side, including the special BaseConnector.LDAP_CONN_DN attribute which will always serve
this role regardless of metadata settings.
classMap - Represents object class for instance being queried.ldapAttrIds - Attribute ids client requested be returned in query results.
public String[] getConnectorObjectClasses(ObjectInfo objInfo)
throws NamingException
NamingException
public String getConnectorObjectClass(ObjectInfo objInfo)
throws NamingException
NamingException
public FilterInfo getFilterInfo(String ldapFilterStr)
throws LdapNamingException
ldapFilterStr - LDAP filter string to be converted to connctor-speak.
LdapNamingException
public FilterInfo getFilterInfo(ObjectInfo baseObjInfo,
SearchControls searchControls,
String ldapFilterStr)
throws LdapNamingException
LdapNamingException
public void notifyMetaData(MetaObjectClassMappings mappings,
boolean opBindChange)
throws NamingException
BaseConnector.setCachingRequired(boolean) to true if mappings has one more objectclasses in it
with connectorMapToAmbiguous= set on their naming attributes. Also sets
nonFilterableAttrs if any attributes have the flag MD_IS_CONNECTOR_FILTERABLE set
false.
mappings - New attribute-style mappings calculated by parent connector type.opBindChange - True if op bindings changed (which may effect method-style or
script-style processors or both).
NamingException
public MetaObjectClassMapping resolveObjectClass(String ldapAttributeId,
Name connDN,
Collection<MetaObjectClassMapping> classMaps)
throws NamingException
MetaDataDefs.MD_DN_LDAP_OBJECT_CLASSES
which can't be distinguished by their connector-speak naming attributes alone.
Overriding methods might make use of special knowledge about connector-speak DN syntax or
in the most demanding case may have to actually query the endpoint system itself
to determine the connector-speak objectclass. Unless overridden this method throws
an exception explaining that it needs to be implemented.
ldapAttributeId - Name of the attribute requiring resolution to be performed, which is not sufficient to be any kind of key as it's
parent classMap is not know but is useful for log messages and establishing context
nonetheless (note that this method's task is logically independent of which attribute requires
the provided classMaps to be disambiguated).connDN - Connector-speak DN for which objectclass needs to be resolved.classMaps - Possible class maps from which objectclass needs to be resolved (as specified in metadata).
NamingExceptionprotected boolean isFilterSingleClassMatching(FilterInfo filterInfo)
public boolean validateDNForSearchContainer(MetaObjectClassMapping classMap,
String connDnStr,
boolean throwOnError)
throws LdapInvalidAttributeValueException
LdapInvalidAttributeValueExceptionprotected OpProcessor getOpProcessorForSearch(MetaObjectClassMapping classMap)
classMap - the class mapping of the base object being search.
public boolean isValidContainmentSearchResult(SearchResult sr,
Name mapName,
Name baseDN,
SearchControls searchControls)
sr - SearchResult to verifymapName - ETA DN corresponding to the SearchResultbaseDN - ETA DN corresponding to the search basesearchControls - SearchControls used for the search operation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||