com.ca.jcs.meta
Class MetaObjectClassMapping

java.lang.Object
  extended by com.ca.jcs.ObjectClassMapping
      extended by com.ca.jcs.meta.MetaObjectClassMapping

public class MetaObjectClassMapping
extends ObjectClassMapping

Mapping based on values read from a metadata file, where important attributes are extracted and cached for efficiency.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ca.jcs.ObjectClassMapping
ObjectClassMapping.AmbiguousClassInfo, ObjectClassMapping.AmbiguousPropInfo, ObjectClassMapping.AssocIsIndirectPred, ObjectClassMapping.IsStructuralObjectClassPred, ObjectClassMapping.SpecialRole, ObjectClassMapping.StringEqFn
 
Field Summary
static String AMBIGUOUS_CHOICE_UNAMBIGUOUS_MAPPING_MSG
           
static String EMPTY_PROP_NAME_MSG
           
static String MULTIPLE_NAMING_ATTRS_MSG
           
static String NAMING_ATTR_MUST_CONN_FILTERABLE
           
protected  Set<String> normalizeConnValueProps
          Set of property names/LDAP attr ids where connector side value needs to be normalized
static String PROP_FOR_UNMAPPED_CLASS_MSG
           
static String SPECIAL_CONNECTOR_ATTRIBUTE_IS_QUERY_ONLY
           
static String UNMAPPED_AMBIGUOUS_PROP_MSG
           
 
Fields inherited from class com.ca.jcs.ObjectClassMapping
aliasToLdapAttrIdMap, allAssociations, allAssocsByIndirect, altKeyAssoc, AMBIGUOUS_PREF, compoundConnectorAttrIdToClassNameMap, compoundLdapAttrIdClassNameMap, connectorAllAttrIds, connectorAttrAssocMap, connectorAttrIds, connectorAttrIdToGenerator, connectorAttrKeyAssocMap, connectorToLdapAttrIdMap, dependentConnectorIdMap, fromAssociations, fromAssocsByIndirect, indirectAssociations, ldapAttrIds, ldapAttrInfoMap, ldapClassInfo, ldapToConnectorAttrIdMap, toAssociations, toAssocsByIndirect
 
Constructor Summary
MetaObjectClassMapping(DataModelClass cls, boolean caseSensitive, boolean allowNonFilterableNamingAttr, Boolean indirectAssociations, List<String> acceptedUnknownAttrIds, MetaConnectorType connType)
           
MetaObjectClassMapping(DataModelClass cls, boolean caseSensitive, Boolean indirectAssociations, List<String> acceptedUnknownAttrIds)
          Deprecated. 
MetaObjectClassMapping(String className, String namingAttrId, boolean caseSensitive)
          Constructor for a pass-through class mapping without a DataModelClass.
 
