|
||||||||||
| 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.AbstractAttributeStyleOpProcessor
com.ca.jcs.processor.AbstractAttributeStyleOpProcessorAssocDirect
com.ca.jcs.assoc.DefaultAssocDirectAttributeOpProcessor
public abstract class DefaultAssocDirectAttributeOpProcessor
Default implementation of "direct" associations, where the associative link between an object and another is stored directly in one of their attributes. In this case links are often only stored on the endpoint in one direction and reverse lookups are used to populate a calculate an expensive virtual attribute in the other direction. For instance, the list of member accounts for a group might be the data actually stored on the endpoint and accessed as an attribute called group.member, and arriving at the list of groups to which an account belongs may involve a computationally expensive search to populate values of a virtual account.memberOf attribute. As well as populating values for virtual association attributes, this class also automatically update references in the values of non-virtual association attributes to objects which are deleted, renamed or moved.
| Nested Class Summary | |
|---|---|
protected static class |
DefaultAssocDirectAttributeOpProcessor.AssocAttrValue
Wraps an associative attribute value which is either a DN or other attribute value |
static class |
DefaultAssocDirectAttributeOpProcessor.AssociationStyle
Classifies styles of associations |
| Nested classes/interfaces inherited from interface com.ca.jcs.processor.OpProcessor |
|---|
OpProcessor.MethodName |
| Field Summary | |
|---|---|
MetaConnector |
metaConnector
|
| Fields inherited from class com.ca.jcs.processor.AbstractAttributeStyleOpProcessorAssocDirect |
|---|
proxiedAssocSelf |
| Fields inherited from class com.ca.jcs.processor.AbstractAttributeStyleOpProcessor |
|---|
proxiedSelf |
| Fields inherited from class com.ca.jcs.processor.AbstractBaseProcessor |
|---|
ldapExceptionPrefix, log |
| Constructor Summary | |
|---|---|
DefaultAssocDirectAttributeOpProcessor(MetaConnector connector)
Hang on to some important contextual values. |
|
| Method Summary | |
|---|---|
void |
addAttrAssocs(ObjectInfo objInfo,
Association assoc,
Attribute attr,
Object context)
Simply calls updateAttrAssocs(ObjectInfo, int, Association, Attribute). |
NamingEnumeration<SearchResult> |
doAssocSearchForReferencesTo(ObjectInfo targetObjInfo,
Association assoc,
boolean targetDefinedAssoc,
MetaConnector connector)
Given a targetInfo object and association, returns search result (in connector-speak) for each instance of assoc's class which references the targetInfo object. |
void |
doAssocUpdateReferencesTo(ObjectInfo targetObjInfo,
Name newConnDn,
MetaConnector connector)
Handle updating all reverse associative pointers referring to the target object referred to by targetObjInfo (whether single or multi-valued), with its new DN. |
void |
doDeleteAssocs(ObjectInfo targetObjInfo,
Object opContext)
Delete all associations referencing target object referred to by objInfo. |
void |
doLookupAssocs(ObjectInfo objInfo,
Association[] associations,
Attributes attrs,
Object opContext)
Lookup all associations for the target object referred to be objInfo and add them as
multi-valued associative attributes to attrs. |
Attribute |
doLookupExpensiveStub(ObjectInfo objInfo,
String attrId)
Default implementation is to simply do a lookup but derived classes may be able to efficiently find out if the attribute is set or not. |
void |
doModifyAssocs(ObjectInfo objInfo,
AssocModificationItem[] items,
Object opContext)
Break down provided association modification into addAttrAssocs(com.ca.jcs.ObjectInfo, com.ca.jcs.assoc.Association, javax.naming.directory.Attribute, java.lang.Object) or removeAttrAssocs(com.ca.jcs.ObjectInfo, com.ca.jcs.assoc.Association, javax.naming.directory.Attribute, java.lang.Object) calls as appropriate. |
void |
doModifyRnAssocs(ObjectInfo objInfo,
Rdn newRdn,
Object opContext)
Update association attributes after the target object denoted by objInfo
(which still refers to the old name) is renamed. |
void |
doMoveAssocs(ObjectInfo objInfo,
Name newName,
Object opContext)
Update association attributes after the target object denoted by objInfo
(which still refers to the old name) is moved to newName. |
NamingEnumeration<SearchResult> |
doSearchAssocs(MetaObjectClassMappings classMapping,
Association[] associations,
NamingEnumeration<SearchResult> searchResults,
String filterExpr,
Object opContext)
Wrap provided queryNum with logic to provide values for association attributes on search results. |
String |
expandTemplateValues(String nameTemplate,
String dn)
Expand template value using a DN/RDN or a string |
protected MetaObjectClassMapping |
getAssocClassMap(Association assoc,
boolean targetDefinedAssoc)
|
protected String |
getAssocConnAttrId(Association assoc,
boolean targetDefinedAssoc)
Get the single connector speak associative attribute |
protected String[] |
getAssocConnAttrIds(Association assoc,
String ldapAttrId,
boolean targetDefinedAssoc)
|
protected String[] |
getAssocConnectorAttrIds(Association assoc,
boolean targetDefinedAssoc)
|
protected DataModelProperty |
getAssocDataModelProp(String refLdapAttr,
MetaObjectClassMapping refClassMap)
|
protected String |
getAssocLdapAttr(Association assoc,
boolean targetDefinedAssoc)
|
protected String |
getAssocObjectClass(Association assoc,
boolean targetDefinedAssoc)
|
AttributeStyleOpProcessor |
getAttrProc()
|
MetaConnector |
getMetaConnector()
|
DataModel |
getMetaData()
Needed to get around spelling error of geMetaData() in JCS 1.0 release, ideally would be left abstract here and should be overridden
in the concrete processor, for instance SDKAttributeStyleOpProcessor. |
void |
removeAttrAssocs(ObjectInfo objInfo,
Association assoc,
Attribute attr,
Object opContext)
Simply calls updateAttrAssocs(ObjectInfo, int, Association, Attribute). |
void |
updateAttrAssocs(ObjectInfo objInfo,
int modOp,
Association assoc,
Attribute attr)
Handle updating the reverse associative membership list based on changes to the target object referred to by objInfo, eg when changing account.memberOf the membership lists of the referenced
groups are what actually needs to be updated. |
| Methods inherited from class com.ca.jcs.processor.AbstractAttributeStyleOpProcessorAssocDirect |
|---|
activate, convertConnectorDNToKey, convertConnectorDNToKeys, convertKeyToConnectorDN |
| Methods inherited from class com.ca.jcs.processor.AbstractAttributeStyleOpProcessor |
|---|
deactivate, isPostQueryPocessingActive, processPostQueryAttributes, processPostQuerySearchResult, setPostQueryPocessingActive |
| 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 |
| Methods inherited from interface com.ca.jcs.processor.AttributeStyleOpProcessor |
|---|
deactivate, setMetaData |
| Methods inherited from interface com.ca.jcs.processor.OpProcessor |
|---|
doAdd, doDelete, doLookUp, doModify, doModifyRn, doMove, doSearch |
| Field Detail |
|---|
public final MetaConnector metaConnector
| Constructor Detail |
|---|
public DefaultAssocDirectAttributeOpProcessor(MetaConnector connector)
connector - Parent baseConnector.| Method Detail |
|---|
public AttributeStyleOpProcessor getAttrProc()
public MetaConnector getMetaConnector()
public DataModel getMetaData()
geMetaData() in JCS 1.0 release, ideally would be left abstract here and should be overridden
in the concrete processor, for instance SDKAttributeStyleOpProcessor. Always throws a RuntimeException to ensure
the fact it must be overridden is noticed if the method is ever called.
public Attribute doLookupExpensiveStub(ObjectInfo objInfo,
String attrId)
throws NamingException
doLookupExpensiveStub in interface AttributeStyleOpProcessordoLookupExpensiveStub in class AbstractAttributeStyleOpProcessorobjInfo - Object for which attribute should be looked up.attrId - Id for expensive attribute.
NamingExceptionValidationLazyAttributesProxy
@OpBindingMethod(operation=ASSOC_UPDATE_REFERENCES_TO)
public void doAssocUpdateReferencesTo(ObjectInfo targetObjInfo,
Name newConnDn,
MetaConnector connector)
throws NamingException
targetObjInfo (whether single or multi-valued), with its new DN. For instance when changing
a person's DN the "member" attributes of all groups referencing it need to be
updated to refer to the new DN. Note where the reverse membership attribute
has ambiguous mappings to two or more connector attribute ids, the method
MetaConnector.getAssocReverseConnectorAttrId(com.ca.jcs.ObjectInfo, com.ca.jcs.assoc.Association) will be used to determine
the correct choice (as happens for groups in the LDA connector).Note that updates are only applied to non-virtual attributes actually persisted in the managed system, and are done using REPLACE_ATTRIBUTE to avoid the case where changing a single-valued attribute from one DN to another using deltas would temporarily lead to no values or two values being stored. This doesn't represent a violation of any "forceModificationMode" specified for an attribute, because we are effectively writing directly to managed system.
targetObjInfo - References target object whose DN is being changed.newConnDn - New connector-speak DN for the target object, null if target object
is being deleted.
NamingException
@OpBindingMethod(operation=ASSOC_SEARCH_FOR_REFERENCES_TO)
public NamingEnumeration<SearchResult> doAssocSearchForReferencesTo(ObjectInfo targetObjInfo,
Association assoc,
boolean targetDefinedAssoc,
MetaConnector connector)
throws NamingException
targetObjInfo - The referenced object representing an association which is to be
searched for, may either be a DN or a simple string value depending on metadata used to
define the attribute in which it is contained.assoc - Describes association between attribute on targetInfo object
and optional reciprocal attribute stored on referencing objectstargetDefinedAssoc - True if targetInfo's objectClass defined the association, and
false if it was defined by the referencing object class.
NamingException
public String expandTemplateValues(String nameTemplate,
String dn)
nameTemplate - Template to expanddn - DN/RDN or a string to use in the expansion
@OpBindingMethod(operation=MODIFY_ASSOCS)
public void doModifyAssocs(ObjectInfo objInfo,
AssocModificationItem[] items,
Object opContext)
throws NamingException
addAttrAssocs(com.ca.jcs.ObjectInfo, com.ca.jcs.assoc.Association, javax.naming.directory.Attribute, java.lang.Object) or removeAttrAssocs(com.ca.jcs.ObjectInfo, com.ca.jcs.assoc.Association, javax.naming.directory.Attribute, java.lang.Object) calls as appropriate.
objInfo - Information about target object whose associations are to be updated.items - Modifications to associative relationships, which can be additions,
deletions or replacements.opContext - Optional field which can be provided additional context for the
requested updates, eg transactional connectors
may want the updates of the associative relationships to occur within a larger transaction.
NamingException
@OpBindingMethod(operation=MODIFY_RN_ASSOCS)
public void doModifyRnAssocs(ObjectInfo objInfo,
Rdn newRdn,
Object opContext)
throws NamingException
objInfo
(which still refers to the old name) is renamed.
objInfo - Object to be modified, contains "old" name.newRdn - New relative name (RN) for object, eg "namingAttr=newName".opContext - Optional field which can be provided additional context for the
requested updates, eg transactional connectors
NamingException
@OpBindingMethod(operation=MOVE_ASSOCS)
public void doMoveAssocs(ObjectInfo objInfo,
Name newName,
Object opContext)
throws NamingException
objInfo
(which still refers to the old name) is moved to newName.
objInfo - Object to be modified, contains "old" name.newName - New DN (distinguished name) for object, where parent folder and RN
may have changed.opContext - Optional field which can be provided additional context for the
requested updates, eg transactional connectors
may want the updates of the associative relationships to occur within a larger transaction.
NamingException
@OpBindingMethod(operation=DELETE_ASSOCS)
public void doDeleteAssocs(ObjectInfo targetObjInfo,
Object opContext)
throws NamingException
objInfo.
targetObjInfo - Object to be deleted.opContext - Optional field which can be provided additional context for the
requested updates, eg transactional connectors
may want the updates of the associative relationships to occur within a larger transaction.
NamingException
@OpBindingMethod(operation=MODIFY_UPDATE_ATTRS_ASSOCS)
public void updateAttrAssocs(ObjectInfo objInfo,
int modOp,
Association assoc,
Attribute attr)
throws NamingException
objInfo, eg when changing account.memberOf the membership lists of the referenced
groups are what actually needs to be updated. Note where there reverse membership attribute
has ambiguous mappings to two or more connector attribute ids, the method
MetaConnector.getAssocReverseConnectorAttrId(com.ca.jcs.ObjectInfo, com.ca.jcs.assoc.Association) will be used to determine the
correct choice (as happens for groups in the LDA connector).
objInfo - References target object whose virtual membership attribute is being changed
(eg the "person" whose person.memberOf attribute is being modified).modOp - Modification operation, refer
ModificationItem.getModificationOp() }.assoc - Record of metadata for relevant association.attr - Virtual membership attribute being modified, containing DNs of intended
owners of the target object (eg a list of groupOfNames whose member
attributes need to be updated to persist the change to person.memberOf)
NamingException
public void addAttrAssocs(ObjectInfo objInfo,
Association assoc,
Attribute attr,
Object context)
throws NamingException
updateAttrAssocs(ObjectInfo, int, Association, Attribute).
objInfo - Object referenced.assoc - Association through which object is referenced.attr - Attribute containing new references to object which are to be stored.context - Context if relevant to connector implementation (eg transaction, if supported).
NamingException
public void removeAttrAssocs(ObjectInfo objInfo,
Association assoc,
Attribute attr,
Object opContext)
throws NamingException
updateAttrAssocs(ObjectInfo, int, Association, Attribute).
objInfo - Object referenced.assoc - Association through which object is referenced.attr - Attribute containing references to object, if null means "remove all references" (only supported
by internal agreement within connector implementation, eg JDBC which uses indirect associations can remove all
references without wasting time determining all currently existing links).opContext - Context if relevant to connector implementation (eg transaction, if supported).
NamingException
@OpBindingMethod(operation=LOOKUP_ASSOCS)
public void doLookupAssocs(ObjectInfo objInfo,
Association[] associations,
Attributes attrs,
Object opContext)
throws NamingException
objInfo and add them as
multi-valued associative attributes to attrs.
objInfo - Target object for which associations need to be worked out.associations - Associations declared against target's objectclass, all of which need to be checked.attrs - Attributes to be returned for target object, multi-valued associative attribute
settings may be added to them by this method.opContext - Unused.
NamingException
@OpBindingMethod(operation=SEARCH_ASSOCS)
public NamingEnumeration<SearchResult> doSearchAssocs(MetaObjectClassMappings classMapping,
Association[] associations,
NamingEnumeration<SearchResult> searchResults,
String filterExpr,
Object opContext)
throws NamingException
queryNum with logic to provide values for association attributes on search results.
NamingException
protected DataModelProperty getAssocDataModelProp(String refLdapAttr,
MetaObjectClassMapping refClassMap)
protected String getAssocLdapAttr(Association assoc,
boolean targetDefinedAssoc)
protected MetaObjectClassMapping getAssocClassMap(Association assoc,
boolean targetDefinedAssoc)
protected String getAssocObjectClass(Association assoc,
boolean targetDefinedAssoc)
protected String getAssocConnAttrId(Association assoc,
boolean targetDefinedAssoc)
protected String[] getAssocConnectorAttrIds(Association assoc,
boolean targetDefinedAssoc)
protected String[] getAssocConnAttrIds(Association assoc,
String ldapAttrId,
boolean targetDefinedAssoc)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||