com.ca.jcs
Class ObjectClassMapping

java.lang.Object
  extended by com.ca.jcs.ObjectClassMapping
Direct Known Subclasses:
MetaObjectClassMapping

public abstract class ObjectClassMapping
extends Object

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
 
Field Summary
protected  HashMap<String,String> aliasToLdapAttrIdMap
           
protected  Collection<Association> allAssociations
          Name of LDAP attribute to Association info, for multi-valued attributes.
protected  Map<Boolean,Collection<Association>> allAssocsByIndirect
           
protected  boolean altKeyAssoc
           
static String AMBIGUOUS_PREF
           
protected  HashMap<String,String> compoundConnectorAttrIdToClassNameMap
          Map from compound connector attr id to its compound value class name.
protected  HashMap<String,String> compoundLdapAttrIdClassNameMap
          Map from compound LDAP attr id to its compound value class name.
protected  String[] connectorAllAttrIds
           
protected  HashMap<String,Association> connectorAttrAssocMap
           
protected  String[] connectorAttrIds
           
protected  HashMap<String,String> connectorAttrIdToGenerator
           
protected  HashMap<String,Collection<Association>> connectorAttrKeyAssocMap
          Deprecated. 
protected  HashMap<String,String> connectorToLdapAttrIdMap
           
protected  HashMap<String,Set<String>> dependentConnectorIdMap
           
protected  Collection<Association> fromAssociations
           
protected  Map<Boolean,Collection<Association>> fromAssocsByIndirect
           
protected  Boolean indirectAssociations
           
protected  String[] ldapAttrIds
           
protected  HashMap<String,DataModelProperty> ldapAttrInfoMap
          Extra information associated with each LDAP attribute.
protected  Object ldapClassInfo
          Extra information associated with this LDAP object class.
protected  HashMap<String,String> ldapToConnectorAttrIdMap
          LDAP Attr name => connector speak attr name.
protected  Collection<Association> toAssociations
           
protected  Map<Boolean,Collection<Association>> toAssocsByIndirect
           
 
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

ldapClassInfo

protected Object ldapClassInfo
Extra information associated with this LDAP object class.


ldapAttrInfoMap

protected HashMap<String,DataModelProperty> ldapAttrInfoMap
Extra information associated with each LDAP attribute.


ldapAttrIds

protected String[] ldapAttrIds

connectorAttrIds

protected String[] connectorAttrIds

connectorAllAttrIds

protected String[] connectorAllAttrIds

ldapToConnectorAttrIdMap

protected HashMap<String,String> ldapToConnectorAttrIdMap
LDAP Attr name => connector speak attr name.


aliasToLdapAttrIdMap

protected HashMap<String,String> aliasToLdapAttrIdMap

connectorToLdapAttrIdMap

protected HashMap<String,String> connectorToLdapAttrIdMap

connectorAttrIdToGenerator

protected HashMap<String,String> connectorAttrIdToGenerator

dependentConnectorIdMap

protected HashMap<String,Set<String>> dependentConnectorIdMap

AMBIGUOUS_PREF

public static final String AMBIGUOUS_PREF
See Also:
Constant Field Values

allAssociations

protected Collection<Association> allAssociations
Name of LDAP attribute to Association info, for multi-valued attributes.


fromAssociations

protected Collection<Association> fromAssociations

toAssociations

protected Collection<Association> toAssociations

allAssocsByIndirect

protected Map<Boolean,Collection<Association>> allAssocsByIndirect

fromAssocsByIndirect

protected Map<Boolean,Collection<Association>> fromAssocsByIndirect

toAssocsByIndirect

protected Map<Boolean,Collection<Association>> toAssocsByIndirect

connectorAttrAssocMap

protected HashMap<String,Association> connectorAttrAssocMap

connectorAttrKeyAssocMap

@Deprecated
protected HashMap<String,Collection<Association>> connectorAttrKeyAssocMap
Deprecated. 

indirectAssociations

protected Boolean indirectAssociations

altKeyAssoc

protected boolean altKeyAssoc

compoundLdapAttrIdClassNameMap

protected HashMap<String,String> compoundLdapAttrIdClassNameMap
Map from compound LDAP attr id to its compound value class name.


compoundConnectorAttrIdToClassNameMap

protected HashMap<String,String> compoundConnectorAttrIdToClassNameMap
Map from compound connector attr id to its compound value class name.

Constructor Detail

ObjectClassMapping

public ObjectClassMapping(String ldapClassName,
                          boolean caseSensitive,
                          Boolean indirectAssociations)
Method Detail