Method Summary
 void addClassValidator(ContextAwareClassValidator classValidator)
           
 void applyClassConverters(Attributes attrs, boolean toConnector, boolean structuralOnly)
           
 ModificationItem[] applyClassConverters(ModificationItem[] modItems, boolean toConnector)
           
 boolean flatten(Attribute connAttr)
          Flatten connAttr if required.
 boolean flatten(Attributes connAttrs)
          Flatten any contained attributes which require it, and return true if any such attributes were infact converted.
 boolean flatten(DataModelProperty prop, Attribute unflattenedConnAttr)
          Flatten unflattenedConnAttr if required.
 String[] getCheapConnectorAttrIds()
          By default all attribute whose values aren't calculated from associations are considered "cheap".
 String[] getCheapLdapAttrIds()
          By default all attribute whose values aren't calculated from associations are considered "cheap".
 List<ClassConverter> getClassConverters()
           
 List<ClassConverter> getClassConverters(boolean toConnector)
           
 List<ContextAwareClassValidator> getClassValidators()
           
 String getConnectorAliasFromAttrId(String ldapAttrId)
          Return alias value for a connector attribute from an LDAP attribute Id If the metadata property mapped to the ldapAttrId has no alias defined then the connector attribute Id is returned
 String getConnectorAttrId(String ldapAttrId)
          Calls getConnectorAttrId(String, boolean) with strict=true.
 String getConnectorAttrId(String ldapAttrId, boolean strict)
          Return connector attribute id equivalent for provided ldapAttrId, but only for properties which are actually mentioned in the metadata.
 String[] getConnectorAttrIds()
           
 String[] getConnectorAttrIds(boolean includeWriteOnly)
           
 String[] getConnectorAttrIds(boolean includeWriteOnly, boolean includeConnSpec)
           
 boolean getConnectorBoolMetaDataValue(String connAttrId, String mdPropName, boolean defaultValue)
          Utility method which returns the value of the mdPropName for the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).
 DataModelProperty getConnectorMetaDataProperty(String connAttrId, String mdPropName)
          Utility method which returns the metadata property named mdPropName on the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).
 DataModelValue getConnectorMetaDataValue(String connAttrId, String mdPropName)
          Utility method which returns the value of the mdPropName for the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).
 DataModelProperty getConnectorProperty(String connAttrId)
          Utility method which returns the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).
 String getConnectorStringMetaDataValue(String connAttrId, String mdPropName)
          Utility method which returns the value of the mdPropName for the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).
 DataModelClass getDataModelClass()
           
 DataModelProperty getDataModelProperty(String name)
           
 Collection<String> getDnConnAttrIds(Collection<String> attrIds)
          Given a collection of connector-speak attribute Ids return Ids that correspond to DN attributes
 boolean getHasConnectorDependantConverter()
          At least one contained converter (in classmaps properties) implements ConnectorDependantAttributeConverter.
 String[] getNonAssocConnectorAttrIds()
          All attributes which aren't calculated from assocations.
 String[] getNonAssocLdapAttrIds()
           
 Set<String> getNonConnectorFilterableLdapAttrIds()
           
 Set<String> getNormalizeConnValueProps()
           
 MetaDataDefs.NormalizeConnValue getNormalizeMode(String ldapAttrId)
          Lookup which of normalization modes apply for an attribute identified by ldap-speak id
 MetaDataDefs.NormalizeConnValueStyle getNormalizeStyle(String ldapAttrId)
          Lookup normalization style if normalization is done, that applies for an attribute identified by ldap-speak id
 String[] getObjectClassFromAmbiguousConnAttr(ObjectClassMapping.AmbiguousPropInfo ambiguousPropInfo, String connAttrId)
          Retrieve all objectClasses from an ambiguous property mapping given its connector speak attribute
 String[] getObjectClassFromAmbiguousConnAttr(String connAttrId)
          Return connector objectClass values given a classMap and an ambiguous connector speak attribute
 String[] getObjectClassFromConnAttr(String connAttrId)
          Return objectClass values to which a connector speak attribute is mapped to either via ambiguous mappings or not.
 String[] getObjectClassFromLdapAttr(String ldapAttrId)
          Return connector objectClass values given a classMap and an ambiguous ldap speak attribute
 MetaObjectClassMappings getParent()
          Returns parent containing this classMap, so that others can be looked up by name etc.
 PropertyConverters getPropertyConverters(DataModelProperty prop)
           
 PropertyValidators getPropertyValidators(DataModelProperty prop)
           
 Map<String,Set<String>> getPropsToLdapObjectClasses()
           
 HashSet<String> getReadOnlyConnectorAttrIdSet()
           
 HashSet<String> getWriteOnlyConnectorAttrIdSet()
           
 boolean isCheapConnectorAttrId(String connAttrId)
           
 boolean isCheapLdapAttrId(String attrId)
           
 boolean isConnectorFilterableLdapAttrId(String ldapAttrId)
           
 boolean isDnConnAttrId(String connAttrId)
          Returns true if a given connector attribute id corresponds to an attribute that stores DN values
 boolean isDnLdapAttrId(String ldapAttrId)
          Returns true if a given LDAP attribute id corresponds to an attribute that stores DN values
 boolean isKnownClassName(String className)
          Mapped or derived from
 boolean isMappedClassName(String className)
           
 boolean isNormalizeLdapAttrId(String ldapAttrId)
           
 boolean isReadOnlyConnectorAttrId(String connAttrId)
           
 boolean isTransactionsEnabled()
           
 boolean isWriteOnlyConnectorAttrId(String connAttrId)
           
 void putPropertyConverters(DataModelProperty prop, PropertyConverters converters)
           
 void putPropertyValidators(DataModelProperty prop, PropertyValidators validators)
           
 void setClassConverters(List<ClassConverter> classConverters)
           
