|
||||||||||
| PREV CLASS NEXT CLASS | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ca.jcs.ObjectClassMapping
com.ca.jcs.meta.MetaObjectClassMapping
public class MetaObjectClassMapping
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.SpecialRole |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
MetaObjectClassMapping(DataModelClass cls,
boolean caseSensitive,
Boolean indirectAssociations,
List<String> acceptedUnknownAttrIds)
|
|
| 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)
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)
|
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()
|
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)
|
HashSet<String> |
getReadOnlyConnectorAttrIdSet()
|
HashSet<String> |
getWriteOnlyConnectorAttrIdSet()
|
boolean |
isCheapConnectorAttrId(String connAttrId)
|
boolean |
isCheapLdapAttrId(String attrId)
|
boolean |
isConnectorFilterableLdapAttrId(String ldapAttrId)
|
boolean |
isKnownClassName(String className)
Mapped or derived from |
boolean |
isMappedClassName(String className)
|
boolean |
isReadOnlyConnectorAttrId(String connAttrId)
|
boolean |
isWriteOnlyConnectorAttrId(String connAttrId)
|
void |
putPropertyConverters(DataModelProperty prop,
PropertyConverters converters)
|
void |
putPropertyValidators(DataModelProperty prop,
PropertyValidators validators)
|
void |
setClassConverters(List<ClassConverter> classConverters)
|
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 |
setParent(MetaObjectClassMappings parent)
|
String[][] |
splitCheapConnectorAttrIds(String[] connAttrIds)
|
String[][] |
splitCheapLdapAttrNames(String[] attrIds)
|
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 java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MetaObjectClassMapping(DataModelClass cls,
boolean caseSensitive,
Boolean indirectAssociations,
List<String> acceptedUnknownAttrIds)
| Method Detail |
|---|
public MetaObjectClassMappings getParent()
public void setParent(MetaObjectClassMappings parent)
public boolean getHasConnectorDependantConverter()
ConnectorDependantAttributeConverter.
public void setHasConnectorDependantConverter(boolean hasConnectorDependantConverter)
public void setDefaults(Attributes attrs)
public DataModelClass getDataModelClass()
public DataModelProperty getDataModelProperty(String name)
public boolean isReadOnlyConnectorAttrId(String connAttrId)
public HashSet<String> getReadOnlyConnectorAttrIdSet()
public boolean isWriteOnlyConnectorAttrId(String connAttrId)
public HashSet<String> getWriteOnlyConnectorAttrIdSet()
public String getConnectorAttrId(String ldapAttrId)
getConnectorAttrId in class ObjectClassMapping
public boolean getConnectorBoolMetaDataValue(String connAttrId,
String mdPropName,
boolean defaultValue)
mdPropName
for the datamodel property associated with attribute
connAttrId (which is the connector-speak version of the
attribute name).
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.
defaultValue if it is not defined.
public String getConnectorStringMetaDataValue(String connAttrId,
String mdPropName)
mdPropName
for the datamodel property associated with attribute
connAttrId (which is the connector-speak version of the
attribute name).
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.
public DataModelProperty getConnectorProperty(String connAttrId)
connAttrId (which is the connector-speak version of the
attribute name).
connAttrId - Connector-speak version of the attribute name,
which denotes a datamodel property.
public DataModelProperty getConnectorMetaDataProperty(String connAttrId,
String mdPropName)
mdPropName on the datamodel property associated with attribute
connAttrId (which is the connector-speak version of the
attribute name).
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.
public DataModelValue getConnectorMetaDataValue(String connAttrId,
String mdPropName)
mdPropName
for the datamodel property associated with attribute
connAttrId (which is the connector-speak version of the
attribute name).
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.
public String getConnectorAliasFromAttrId(String ldapAttrId)
ldapAttrId - Attribute to be looked up.
public String[] getConnectorAttrIds(boolean includeWriteOnly)
public String[] getConnectorAttrIds(boolean includeWriteOnly,
boolean includeConnSpec)
BaseConnector.CONN_SPEC.public String[] getConnectorAttrIds()
getConnectorAttrIds in class ObjectClassMappingpublic String[] getNonAssocLdapAttrIds()
public String[] getCheapLdapAttrIds()
MetaDataDefs.MD_IS_EXPENSIVE metadata property.
public boolean isCheapLdapAttrId(String attrId)
public boolean isConnectorFilterableLdapAttrId(String ldapAttrId)
public Set<String> getNonConnectorFilterableLdapAttrIds()
public String[][] splitCheapLdapAttrNames(String[] attrIds)
attrIds are cheap and
otherwise a String[2][] containing the cheap attribute names first and
the expensive ones second.public String[] getNonAssocConnectorAttrIds()
public String[] getCheapConnectorAttrIds()
MetaDataDefs.MD_IS_EXPENSIVE metadata property.
public boolean isCheapConnectorAttrId(String connAttrId)
public String[][] splitCheapConnectorAttrIds(String[] connAttrIds)
attrIds are cheap and
otherwise a String[2][] containing the cheap attribute names in [0][] and
the expensive ones in [1][].public PropertyValidators getPropertyValidators(DataModelProperty prop)
public void putPropertyValidators(DataModelProperty prop,
PropertyValidators validators)
public List<ContextAwareClassValidator> getClassValidators()
ClassValidator].public void addClassValidator(ContextAwareClassValidator classValidator)
public PropertyConverters getPropertyConverters(DataModelProperty prop)
public void putPropertyConverters(DataModelProperty prop,
PropertyConverters converters)
public List<ClassConverter> getClassConverters()
ClassConverter].public List<ClassConverter> getClassConverters(boolean toConnector)
ClassConverter].public void setClassConverters(List<ClassConverter> classConverters)
public void applyClassConverters(Attributes attrs,
boolean toConnector,
boolean structuralOnly)
throws NamingException
NamingException
public ModificationItem[] applyClassConverters(ModificationItem[] modItems,
boolean toConnector)
throws NamingException
NamingException
public boolean flatten(DataModelProperty prop,
Attribute unflattenedConnAttr)
throws NamingException
unflattenedConnAttr if required.
unflattenedConnAttr - Attribute to possibly be unflattened.
NamingException
public boolean flatten(Attribute connAttr)
throws NamingException
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.
connAttr - Attribute to possibly be flattened.
NamingException
public boolean flatten(Attributes connAttrs)
throws NamingException
connAttrs - Attributes to possibly be flattened.
NamingException
public Attribute unflatten(DataModelProperty prop,
String value)
throws NamingException
NamingException
public boolean unflatten(DataModelProperty prop,
Attribute flattenedConnAttr)
throws NamingException
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.
flattenedConnAttr - Attribute to possibly be unflattened.
NamingException
public boolean unflatten(Attribute connAttr)
throws NamingException
connAttr if required. Use unflatten(DataModelProperty, Attribute) in
preference if values in connAttr may increase after unflattening.
connAttr - Attribute to possibly be unflattened.
NamingException
public boolean unflatten(Attributes connAttrs)
throws NamingException
connAttrs - Attributes to possibly be unflattened.
NamingException
public String[] getObjectClassFromAmbiguousConnAttr(ObjectClassMapping.AmbiguousPropInfo ambiguousPropInfo,
String connAttrId)
ambiguousPropInfo - Ambiguous property objectconnAttrId - Name of the connector speak attribute for which the objectClasses are
retrieved or null for all attributes in this property.
public String[] getObjectClassFromConnAttr(String connAttrId)
connAttrId - Connector speak attribute for which the objectClass is determined
public String[] getObjectClassFromAmbiguousConnAttr(String connAttrId)
connAttrId - One of the ambiguous connector speak attribute values
public String[] getObjectClassFromLdapAttr(String ldapAttrId)
ldapAttrId - One of the ambiguous ldap speak attribute values
public boolean isMappedClassName(String className)
public boolean isKnownClassName(String className)
|
||||||||||
| PREV CLASS NEXT CLASS | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||