getSpecialRole

public ObjectClassMapping.SpecialRole getSpecialRole()

setSpecialRole

public void setSpecialRole(ObjectClassMapping.SpecialRole specialRole)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getLdapClassName

public String getLdapClassName()
Name of this LDAP class.


getLdapNamingAttrId

public String getLdapNamingAttrId()

setLdapNamingAttrId

public void setLdapNamingAttrId(String ldapNamingAttrId)

isCaseSensitive

public boolean isCaseSensitive()

getConnectorClassName

public String getConnectorClassName()
Returns:
Name of this LDAP object class in connector-speak.

setConnectorClassName

public void setConnectorClassName(String connectorClassName)

getAlias

public 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.


setAlias

public void setAlias(String alias)

isConnectorNamingAttrId

public boolean isConnectorNamingAttrId(String connAttrId)
Is the provided connAttrId the unique naming attribute for this class?


getConnectorNamingAttrId

public String getConnectorNamingAttrId()
Return the unique naming attribute for this class, or null if it can't be determined.


setConnectorNamingAttrId

public void setConnectorNamingAttrId(String namingAttrId)

getConnectorNamingAttrIds

public String[] getConnectorNamingAttrIds()
Returns array of all naming attr ids, to ease coding when don't care whether ambiguous or not.


isContainer

public boolean isContainer()

setContainer

public void setContainer(boolean container)

getChildTypes

public String[] getChildTypes()

setChildTypes

public void setChildTypes(String[] childTypes)

isConnectorMapToLax

public boolean isConnectorMapToLax()

setConnectorMapToLax

public void setConnectorMapToLax(boolean connectorMapToLax)

isConnectorClass

public boolean isConnectorClass()
Is this mapping for the connector itself, aka endpoint or directory? Simply calls getSpecialRole().


isAccountClass

public boolean isAccountClass()
Is this mapping for the connector's account abstraction? Simply calls getSpecialRole().


isAltKeyAssoc

public boolean isAltKeyAssoc()

setAltKeyAssoc

public void setAltKeyAssoc(boolean altKeyAssocs)
Does this class contain associations using alternate keys, affecting MODIFY_RN strategy


getOverriddenOperations

public Set<String> getOverriddenOperations()

getConnectorAmbiguousClassInfo

public ObjectClassMapping.AmbiguousClassInfo getConnectorAmbiguousClassInfo()
Returns:
If map to ambiguous choice of more then one connector objectclass then return information about the choices, null otherwise.

setConnectorAmbiguousClassInfo

public void setConnectorAmbiguousClassInfo(ObjectClassMapping.AmbiguousClassInfo connectorAmbiguousClassInfo)

getConnectorAmbiguousClassNames

public String[] getConnectorAmbiguousClassNames()

getConnectorAmbiguousClassNames

public String[] getConnectorAmbiguousClassNames(ObjectClassMapping.AmbiguousPropInfo ambigPropInfo)
Given an ambiguous property return all the objectclasses that it can ambiguously map to

Parameters:
ambigPropInfo -
Returns:

getConnectorClassNameDisplay

public String getConnectorClassNameDisplay()
Human readable display name suitable for error messages, even when mapping is ambiguous.


getConnectorAmbiguousNamingAttrInfo

public ObjectClassMapping.AmbiguousPropInfo getConnectorAmbiguousNamingAttrInfo()

getConnectorAmbiguousNamingAttrs

public String[] getConnectorAmbiguousNamingAttrs()

getConnectorAmbiguousAttrInfo

public ObjectClassMapping.AmbiguousPropInfo getConnectorAmbiguousAttrInfo(String ldapAttrId)
Ambiguous naming attributes expected to be most common case.


getConnectorAmbiguousAttrIds

public String[] getConnectorAmbiguousAttrIds(String ldapAttrId)

getCompoundLdapAttrIdToClassNameMap

public 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.


getCompoundConnectorAttrIdToClassNameMap

public 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.


getConnectorAttrIdToGenerator

public HashMap<String,String> getConnectorAttrIdToGenerator()

getConnectorGeneratedAttrIds

public Set<String> getConnectorGeneratedAttrIds()

putToConnectorAmbiguousAttrIds

public 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).

Parameters:
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.

getConnectorAmbiguousAttrInfoMap

public Map<String,ObjectClassMapping.AmbiguousPropInfo> getConnectorAmbiguousAttrInfoMap()

getConnectorObjectClassAttr

public Attribute getConnectorObjectClassAttr(Attributes attrs)
                                      throws NamingException