protected  boolean setConnectorSearchContainer(String clsSearchContainer)
          Set the container DN for this class to be used by searches
 void setDefaults(Attributes attrs)
          If any of this class' attributes have defaults, then add them to attrs unless explicit values are already set.
 void setHasConnectorDependantConverter(boolean hasConnectorDependantConverter)
           
 void setNormalizeConnValueProps(Set<String> normalizeConnValueProps)
           
 void setParent(MetaObjectClassMappings parent)
           
 void setTransactionsEnabled(Boolean transactionsEnabled)
           
 String[][] splitCheapConnectorAttrIds(String[] connAttrIds)
           
 String[][] splitCheapLdapAttrNames(String[] attrIds)
           
 String[][] splitVirtualConnectorAttrIds(String[] connAttrIds)
           
 boolean unflatten(Attribute connAttr)
          Unflatten connAttr if required.
 boolean unflatten(Attributes connAttrs)
          Unflatten any contained attributes which are flattened, and return true if any such attributes were infact converted.
 boolean unflatten(DataModelProperty prop, Attribute flattenedConnAttr)
          Unflatten flattenedConnAttr if required for the provided attribute (even if its value is null) by looking at converters associated with prop independent of the number of values in flattenedConnAttr.
 Attribute unflatten(DataModelProperty prop, String value)
          Return results of unflattening the provided value, or return null if it isn't configured to be flattened.
 
Methods inherited from class com.ca.jcs.ObjectClassMapping
addAssociation, addConnectorAttrAssoc, addConnectorAttrAssoc, addConnectorAttrKeyAssoc, addFromAssociation, addToAssociation, addTrimConnectorAttrId, equals, findChildCompoundAssoc, formatAmbiguousMapValue, getAlias, getAllAssociations, getAllAssociations, getAmbiguousConnectorAttrId, getChildTypes, getCompoundConnectorAttrIdToClassNameMap, getCompoundLdapAttrIdToClassNameMap, getConnectorAmbiguousAttrIds, getConnectorAmbiguousAttrInfo, getConnectorAmbiguousAttrInfoFromAlias, getConnectorAmbiguousAttrInfoMap, getConnectorAmbiguousClassInfo, getConnectorAmbiguousClassNames, getConnectorAmbiguousClassNames, getConnectorAmbiguousNamingAttrInfo, getConnectorAmbiguousNamingAttrs, getConnectorAttrAssoc, getConnectorAttrAssocsWithKey, getConnectorAttrAssocsWithKey, getConnectorAttrAssocWithKey, getConnectorAttrIdDisplay, getConnectorAttrIdFromAlias, getConnectorAttrIdToGenerator, getConnectorAttrKeyAssocMap, getConnectorClassName, getConnectorClassNameDisplay, getConnectorGeneratedAttrIds, getConnectorNamingAttrId, getConnectorNamingAttrIdDisplay, getConnectorNamingAttrIds, getConnectorObjectClassAttr, getConnectorSearchContainer, getConnectorToLdapAttrIdMap, getDefaults, getDependentConnectorIdMap, getDependentConnectorIds, getFromAssociations, getFromAssociations, getIndirectAssociations, getLdapAttrAssoc, getLdapAttrId, getLdapAttrIdFromAlias, getLdapAttrIds, getLdapClassName, getLdapNamingAttrId, getOverriddenOperations, getSpecialRole, getToAssociations, getToAssociations, hashCode, isAccountClass, isAltKeyAssoc, isCaseSensitive, isCompoundValue, isConnectorAttrId, isConnectorClass, isConnectorMapToLax, isConnectorNamingAttrId, isContainer, isDuplicateConnectorNamingAttr, isLdapAttrId, isNameMapping, isNativeObjectClassMapped, isNativeObjectClassSet, isSensitive, isTrimConnectorAttrId, isTrimNamingAttrId, isVirtual, putConnectorToLdapAttrId, putDependentConnectorIds, putLdapAttrIdFromAlias, putLdapToConnectorAttrId, putToConnectorAmbiguousAttrIds, setAlias, setAltKeyAssoc, setChildTypes, setCompoundValue, setConnectorAmbiguousClassInfo, setConnectorAttrKeyAssocMap, setConnectorClassName, setConnectorMapToLax, setConnectorNamingAttrId, setConnectorSearchContainer, setContainer, setDuplicateConnectorNamingAttr, setLdapNamingAttrId, setSpecialRole, setVirtual, splitAssocAttrIds, splitAssocAttrs, splitAssocModificationItems, splitBinaryAttrs, splitBinaryAttrs, splitPurgeNull, splitPurgeNull, toString, toString, toString, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNMAPPED_AMBIGUOUS_PROP_MSG

