|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ca.jcs.processor.AbstractBaseProcessor
com.ca.jcs.processor.ConnectorAttributesProcessor
public class ConnectorAttributesProcessor
Handles operating on the top-level connector object itself, and handles converting tracking of connection
related connector level attributes into activate() on a concrete BaseConnector etc. This means
the client-implemented BaseConnector can simply respond to activate()/deactivate()/setAttributes()/getAttributes()
without need to distinguish connection related attributes from the rest. This class is also responsible
for management of its related connector's activated state.
Because this class is implemented as an OpProcessor it means that connector attributes go through
the same validate/convert/map names steps as those on child objects which in turn allows greater reuse
because implementation is dependent on logical names chosen for connectorMapTo= metadata instead of actual LDAP
attribute names that tend to vary for every connector (at least in the Admin product).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.ca.jcs.processor.OpProcessor |
|---|
OpProcessor.MethodName |
| Field Summary | |
|---|---|
protected MetaConnector |
connector
|
| Fields inherited from class com.ca.jcs.processor.AbstractBaseProcessor |
|---|
ldapExceptionPrefix, log |
| Constructor Summary | |
|---|---|
ConnectorAttributesProcessor(MetaConnector connector)
|
|
| Method Summary | |
|---|---|
void |
doAdd(ObjectInfo objInfo,
Attributes attrs)
Create a new object on the managed system with the provided attributes stored for it. |
void |
doDelete(ObjectInfo objInfo)
Delete the object referenced by objInfo from a managed system. |
Attributes |
doLookUp(ObjectInfo objInfo,
String[] attrIds)
Look up the provided attribute names on the managed object referenced by objInfo,
attribute ids not mapped to connector-speak will either be discarded or cause an error depending
on the level of strictness configured for the parent connector. |
void |
doModify(ObjectInfo objInfo,
ModificationItem[] modItems)
Apply the provided items to the object on the managed system referenced by
objInfo. |
void |
doModifyRn(ObjectInfo objInfo,
Rdn newRn)
Rename the managed object referenced by objInfo so that it has the new
Relative Distinguished Name (RDN) provided (an example newRdn might be
nameAttrId=MyNewName). |
void |
doMove(ObjectInfo objInfo,
Name newParentName,
Rdn newRn)
Move the managed object referenced by objInfo to a new parent whilst
also changing its RDN (of form "attr=value"). |
NamingEnumeration<SearchResult> |
doSearch(ObjectInfo baseObjInfo,
FilterInfo filterInfo,
Map<String,String> environment,
SearchControls searchControls)
Perform search under specified baseName on managed system, using the standard
JNDI interfaces and semantics. |
MetaConnector |
getConnector()
|
void |
reactivateWithRollback(Attributes origAttrs)
Re-activate a connector with new attributes whereby the original attributes are reverted back to on error, for instance after change to a connection-related attribute that stops connectivity. |
protected void |
saveConnectorState(ObjectInfo objInfo)
|
void |
setAttributes(Attributes attrs)
Set attributes, noting that the original are still available on the connector if there is a need to revert to back to them on error, for instance after change to a connection-related attribute that stops connectivity. |
| Methods inherited from class com.ca.jcs.processor.AbstractBaseProcessor |
|---|
getBaseConnector, makeNamingException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final MetaConnector connector
| Constructor Detail |
|---|
public ConnectorAttributesProcessor(MetaConnector connector)
| Method Detail |
|---|
public MetaConnector getConnector()
public void doAdd(ObjectInfo objInfo,
Attributes attrs)
throws NamingException
OpProcessorPartition.add(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
after mapping has been performed.
doAdd in interface OpProcessorobjInfo - Contains information for the managed object which is to be created,
where its connector-speak distinguished Name (DN) is dictated by
objInfo.getConnectorDn() and its objectClass= is
dictated by objInfo.getobjectClassMapping().attrs - Attributes to be stored on the managed object.
LdapNameAlreadyBoundException - Should be thrown if an object
with the specified name already exists, other NamingExceptions (preferably
implementing LdapException) may also be thrown. Pay attention to
retriable exceptions as documented in RetryOpProcessorProxy.
NamingException - (usually exception should implement
LdapException or arrangements to map it into
such an exception should be in place). Pay attention to
retriable exceptions as documented in RetryOpProcessorProxy.
public void doDelete(ObjectInfo objInfo)
throws NamingException
OpProcessorobjInfo from a managed system.
Called by Partition.delete(org.apache.directory.shared.ldap.name.LdapDN)
after mapping/validation/type conversion has been performed.
doDelete in interface OpProcessorobjInfo - References managed object to be deleted.
LdapNameNotFoundException - (or
NameNotFoundException) when target object doesn't exist.
NamingException - (usually exception should implement
LdapException or arrangements to map it into
such an exception should be in place). Pay attention to
retriable exceptions as documented in RetryOpProcessorProxy.
public void setAttributes(Attributes attrs)
throws NamingException
attrs - New attributes to be set on the connector.
NamingException - Problem internalising new attributes settings, usually thrown
as a side effect of using new values for connection-related attributes.
public void reactivateWithRollback(Attributes origAttrs)
throws NamingException
origAttrs - Original attributes of the connector.
NamingException - Problem internalising new attributes settings, usually thrown as a
side effect of using new values for connection-related attributes.
public void doModify(ObjectInfo objInfo,
ModificationItem[] modItems)
throws NamingException
OpProcessoritems to the object on the managed system referenced by
objInfo.
Called by Partition.modify(org.apache.directory.shared.ldap.name.LdapDN, int, javax.naming.directory.Attributes)
after mapping has been performed.
doModify in interface OpProcessorobjInfo - References managed object which is to be modified.modItems - Items to be modified.
LdapNameNotFoundException - (or
NameNotFoundException) when target object doesn't exist.
NamingException - (usually exception should implement
LdapException or arrangements to map it into
such an exception should be in place). Pay attention to
retriable exceptions as documented in RetryOpProcessorProxy.
public NamingEnumeration<SearchResult> doSearch(ObjectInfo baseObjInfo,
FilterInfo filterInfo,
Map<String,String> environment,
SearchControls searchControls)
throws NamingException
OpProcessorbaseName on managed system, using the standard
JNDI interfaces and semantics. All values (DN/filter/return attribute ids) have been mapped into
connector-speak by the time this method is called.
Called by
Partition.search(org.apache.directory.shared.ldap.name.LdapDN, java.util.Map, org.apache.directory.shared.ldap.filter.ExprNode, javax.naming.directory.SearchControls)
with mapping performed on the result entries to map/convert them from connector-speak to
LDAP.
doSearch in interface OpProcessorbaseObjInfo - Specifies base object for the search, scope in searchControls
is relative to this object.filterInfo - Information regarding the filter to be used for the search,
including referenced objectClass= values. Note that attribute names have been converted
to connector-speak and any required validators/converters have been run by the framework
prior to this method being invoked. The filter's text can be retrieved via
ExprNode.printToBuffer(StringBuffer) on
contained mappedFilter. If required this mappedFilter can
be converted to a different syntax, refer to SimpleFilterVisitor /
FilterVisitor and related classes.environment - Defines any values effecting how the search is performed (eg whether to follow
referrals etc). Can usually be ignored.searchControls - Defines important information about the search itself, for instance what
scope the search should have under baseName and which attributes should be returned
for each object matching the provided filter. Note that specifying a null String[] for the returned
attributes will cause all non-expensive attributes to be returned for each matching objects, whereas
specifying String[0] will cause not attributes to be returned except for the DNs of matching objects.
SearchResult objects, one per object falling within the specified scope
under baseName which matches the provided filter. Results can be handled in two different
manners depending on the connector's requirement (indeed, an advanced connector can implement both and
choose the best one based on heuristics and a threshold):doSearch() call has returned.LdapNameNotFoundException - (or
NameNotFoundException) when target object doesn't exist.
NamingException - (usually exception should implement
LdapException or arrangements to map it into
such an exception should be in place). Pay attention to
retriable exceptions as documented in RetryOpProcessorProxy.
public Attributes doLookUp(ObjectInfo objInfo,
String[] attrIds)
throws NamingException
OpProcessorobjInfo,
attribute ids not mapped to connector-speak will either be discarded or cause an error depending
on the level of strictness configured for the parent connector. Extra attributes may also be
returned.
Called by Partition.lookup(org.apache.directory.shared.ldap.name.LdapDN)
after mapping has been performed.
doLookUp in interface OpProcessorobjInfo - Managed object for which attributes are to be looked up.attrIds - Connector-speak identifiers of attributes which are to be returned, null
means return all attributes and a zero length array means return no attributes (just
a way to check an object's existance).
attrIds, can be null when the target object exists
but has none of the requested
LdapNameNotFoundException - (or
NameNotFoundException) when target object doesn't exist.
NamingException - (usually exception should implement
LdapException or arrangements to map it into
such an exception should be in place). Pay attention to
retriable exceptions as documented in RetryOpProcessorProxy.
public void doModifyRn(ObjectInfo objInfo,
Rdn newRn)
throws NamingException
OpProcessorobjInfo so that it has the new
Relative Distinguished Name (RDN) provided (an example newRdn might be
nameAttrId=MyNewName).
Called by Partition.modifyRn(org.apache.directory.shared.ldap.name.LdapDN, java.lang.String, boolean)
after mapping has been performed.
doModifyRn in interface OpProcessorobjInfo - References managed object.newRn - New terminal name (having form "attr=val") for managed object.
LdapNameNotFoundException - (or
NameNotFoundException) when target object doesn't exist.
NamingException - (usually exception should implement
LdapException or arrangements to map it into
such an exception should be in place). Pay attention to
retriable exceptions as documented in RetryOpProcessorProxy.
public void doMove(ObjectInfo objInfo,
Name newParentName,
Rdn newRn)
throws NamingException
OpProcessorobjInfo to a new parent whilst
also changing its RDN (of form "attr=value").
Called by Partition.move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, String, boolean)
after mapping has been performed.
doMove in interface OpProcessorobjInfo - References managed object to be moved.newParentName - New parent for managed object.newRn - New relative distinguished name (RDN) for managed object, will be
either be null (just a move) or different from the object's current RDN (move and rename).
LdapNameNotFoundException - (or
NameNotFoundException) when target object doesn't exist.
NamingException - (usually exception should implement
LdapException or arrangements to map it into
such an exception should be in place). Pay attention to
retriable exceptions as documented in RetryOpProcessorProxy.
protected void saveConnectorState(ObjectInfo objInfo)
throws NamingException
NamingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||