|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ca.jcs.ObjectClassMapping
public abstract class ObjectClassMapping
Provides all the information required by type-driven connectors to efficiently access the required to/from LDAP attribute mappings, for a particular LDAP object class facing the client (the mapped-to side can be any type-driven connector technology, eg JDBC). The "from" side of the mapping is referred to as "connector-speak".
Note that all LDAP mappings keyed on attribute names need to normalise before storing/lookup.
| Nested Class Summary | |
|---|---|
static class |
ObjectClassMapping.AmbiguousClassInfo
Information stored for each class with ambiguous connector mappings. |
static class |
ObjectClassMapping.AmbiguousPropInfo
Information stored for each property with ambiguous connector mappings. |
protected static class |
ObjectClassMapping.AssocIsIndirectPred
Predicate for testing if an association is indirect |
static class |
ObjectClassMapping.IsStructuralObjectClassPred
Predicate for testing if a given object class doesn't correspond to a structural class |
static class |
ObjectClassMapping.SpecialRole
|
static class |
ObjectClassMapping.StringEqFn
Predicate suitable for string equality operations |
| Constructor Summary | |
|---|---|
ObjectClassMapping(String ldapClassName,
boolean caseSensitive,
Boolean indirectAssociations)
|
|
| Method Summary | |
|---|---|
void |
addAssociation(Association assoc)
|
void |
addConnectorAttrAssoc(String[] connAttrIds,
Association assoc)
|
void |
addConnectorAttrAssoc(String connAttrId,
Association assoc)
|
void |
addConnectorAttrKeyAssoc(Association assoc)
Deprecated. |
void |
addFromAssociation(Association assoc)
|
void |
addToAssociation(Association assoc)
|
void |
addTrimConnectorAttrId(String connAttrId)
Check if a given connector attribute requires whitespace trimming |
boolean |
equals(Object o)
|
Association |
findChildCompoundAssoc(String connAttrId)
If there is an assoc on a child compound class, then we treat it as if it belongs to this class (the parent). |
protected static String |
formatAmbiguousMapValue(String[] mappedValues)
|
String |
getAlias()
Return alias for this objectclass, useful when its connector-speak mapping is a complicated expression (eg SQL SELECT) and want a compact way to refer to it in your code. |
Collection<Association> |
getAllAssociations()
Return all associations defined for this class mapping. |
Collection<Association> |
getAllAssociations(boolean indirect)
Return all associations matching indirect defined for this class mapping. |
String |
getAmbiguousConnectorAttrId(String ldapAttrId,
Attribute objClassAttr,
Attribute choiceAttr)
Work out which connector attribute id choice, from a range of ambiguous choices, is appropriate for ldapAttrId given an attribute containing an object instance's
connector objectClasses. |
String[] |
getChildTypes()
|
Map<String,String> |
getCompoundConnectorAttrIdToClassNameMap()
Returns map of connector-speak ids to compound value class names for attributes in this class which are defined to have compound values. |
Map<String,String> |
getCompoundLdapAttrIdToClassNameMap()
Returns map of LDAP ids to compound value class names for attributes in this class which are defined to have compound values. |
String[] |
getConnectorAmbiguousAttrIds(String ldapAttrId)
|
ObjectClassMapping.AmbiguousPropInfo |
getConnectorAmbiguousAttrInfo(String ldapAttrId)
Ambiguous naming attributes expected to be most common case. |
ObjectClassMapping.AmbiguousPropInfo |
getConnectorAmbiguousAttrInfoFromAlias(String alias)
Return ambiguous connector-speak attribute id mappings associated with the provided alias, or null if there is only a single explicit mapping. |
Map<String,ObjectClassMapping.AmbiguousPropInfo> |
getConnectorAmbiguousAttrInfoMap()
|
ObjectClassMapping.AmbiguousClassInfo |
getConnectorAmbiguousClassInfo()
|
String[] |
getConnectorAmbiguousClassNames()
|
String[] |
getConnectorAmbiguousClassNames(ObjectClassMapping.AmbiguousPropInfo ambigPropInfo)
Given an ambiguous property return all the objectclasses that it can ambiguously map to |
ObjectClassMapping.AmbiguousPropInfo |
getConnectorAmbiguousNamingAttrInfo()
|
String[] |
getConnectorAmbiguousNamingAttrs()
|
Association |
getConnectorAttrAssoc(String connAttrId)
Return Association from this class to another, given connector-speak attr name. |
Collection<Association> |
getConnectorAttrAssocsWithKey(String connAttrId)
|
Collection<Association> |
getConnectorAttrAssocsWithKey(String connAttrId,
boolean objKey,
boolean refKey)
|
Association |
getConnectorAttrAssocWithKey(String connAttrId)
Deprecated. |
String |
getConnectorAttrId(String ldapAttrId)
Return connector attribute id equivalent for provided ldapAttrId. |
String |
getConnectorAttrIdDisplay(String ldapAttrId)
|
String |
getConnectorAttrIdFromAlias(String alias)
Return the connector-speak attribute id associated with the provided alias, may be null if there are ambiguous mappings for its associated attribute. |
String[] |
getConnectorAttrIds()
|
HashMap<String,String> |
getConnectorAttrIdToGenerator()
|
HashMap<String,Collection<Association>> |
getConnectorAttrKeyAssocMap()
Deprecated. |
String |
getConnectorClassName()
|
String |
getConnectorClassNameDisplay()
Human readable display name suitable for error messages, even when mapping is ambiguous. |
Set<String> |
getConnectorGeneratedAttrIds()
|
String |
getConnectorNamingAttrId()
Return the unique naming attribute for this class, or null if it can't be determined. |
String |
getConnectorNamingAttrIdDisplay()
|
String[] |
getConnectorNamingAttrIds()
Returns array of all naming attr ids, to ease coding when don't care whether ambiguous or not. |
Attribute |
getConnectorObjectClassAttr(Attributes attrs)
Return attribute LdapUtil.LDAP_OBJECT_CLASS containing connector object class,
where there is:
There is a property with connectorMapTo equal to "Choice:objectClass". |
Name |
getConnectorSearchContainer()
|
HashMap<String,String> |
getConnectorToLdapAttrIdMap()
|
List<Attribute> |
getDefaults()
Returns list of attributes which have default values which may be empty but never null. |
HashMap<String,Set<String>> |
getDependentConnectorIdMap()
|
Set<String> |
getDependentConnectorIds(String ldapAttrId)
|
Collection<Association> |
getFromAssociations()
Return all Association records for associative attributes in
this class, referring to other classes. |
Collection<Association> |
getFromAssociations(boolean indirect)
Return all Association records for associative attributes in
this class, referring to other classes. |
Boolean |
getIndirectAssociations()
If indirectAssociations is not null, then returns it and otherwise returns true if any indirect associations have been defined for this classMap. |
Association |
getLdapAttrAssoc(String ldapAttrId)
|
String |
getLdapAttrId(String connAttrId)
|
String |
getLdapAttrIdFromAlias(String alias)
Return the ldap attribute id associated with the provided alias. |
String[] |
getLdapAttrIds()
|
String |
getLdapClassName()
Name of this LDAP class. |
String |
getLdapNamingAttrId()
|
Set<String> |
getOverriddenOperations()
|
ObjectClassMapping.SpecialRole |
getSpecialRole()
|
Collection<Association> |
getToAssociations()
Return all Association records referring to this class from
other classes. |
Collection<Association> |
getToAssociations(boolean indirect)
Return all Association records referring to this class from
other classes. |
int |
hashCode()
|
boolean |
isAccountClass()
Is this mapping for the connector's account abstraction? |
boolean |
isAltKeyAssoc()
|
boolean |
isCaseSensitive()
|
boolean |
isCompoundValue()
|
boolean |
isConnectorAttrId(String connAttrId)
|
boolean |
isConnectorClass()
Is this mapping for the connector itself, aka endpoint or directory? |
boolean |
isConnectorMapToLax()
|
boolean |
isConnectorNamingAttrId(String connAttrId)
Is the provided connAttrId the unique naming attribute for this class? |
boolean |
isContainer()
|
boolean |
isDuplicateConnectorNamingAttr()
|
boolean |
isLdapAttrId(String ldapAttr)
|
boolean |
isNameMapping()
|
boolean |
isNativeObjectClassMapped()
Check if one of the connector side attribute mappings corresponds to 'objectclass' |
boolean |
isNativeObjectClassSet(Attributes attrs,
String objectClassAttrId)
Test if connector level 'objectclass' is present in a set of attributes |
boolean |
isSensitive(boolean isConnectorSpeak,
String attrId)
Returns true if value for attribute shouldn't be logged in cleartext. |
boolean |
isTrimConnectorAttrId(String connAttrId)
Check if a given connector attribute requires whitespace trimming |
boolean |
isTrimNamingAttrId()
Check if a given connector naming attribute requires whitespace trimming |
boolean |
isVirtual()
|
boolean |
putConnectorToLdapAttrId(String connAttrId,
String ldapAttrId)
|
void |
putDependentConnectorIds(String connAttrId,
String[] toConnMultiNames)
Can be used by converter constructors, and other components, to record that the value of connAttrId depends on all the attributes named in toConnMultiNames. |
void |
putLdapAttrIdFromAlias(String alias,
String ldapAttrId)
Record that a connector-speak alias maps to the provided ldapAttrId. |
void |
putLdapToConnectorAttrId(String ldapAttrId,
String connAttrId)
|
void |
putToConnectorAmbiguousAttrIds(String ldapAttrId,
String[] connAttrIds,
String ldapChoiceAttrId)
Record ambiguous connector attribute mappings for the provided ldapAttrId,
optionally building a map of objectclass to attribute id choices where the mappings have
the form objectClass:attrId (for a classMap with ambiguous
connector objectclass mappings). |
void |
setAlias(String alias)
|
void |
setAltKeyAssoc(boolean altKeyAssocs)
Does this class contain associations using alternate keys, affecting MODIFY_RN strategy |
void |
setChildTypes(String[] childTypes)
|
void |
setCompoundValue(boolean compoundValue)
|
void |
setConnectorAmbiguousClassInfo(ObjectClassMapping.AmbiguousClassInfo connectorAmbiguousClassInfo)
|
void |
setConnectorAttrKeyAssocMap(HashMap<String,Collection<Association>> connectorAttrKeyAssocMap)
Deprecated. |
void |
setConnectorClassName(String connectorClassName)
|
void |
setConnectorMapToLax(boolean connectorMapToLax)
|
void |
setConnectorNamingAttrId(String namingAttrId)
|
void |
setConnectorSearchContainer(Name connectorSearchContainer)
|
void |
setContainer(boolean container)
|
void |
setDuplicateConnectorNamingAttr(boolean duplicateConnectorNamingAttr)
Some mappings specify that a connector attribute value needs to be copied to both the naming attribute and another attribute as well (for instance eTLDAGroup in the
LDA connector requires cn=value is mapped to eTLDAGroupName=value as
well as eTLDACn=value). |
void |
setLdapNamingAttrId(String ldapNamingAttrId)
|
void |
setSpecialRole(ObjectClassMapping.SpecialRole specialRole)
|
void |
setVirtual(boolean virtual)
|
SplitAttrIds |
splitAssocAttrIds(String[] attrIds)
Helper method for recording information about associative attribute ids during lookup() or search(), where the two varieties are split and returned (null is returned if no associative attribute ids are included). |
AssocModificationItem[] |
splitAssocAttrs(Attributes attrs)
Helper method for recording information about associative attributes during add(), where any found are removed from attrs and returned for easy processing (null is returned if no associative
attributes are encountered). |
SplitModificationItems |
splitAssocModificationItems(ModificationItem[] items)
Helper method for recording information about associative modification items during modify(), where the two varieties are split and returned (null is returned if no associative modification items are included). |
Attributes |
splitBinaryAttrs(Attributes attrs)
|
SplitBinaryAttrIds |
splitBinaryAttrs(String[] attrIds)
|
static AssocModificationItem[] |
splitPurgeNull(AssocModificationItem[] items)
Useful if connector want's to handle compound value associations in its core logic rather then passing on to normal association handling logic, in which case it can set entries to null as they are processed and then use this utility afterwards. |
static SplitAttrIds |
splitPurgeNull(SplitAttrIds splitIds)
Useful if connector want's to handle compound value associations in its core logic rather then passing on to normal association handling logic, in which case it can set entries to null as they are processed and then use this utility afterwards. |
String |
toString()
|
String |
toString(Attribute attr)
Create string dump of value of connector-speak attr, but don't display values for sensitive attributes. |
String |
toString(Attributes attrs)
Create string dump of values of connector-speak attrs, but don't display values for sensitive attributes. |
String |
toString(ModificationItem item)
Create string dump of values of connector-speak item, but don't display values for sensitive attributes. |
String |
toString(ModificationItem[] items)
Create string dump of connector-speak items, but don't display values for sensitive attributes. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Object ldapClassInfo
protected HashMap<String,DataModelProperty> ldapAttrInfoMap
protected String[] ldapAttrIds
protected String[] connectorAttrIds
protected String[] connectorAllAttrIds
protected HashMap<String,String> ldapToConnectorAttrIdMap
protected HashMap<String,String> aliasToLdapAttrIdMap
protected HashMap<String,String> connectorToLdapAttrIdMap
protected HashMap<String,String> connectorAttrIdToGenerator
protected HashMap<String,Set<String>> dependentConnectorIdMap
public static final String AMBIGUOUS_PREF
protected Collection<Association> allAssociations
Association info, for multi-valued
attributes.
protected Collection<Association> fromAssociations
protected Collection<Association> toAssociations
protected Map<Boolean,Collection<Association>> allAssocsByIndirect
protected Map<Boolean,Collection<Association>> fromAssocsByIndirect
protected Map<Boolean,Collection<Association>> toAssocsByIndirect
protected HashMap<String,Association> connectorAttrAssocMap
@Deprecated protected HashMap<String,Collection<Association>> connectorAttrKeyAssocMap
protected Boolean indirectAssociations
protected boolean altKeyAssoc
protected HashMap<String,String> compoundLdapAttrIdClassNameMap
protected HashMap<String,String> compoundConnectorAttrIdToClassNameMap
| Constructor Detail |
|---|
public ObjectClassMapping(String ldapClassName,
boolean caseSensitive,
Boolean indirectAssociations)
| Method Detail |
|---|
public ObjectClassMapping.SpecialRole getSpecialRole()
public void setSpecialRole(ObjectClassMapping.SpecialRole specialRole)
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String getLdapClassName()
public String getLdapNamingAttrId()
public void setLdapNamingAttrId(String ldapNamingAttrId)
public boolean isCaseSensitive()
public String getConnectorClassName()
public void setConnectorClassName(String connectorClassName)
public String getAlias()
public void setAlias(String alias)
public boolean isConnectorNamingAttrId(String connAttrId)
connAttrId the unique naming attribute for this class?
public String getConnectorNamingAttrId()
public void setConnectorNamingAttrId(String namingAttrId)
public String[] getConnectorNamingAttrIds()
public boolean isContainer()
public void setContainer(boolean container)
public String[] getChildTypes()
public void setChildTypes(String[] childTypes)
public boolean isConnectorMapToLax()
public void setConnectorMapToLax(boolean connectorMapToLax)
public boolean isConnectorClass()
getSpecialRole().
public boolean isAccountClass()
getSpecialRole().
public boolean isAltKeyAssoc()
public void setAltKeyAssoc(boolean altKeyAssocs)
public Set<String> getOverriddenOperations()
public ObjectClassMapping.AmbiguousClassInfo getConnectorAmbiguousClassInfo()
public void setConnectorAmbiguousClassInfo(ObjectClassMapping.AmbiguousClassInfo connectorAmbiguousClassInfo)
public String[] getConnectorAmbiguousClassNames()
public String[] getConnectorAmbiguousClassNames(ObjectClassMapping.AmbiguousPropInfo ambigPropInfo)
ambigPropInfo -
public String getConnectorClassNameDisplay()
public ObjectClassMapping.AmbiguousPropInfo getConnectorAmbiguousNamingAttrInfo()
public String[] getConnectorAmbiguousNamingAttrs()
public ObjectClassMapping.AmbiguousPropInfo getConnectorAmbiguousAttrInfo(String ldapAttrId)
public String[] getConnectorAmbiguousAttrIds(String ldapAttrId)
public Map<String,String> getCompoundLdapAttrIdToClassNameMap()
public Map<String,String> getCompoundConnectorAttrIdToClassNameMap()
public HashMap<String,String> getConnectorAttrIdToGenerator()
public Set<String> getConnectorGeneratedAttrIds()
public void putToConnectorAmbiguousAttrIds(String ldapAttrId,
String[] connAttrIds,
String ldapChoiceAttrId)
ldapAttrId,
optionally building a map of objectclass to attribute id choices where the mappings have
the form objectClass:attrId (for a classMap with ambiguous
connector objectclass mappings).
ldapAttrId - Ldap attribute with ambiguous connector mappings.connAttrIds - The ambiguous connector mappings.ldapChoiceAttrId - An optional attribute id can be provided to choose a specific option from
the set of ambiguous alternatives.public Map<String,ObjectClassMapping.AmbiguousPropInfo> getConnectorAmbiguousAttrInfoMap()
public Attribute getConnectorObjectClassAttr(Attributes attrs)
throws NamingException
LdapUtil.LDAP_OBJECT_CLASS containing connector object class,
where there is:attrs.
attrs - Attributes in which to look up connector class choice.
NamingException
public boolean isNativeObjectClassSet(Attributes attrs,
String objectClassAttrId)
attrs - Attributes to check inobjectClassAttrId - Attribute corresponding to connector level objectclass
public boolean isNativeObjectClassMapped()
public String getAmbiguousConnectorAttrId(String ldapAttrId,
Attribute objClassAttr,
Attribute choiceAttr)
throws NamingException
ldapAttrId given an attribute containing an object instance's
connector objectClasses.
ldapAttrId - Attribute on refClassMap which has ambiguous connector mappings.objClassAttr - Attribute containing connector object classes for an instance of
refClassMap.choiceAttr -
NamingExceptionpublic boolean isNameMapping()
public boolean isLdapAttrId(String ldapAttr)
public String[] getLdapAttrIds()
public boolean isConnectorAttrId(String connAttrId)
public String[] getConnectorAttrIds()
public void putLdapToConnectorAttrId(String ldapAttrId,
String connAttrId)
public String getConnectorAttrId(String ldapAttrId)
public void putDependentConnectorIds(String connAttrId,
String[] toConnMultiNames)
public Set<String> getDependentConnectorIds(String ldapAttrId)
putDependentConnectorIds(String, String[])public HashMap<String,Set<String>> getDependentConnectorIdMap()
putDependentConnectorIds(String, String[])public String getConnectorAttrIdDisplay(String ldapAttrId)
public boolean isDuplicateConnectorNamingAttr()
public void setDuplicateConnectorNamingAttr(boolean duplicateConnectorNamingAttr)
eTLDAGroup in the
LDA connector requires cn=value is mapped to eTLDAGroupName=value as
well as eTLDACn=value). In these cases this boolean needs to be set to true
to trigger special handling.
duplicateConnectorNamingAttr - true if at least one connector mapping for naming attribute
can potentially be duplicated.public String getLdapAttrId(String connAttrId)
public void putLdapAttrIdFromAlias(String alias,
String ldapAttrId)
public String getLdapAttrIdFromAlias(String alias)
public String getConnectorAttrIdFromAlias(String alias)
public ObjectClassMapping.AmbiguousPropInfo getConnectorAmbiguousAttrInfoFromAlias(String alias)
public boolean putConnectorToLdapAttrId(String connAttrId,
String ldapAttrId)
protected static String formatAmbiguousMapValue(String[] mappedValues)
public String toString()
toString in class Objectpublic Boolean getIndirectAssociations()
public String getConnectorNamingAttrIdDisplay()
public Collection<Association> getAllAssociations()
public void addAssociation(Association assoc)
public Collection<Association> getAllAssociations(boolean indirect)
indirect defined for this class mapping.
public Collection<Association> getFromAssociations()
Association records for associative attributes in
this class, referring to other classes.
public void addFromAssociation(Association assoc)
public Collection<Association> getFromAssociations(boolean indirect)
Association records for associative attributes in
this class, referring to other classes.
public void addConnectorAttrAssoc(String connAttrId,
Association assoc)
@Deprecated public void addConnectorAttrKeyAssoc(Association assoc)
public void addConnectorAttrAssoc(String[] connAttrIds,
Association assoc)
public Collection<Association> getToAssociations()
Association records referring to this class from
other classes.
public void addToAssociation(Association assoc)
public Collection<Association> getToAssociations(boolean indirect)
Association records referring to this class from
other classes.
@Deprecated public HashMap<String,Collection<Association>> getConnectorAttrKeyAssocMap()
@Deprecated public void setConnectorAttrKeyAssocMap(HashMap<String,Collection<Association>> connectorAttrKeyAssocMap)
public Association getConnectorAttrAssoc(String connAttrId)
Association from this class to another, given connector-speak attr name.
@Deprecated public Association getConnectorAttrAssocWithKey(String connAttrId)
Association from this class to another, given connector-speak attr name.
The connector speak attribute name corresponds to the attribute that participates in an association as a key.
public Collection<Association> getConnectorAttrAssocsWithKey(String connAttrId)
public Collection<Association> getConnectorAttrAssocsWithKey(String connAttrId,
boolean objKey,
boolean refKey)
public Association getLdapAttrAssoc(String ldapAttrId)
public Association findChildCompoundAssoc(String connAttrId)
public AssocModificationItem[] splitAssocAttrs(Attributes attrs)
attrs and returned for easy processing (null is returned if no associative
attributes are encountered). Compound value attributes get special processing, so that if they have
an assocation which is defined at the child end (assocType=COMPOUND_CHILD) it will be looked up and
bundled with the attribute containing the compound values. Compound values with neither parent or child
side associations are not split from attrs.
splitPurgeNull(AssocModificationItem[])public static AssocModificationItem[] splitPurgeNull(AssocModificationItem[] items)
public Attributes splitBinaryAttrs(Attributes attrs)
public SplitBinaryAttrIds splitBinaryAttrs(String[] attrIds)
public SplitModificationItems splitAssocModificationItems(ModificationItem[] items)
splitPurgeNull(AssocModificationItem[])public SplitAttrIds splitAssocAttrIds(String[] attrIds)
splitPurgeNull(SplitAttrIds)public static SplitAttrIds splitPurgeNull(SplitAttrIds splitIds)
public List<Attribute> getDefaults()
public void addTrimConnectorAttrId(String connAttrId)
connAttrId - public boolean isTrimConnectorAttrId(String connAttrId)
connAttrId -
public boolean isTrimNamingAttrId()
public HashMap<String,String> getConnectorToLdapAttrIdMap()
public Name getConnectorSearchContainer()
public void setConnectorSearchContainer(Name connectorSearchContainer)
public boolean isCompoundValue()
public void setCompoundValue(boolean compoundValue)
public boolean isVirtual()
public void setVirtual(boolean virtual)
public boolean isSensitive(boolean isConnectorSpeak,
String attrId)
public String toString(Attribute attr)
public String toString(Attributes attrs)
public String toString(ModificationItem item)
public String toString(ModificationItem[] items)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||