public static final String UNMAPPED_AMBIGUOUS_PROP_MSG
See Also:
Constant Field Values

EMPTY_PROP_NAME_MSG

public static final String EMPTY_PROP_NAME_MSG
See Also:
Constant Field Values

MULTIPLE_NAMING_ATTRS_MSG

public static final String MULTIPLE_NAMING_ATTRS_MSG
See Also:
Constant Field Values

AMBIGUOUS_CHOICE_UNAMBIGUOUS_MAPPING_MSG

public static final String AMBIGUOUS_CHOICE_UNAMBIGUOUS_MAPPING_MSG
See Also:
Constant Field Values

PROP_FOR_UNMAPPED_CLASS_MSG

public static final String PROP_FOR_UNMAPPED_CLASS_MSG
See Also:
Constant Field Values

SPECIAL_CONNECTOR_ATTRIBUTE_IS_QUERY_ONLY

public static final String SPECIAL_CONNECTOR_ATTRIBUTE_IS_QUERY_ONLY
See Also:
Constant Field Values

NAMING_ATTR_MUST_CONN_FILTERABLE

public static final String NAMING_ATTR_MUST_CONN_FILTERABLE
See Also:
Constant Field Values

normalizeConnValueProps

protected Set<String> normalizeConnValueProps
Set of property names/LDAP attr ids where connector side value needs to be normalized

Constructor Detail

MetaObjectClassMapping

@Deprecated
public MetaObjectClassMapping(DataModelClass cls,
                                         boolean caseSensitive,
                                         Boolean indirectAssociations,
                                         List<String> acceptedUnknownAttrIds)
Deprecated. 


MetaObjectClassMapping

public MetaObjectClassMapping(DataModelClass cls,
                              boolean caseSensitive,
                              boolean allowNonFilterableNamingAttr,
                              Boolean indirectAssociations,
                              List<String> acceptedUnknownAttrIds,
                              MetaConnectorType connType)

MetaObjectClassMapping

public MetaObjectClassMapping(String className,
                              String namingAttrId,
                              boolean caseSensitive)
Constructor for a pass-through class mapping without a DataModelClass.

Parameters:
className - name of the LDAP object class.
namingAttrId - the name of the LDAP naming attribute for the class.
caseSensitive - where to use case sensitivity in lookups.
Method Detail

getParent

public MetaObjectClassMappings getParent()
Returns parent containing this classMap, so that others can be looked up by name etc.


setParent

public void setParent(MetaObjectClassMappings parent)

getHasConnectorDependantConverter

public boolean getHasConnectorDependantConverter()
At least one contained converter (in classmaps properties) implements ConnectorDependantAttributeConverter.


setHasConnectorDependantConverter

public void setHasConnectorDependantConverter(boolean hasConnectorDependantConverter)

isTransactionsEnabled

public boolean isTransactionsEnabled()

setTransactionsEnabled

public void setTransactionsEnabled(Boolean transactionsEnabled)

setDefaults

public void setDefaults(Attributes attrs)
If any of this class' attributes have defaults, then add them to attrs unless explicit values are already set.


getDataModelClass

public DataModelClass getDataModelClass()

getDataModelProperty

public DataModelProperty getDataModelProperty(String name)

isReadOnlyConnectorAttrId

public boolean isReadOnlyConnectorAttrId(String connAttrId)

getReadOnlyConnectorAttrIdSet

public HashSet<String> getReadOnlyConnectorAttrIdSet()

isWriteOnlyConnectorAttrId

public boolean isWriteOnlyConnectorAttrId(String connAttrId)

getWriteOnlyConnectorAttrIdSet

public HashSet<String> getWriteOnlyConnectorAttrIdSet()

getConnectorAttrId

public String getConnectorAttrId(String ldapAttrId,
                                 boolean strict)
Return connector attribute id equivalent for provided ldapAttrId, but only for properties which are actually mentioned in the metadata.

Parameters:
ldapAttrId - LDAP-speak attribute to be looked up.
strict - If true, then return null unless connector-speak attribute is always going to map the same way (ie can be false when want to know attr so you can look up lazy proxy).
Returns:
Connector-speak mapping matching ldapAttrId