Return attribute LdapUtil.LDAP_OBJECT_CLASS containing connector object class, where there is:
  1. There is a property with connectorMapTo equal to "Choice:objectClass".
  2. This property is mentioned in attrs.

Parameters:
attrs - Attributes in which to look up connector class choice.
Returns:
Attribute containing connector class.
Throws:
NamingException

isNativeObjectClassSet

public boolean isNativeObjectClassSet(Attributes attrs,
                                      String objectClassAttrId)
Test if connector level 'objectclass' is present in a set of attributes

Parameters:
attrs - Attributes to check in
objectClassAttrId - Attribute corresponding to connector level objectclass
Returns:
true if objectclass is present, false otherwise

isNativeObjectClassMapped

public boolean isNativeObjectClassMapped()
Check if one of the connector side attribute mappings corresponds to 'objectclass'

Returns:
true if there is such a mapping, false otherwise

getAmbiguousConnectorAttrId

public String getAmbiguousConnectorAttrId(String ldapAttrId,
                                          Attribute objClassAttr,
                                          Attribute choiceAttr)
                                   throws NamingException
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.

Parameters:
ldapAttrId - Attribute on refClassMap which has ambiguous connector mappings.
objClassAttr - Attribute containing connector object classes for an instance of refClassMap.
choiceAttr -
Returns:
Appropriate connector attribute id choice if once can be found using the provided objectClass values, null otherwise.
Throws:
NamingException

isNameMapping

public boolean isNameMapping()
Returns:
Are this LDAP objectClass and its attribute Ids mapped to different names for the connector, or are they passed through unchanged?

isLdapAttrId

public boolean isLdapAttrId(String ldapAttr)

getLdapAttrIds

public String[] getLdapAttrIds()

isConnectorAttrId

public boolean isConnectorAttrId(String connAttrId)

getConnectorAttrIds

public String[] getConnectorAttrIds()

putLdapToConnectorAttrId

public void putLdapToConnectorAttrId(String ldapAttrId,
                                     String connAttrId)

getConnectorAttrId

public String getConnectorAttrId(String ldapAttrId)
Return connector attribute id equivalent for provided ldapAttrId.


putDependentConnectorIds

public 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. Hence whenever connAttrId is requested in a lookup or search request, the value for every entry in toConnMultiNames must also be requested.


getDependentConnectorIds

public Set<String> getDependentConnectorIds(String ldapAttrId)
See Also:
putDependentConnectorIds(String, String[])

getDependentConnectorIdMap

public HashMap<String,Set<String>> getDependentConnectorIdMap()
See Also:
putDependentConnectorIds(String, String[])

getConnectorAttrIdDisplay

public String getConnectorAttrIdDisplay(String ldapAttrId)

isDuplicateConnectorNamingAttr

public boolean isDuplicateConnectorNamingAttr()

setDuplicateConnectorNamingAttr

public 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). In these cases this boolean needs to be set to true to trigger special handling.

Parameters:
duplicateConnectorNamingAttr - true if at least one connector mapping for naming attribute can potentially be duplicated.

getLdapAttrId

public String getLdapAttrId(String connAttrId)

putLdapAttrIdFromAlias

public void putLdapAttrIdFromAlias(String alias,
                                   String ldapAttrId)
Record that a connector-speak alias maps to the provided ldapAttrId.


getLdapAttrIdFromAlias

public String getLdapAttrIdFromAlias(String alias)
Return the ldap attribute id associated with the provided alias.


getConnectorAttrIdFromAlias

public 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.


getConnectorAmbiguousAttrInfoFromAlias

public 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.


putConnectorToLdapAttrId

public boolean putConnectorToLdapAttrId(String connAttrId,
                                        String ldapAttrId)

formatAmbiguousMapValue

protected static String formatAmbiguousMapValue(String[] mappedValues)

toString

public String toString()
Overrides:
toString in class Object

getIndirectAssociations

public Boolean getIndirectAssociations()
If indirectAssociations is not null, then returns it and otherwise returns true if any indirect associations have been defined for this classMap.


getConnectorNamingAttrIdDisplay

public String getConnectorNamingAttrIdDisplay()

getAllAssociations

public Collection<Association> getAllAssociations()
Return all associations defined for this class mapping.


addAssociation

public void addAssociation(Association assoc)

getAllAssociations

public Collection<Association> getAllAssociations(boolean indirect)
Return all associations matching indirect defined for this class mapping.


getFromAssociations

public Collection<Association> getFromAssociations()
Return all Association records for associative attributes in this class, referring to other classes.


addFromAssociation