getConnectorAttrId

public String getConnectorAttrId(String ldapAttrId)
Calls getConnectorAttrId(String, boolean) with strict=true.

Overrides:
getConnectorAttrId in class ObjectClassMapping

getConnectorBoolMetaDataValue

public boolean getConnectorBoolMetaDataValue(String connAttrId,
                                             String mdPropName,
                                             boolean defaultValue)
Utility method which returns the value of the mdPropName for the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).

Parameters:
connAttrId - Connector-speak version of the attribute name, which denotes a datamodel property.
mdPropName - Metadata property name to be looked up on the datamodel property associated with connAttrId.
defaultValue - Default value to return if mdPropName is not mentioned in the datamodel property's metadata settings.
Returns:
Value of the specified metadata property, or defaultValue if it is not defined.

getConnectorStringMetaDataValue

public String getConnectorStringMetaDataValue(String connAttrId,
                                              String mdPropName)
Utility method which returns the value of the mdPropName for the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).

Parameters:
connAttrId - Connector-speak version of the attribute name, which denotes a datamodel property.
mdPropName - Metadata property name to be looked up on the datamodel property associated with connAttrId.
Returns:
Value of the specified metadata property, or null if it is not defined.

getConnectorProperty

public DataModelProperty getConnectorProperty(String connAttrId)
Utility method which returns the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).

Parameters:
connAttrId - Connector-speak version of the attribute name, which denotes a datamodel property.
Returns:
Metadata property with specified name, or null.

getConnectorMetaDataProperty

public DataModelProperty getConnectorMetaDataProperty(String connAttrId,
                                                      String mdPropName)
Utility method which returns the metadata property named mdPropName on the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).

Parameters:
connAttrId - Connector-speak version of the attribute name, which denotes a datamodel property.
mdPropName - Metadata property name to be looked up on the datamodel property associated with connAttrId.
Returns:
Metadata property with specified name, or null.

getConnectorMetaDataValue

public DataModelValue getConnectorMetaDataValue(String connAttrId,
                                                String mdPropName)
Utility method which returns the value of the mdPropName for the datamodel property associated with attribute connAttrId (which is the connector-speak version of the attribute name).

Parameters:
connAttrId - Connector-speak version of the attribute name, which denotes a datamodel property.
mdPropName - Metadata property name to be looked up on the datamodel property associated with connAttrId.
Returns:
Value of metadata property with specified name, or null.

getConnectorAliasFromAttrId

public String getConnectorAliasFromAttrId(String ldapAttrId)
Return alias value for a connector attribute from an LDAP attribute Id If the metadata property mapped to the ldapAttrId has no alias defined then the connector attribute Id is returned

Parameters:
ldapAttrId - Attribute to be looked up.
Returns:
Alias for ldapAttrId, or null if there is none defined in metadata.

getConnectorAttrIds

public String[] getConnectorAttrIds(boolean includeWriteOnly)
Returns:
All attributes known to the connector, including non-queryable attributes if includeWriteOnly is true.

getConnectorAttrIds

public String[] getConnectorAttrIds(boolean includeWriteOnly,
                                    boolean includeConnSpec)
Returns:
All attributes known to the connector, including non-queryable attributes if includeWriteOnly is true and connector only/virtual attributes if includeConnSpec is true see BaseConnector.CONN_SPEC.

getConnectorAttrIds

public String[] getConnectorAttrIds()
Overrides:
getConnectorAttrIds in class ObjectClassMapping
Returns:
all queriable attributes known to the connector, which involves removing write-only attributes, as well as unmapped ones.

getNonAssocLdapAttrIds

public String[] getNonAssocLdapAttrIds()
Returns:
all attributes known to the connector (including write only and expensive), which are not associations

getCheapLdapAttrIds

public String[] getCheapLdapAttrIds()
By default all attribute whose values aren't calculated from associations are considered "cheap". If there are other "expensive" attributes they need to be flagged as so using the MetaDataDefs.MD_IS_EXPENSIVE metadata property.

Returns:
Ldap attribute ids for "cheap" attributes.

isCheapLdapAttrId

public boolean isCheapLdapAttrId(String attrId)

isConnectorFilterableLdapAttrId

public boolean isConnectorFilterableLdapAttrId(String ldapAttrId)

getNonConnectorFilterableLdapAttrIds

public Set<String> getNonConnectorFilterableLdapAttrIds()

splitCheapLdapAttrNames

public String[][] splitCheapLdapAttrNames(String[] attrIds)
Returns:
null if all provided attrIds are cheap and otherwise a String[2][] containing the cheap attribute names first and the expensive ones second.

getNonAssocConnectorAttrIds

public String[] getNonAssocConnectorAttrIds()
All attributes which aren't calculated from assocations. Even those that are "expensive" or write only.

Returns:
Ids for non-association attributes.

getCheapConnectorAttrIds

public String[] getCheapConnectorAttrIds()
By default all attribute whose values aren't calculated from associations are considered "cheap". If there are other "expensive" attributes they need to be flagged as so using the MetaDataDefs.MD_IS_EXPENSIVE metadata property.

Returns:
Ids for "cheap" attributes.

isCheapConnectorAttrId

public boolean isCheapConnectorAttrId(String connAttrId)

splitVirtualConnectorAttrIds

public String[][] splitVirtualConnectorAttrIds(String[] connAttrIds)
Returns:
null if all provided attrIds are non-virtual and otherwise a String[2][] containing the virtual attribute names in [0][] and the non-virtaul ones in [1][].

splitCheapConnectorAttrIds

public String[][] splitCheapConnectorAttrIds(String[] connAttrIds)
Returns:
null if all provided attrIds are cheap and otherwise a String[2][] containing the cheap attribute names in [0][] and the expensive ones in [1][].

getPropertyValidators

public PropertyValidators getPropertyValidators(DataModelProperty prop)

putPropertyValidators

public void putPropertyValidators(DataModelProperty prop,
                                  PropertyValidators validators)

getClassValidators

public List<ContextAwareClassValidator> getClassValidators()
Returns:
List[ClassValidator].

addClassValidator

public void addClassValidator(ContextAwareClassValidator classValidator)

getPropertyConverters

public PropertyConverters getPropertyConverters(DataModelProperty prop)

putPropertyConverters

public void putPropertyConverters(DataModelProperty prop,
                                  PropertyConverters converters)

getClassConverters

public List<ClassConverter> getClassConverters()
Returns:
List[ClassConverter].

getClassConverters

public List<ClassConverter> getClassConverters(boolean toConnector)
Returns:
List[ClassConverter].

setClassConverters

public void setClassConverters(List<ClassConverter> classConverters)

applyClassConverters

public void applyClassConverters(Attributes attrs,
                                 boolean toConnector,
                                 boolean structuralOnly)
                          throws NamingException
Throws:
NamingException

applyClassConverters

public ModificationItem[] applyClassConverters(ModificationItem[] modItems,
                                               boolean toConnector)
                                        throws NamingException
Throws:
NamingException

flatten

public boolean flatten(DataModelProperty prop,
                       Attribute unflattenedConnAttr)
                throws NamingException
Flatten unflattenedConnAttr if required.

Parameters:
unflattenedConnAttr - Attribute to possibly be unflattened.
Returns:
True if flattening was required.
Throws:
NamingException

flatten

public boolean flatten(Attribute connAttr)
                throws NamingException