public void addFromAssociation(Association assoc)

getFromAssociations

public Collection<Association> getFromAssociations(boolean indirect)
Return all Association records for associative attributes in this class, referring to other classes.


addConnectorAttrAssoc

public void addConnectorAttrAssoc(String connAttrId,
                                  Association assoc)

addConnectorAttrKeyAssoc

@Deprecated
public void addConnectorAttrKeyAssoc(Association assoc)
Deprecated. 


addConnectorAttrAssoc

public void addConnectorAttrAssoc(String[] connAttrIds,
                                  Association assoc)

getToAssociations

public Collection<Association> getToAssociations()
Return all Association records referring to this class from other classes.


addToAssociation

public void addToAssociation(Association assoc)

getToAssociations

public Collection<Association> getToAssociations(boolean indirect)
Return all Association records referring to this class from other classes.


getConnectorAttrKeyAssocMap

@Deprecated
public HashMap<String,Collection<Association>> getConnectorAttrKeyAssocMap()
Deprecated. 


setConnectorAttrKeyAssocMap

@Deprecated
public void setConnectorAttrKeyAssocMap(HashMap<String,Collection<Association>> connectorAttrKeyAssocMap)
Deprecated. 


getConnectorAttrAssoc

public Association getConnectorAttrAssoc(String connAttrId)
Return Association from this class to another, given connector-speak attr name.


getConnectorAttrAssocWithKey

@Deprecated
public Association getConnectorAttrAssocWithKey(String connAttrId)
Deprecated. 

Return 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.


getConnectorAttrAssocsWithKey

public Collection<Association> getConnectorAttrAssocsWithKey(String connAttrId)

getConnectorAttrAssocsWithKey

public Collection<Association> getConnectorAttrAssocsWithKey(String connAttrId,
                                                             boolean objKey,
                                                             boolean refKey)

getLdapAttrAssoc

public Association getLdapAttrAssoc(String ldapAttrId)

findChildCompoundAssoc

public 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).


splitAssocAttrs

public 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). 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.

See Also:
splitPurgeNull(AssocModificationItem[])

splitPurgeNull

public 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.

Returns:
items with null entries purged from it, or null if all entries were null.

splitBinaryAttrs

public Attributes splitBinaryAttrs(Attributes attrs)

splitBinaryAttrs

public SplitBinaryAttrIds splitBinaryAttrs(String[] attrIds)

splitAssocModificationItems

public 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).

See Also:
splitPurgeNull(AssocModificationItem[])

splitAssocAttrIds

public 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).

See Also:
splitPurgeNull(SplitAttrIds)

splitPurgeNull

public 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.

Returns:
splitIds with null entries purged from it, or null if no assocs remain to be processed.

getDefaults

public List<Attribute> getDefaults()
Returns list of attributes which have default values which may be empty but never null.


addTrimConnectorAttrId

public void addTrimConnectorAttrId(String connAttrId)
Check if a given connector attribute requires whitespace trimming

Parameters:
connAttrId -

isTrimConnectorAttrId

public boolean isTrimConnectorAttrId(String connAttrId)
Check if a given connector attribute requires whitespace trimming

Parameters:
connAttrId -
Returns:
true if trimming is needed, false otherwise

isTrimNamingAttrId

public boolean isTrimNamingAttrId()
Check if a given connector naming attribute requires whitespace trimming

Returns:
true if trimming is needed, false otherwise

getConnectorToLdapAttrIdMap

public HashMap<String,String> getConnectorToLdapAttrIdMap()

getConnectorSearchContainer

public Name getConnectorSearchContainer()

setConnectorSearchContainer

public void setConnectorSearchContainer(Name connectorSearchContainer)

isCompoundValue

public boolean isCompoundValue()

setCompoundValue

public void setCompoundValue(boolean compoundValue)

isVirtual

public boolean isVirtual()

setVirtual

public void setVirtual(boolean virtual)

isSensitive

public boolean isSensitive(boolean isConnectorSpeak,
                           String attrId)
Returns true if value for attribute shouldn't be logged in cleartext.


toString

public String toString(Attribute attr)
Create string dump of value of connector-speak attr, but don't display values for sensitive attributes.


toString

public String toString(Attributes attrs)
Create string dump of values of connector-speak attrs, but don't display values for sensitive attributes.


toString

public String toString(ModificationItem item)
Create string dump of values of connector-speak item, but don't display values for sensitive attributes.


toString

public String toString(ModificationItem[] items)
Create string dump of connector-speak items, but don't display values for sensitive attributes.



Created 2011-07-14 13:27 EST