Flatten connAttr if required. Note that the flattener is always called if registered and it is up to it to handle null / connAttr with single entry cases as it sees fit (for instance XMLMultiValueFlattener doesn't wrap null or single elements lists but StringArrayPropertyConverter needs to treat even null as a zero-length array). Note that the meaning of "Flatten" has been expanded, which includes convertion from attributes values to a single String[]. Similarly "UnFlatten" includes convertion from the single String[] to attributes values.

Parameters:
connAttr - Attribute to possibly be flattened.
Returns:
True if flattening was required.
Throws:
NamingException

flatten

public boolean flatten(Attributes connAttrs)
                throws NamingException
Flatten any contained attributes which require it, and return true if any such attributes were infact converted.

Parameters:
connAttrs - Attributes to possibly be flattened.
Returns:
True if any unflattening was required.
Throws:
NamingException

unflatten

public Attribute unflatten(DataModelProperty prop,
                           String value)
                    throws NamingException
Return results of unflattening the provided value, or return null if it isn't configured to be flattened.

Throws:
NamingException

unflatten

public boolean unflatten(DataModelProperty prop,
                         Attribute flattenedConnAttr)
                  throws NamingException
Unflatten flattenedConnAttr if required for the provided attribute (even if its value is null) by looking at converters associated with prop independent of the number of values in flattenedConnAttr.

Parameters:
flattenedConnAttr - Attribute to possibly be unflattened.
Returns:
True if unflattening is ever required for this property.
Throws:
NamingException

unflatten

public boolean unflatten(Attribute connAttr)
                  throws NamingException
Unflatten connAttr if required. Use unflatten(DataModelProperty, Attribute) in preference if values in connAttr may increase after unflattening.

Parameters:
connAttr - Attribute to possibly be unflattened.
Returns:
True if unflattening was required.
Throws:
NamingException

unflatten

public boolean unflatten(Attributes connAttrs)
                  throws NamingException
Unflatten any contained attributes which are flattened, and return true if any such attributes were infact converted.

Parameters:
connAttrs - Attributes to possibly be unflattened.
Returns:
True if any unflattening was required.
Throws:
NamingException

getObjectClassFromAmbiguousConnAttr

public String[] getObjectClassFromAmbiguousConnAttr(ObjectClassMapping.AmbiguousPropInfo ambiguousPropInfo,
                                                    String connAttrId)
Retrieve all objectClasses from an ambiguous property mapping given its connector speak attribute

Parameters:
ambiguousPropInfo - Ambiguous property object
connAttrId - Name of the connector speak attribute for which the objectClasses are retrieved or null for all attributes in this property.
Returns:
Array of objectClasses.

getObjectClassFromConnAttr

public String[] getObjectClassFromConnAttr(String connAttrId)
Return objectClass values to which a connector speak attribute is mapped to either via ambiguous mappings or not.

Parameters:
connAttrId - Connector speak attribute for which the objectClass is determined
Returns:
objectClass value

getObjectClassFromAmbiguousConnAttr

public String[] getObjectClassFromAmbiguousConnAttr(String connAttrId)
Return connector objectClass values given a classMap and an ambiguous connector speak attribute

Parameters:
connAttrId - One of the ambiguous connector speak attribute values
Returns:
objectClass value corresponding to the ambiguous connector speak attribute

getObjectClassFromLdapAttr

public String[] getObjectClassFromLdapAttr(String ldapAttrId)
Return connector objectClass values given a classMap and an ambiguous ldap speak attribute

Parameters:
ldapAttrId - One of the ambiguous ldap speak attribute values
Returns:
objectClass value corresponding to the ambiguous ldap speak attribute

isMappedClassName

public boolean isMappedClassName(String className)

isKnownClassName

public boolean isKnownClassName(String className)
Mapped or derived from


getPropsToLdapObjectClasses

public Map<String,Set<String>> getPropsToLdapObjectClasses()
Returns:
a map of all properties that can store references to other object classes, along with the set of referred object classes by examining MetaDataDefs.MD_DN_LDAP_OBJECT_CLASS and MetaDataDefs.MD_DN_LDAP_OBJECT_CLASSES

setConnectorSearchContainer

protected boolean setConnectorSearchContainer(String clsSearchContainer)
Set the container DN for this class to be used by searches


isDnConnAttrId

public boolean isDnConnAttrId(String connAttrId)
Returns true if a given connector attribute id corresponds to an attribute that stores DN values


isDnLdapAttrId

public boolean isDnLdapAttrId(String ldapAttrId)
Returns true if a given LDAP attribute id corresponds to an attribute that stores DN values


getDnConnAttrIds

@NotNull
public Collection<String> getDnConnAttrIds(Collection<String> attrIds)
Given a collection of connector-speak attribute Ids return Ids that correspond to DN attributes


setNormalizeConnValueProps

public void setNormalizeConnValueProps(Set<String> normalizeConnValueProps)

getNormalizeConnValueProps

public Set<String> getNormalizeConnValueProps()

isNormalizeLdapAttrId

public boolean isNormalizeLdapAttrId(@NotNull
                                     String ldapAttrId)

getNormalizeMode

@NotNull
public MetaDataDefs.NormalizeConnValue getNormalizeMode(@NotNull
                                                                String ldapAttrId)
Lookup which of normalization modes apply for an attribute identified by ldap-speak id


getNormalizeStyle

@Nullable
public MetaDataDefs.NormalizeConnValueStyle getNormalizeStyle(@NotNull
                                                                       String ldapAttrId)
Lookup normalization style if normalization is done, that applies for an attribute identified by ldap-speak id



Created 2011-07-14 13:27 EST