|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| 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.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
|
| 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 java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String UNMAPPED_AMBIGUOUS_PROP_MSG
public static final String EMPTY_PROP_NAME_MSG
public static final String MULTIPLE_NAMING_ATTRS_MSG
public static final String AMBIGUOUS_CHOICE_UNAMBIGUOUS_MAPPING_MSG
public static final String PROP_FOR_UNMAPPED_CLASS_MSG
public static final String SPECIAL_CONNECTOR_ATTRIBUTE_IS_QUERY_ONLY
public static final String NAMING_ATTR_MUST_CONN_FILTERABLE
protected Set<String> normalizeConnValueProps
| Constructor Detail |
|---|
@Deprecated
public MetaObjectClassMapping(DataModelClass cls,
boolean caseSensitive,
Boolean indirectAssociations,
List<String> acceptedUnknownAttrIds)
public MetaObjectClassMapping(DataModelClass cls,
boolean caseSensitive,
boolean allowNonFilterableNamingAttr,
Boolean indirectAssociations,
List<String> acceptedUnknownAttrIds,
MetaConnectorType connType)
public MetaObjectClassMapping(String className,
String namingAttrId,
boolean caseSensitive)
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 |
|---|
public MetaObjectClassMappings getParent()
public void setParent(MetaObjectClassMappings parent)
public boolean getHasConnectorDependantConverter()
ConnectorDependantAttributeConverter.
public void setHasConnectorDependantConverter(boolean hasConnectorDependantConverter)
public boolean isTransactionsEnabled()
public void setTransactionsEnabled(Boolean transactionsEnabled)
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,
boolean strict)
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).
public String getConnectorAttrId(String ldapAttrId)
getConnectorAttrId(String, boolean) with strict=true.
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[][] splitVirtualConnectorAttrIds(String[] connAttrIds)
attrIds are non-virtual and
otherwise a String[2][] containing the virtual attribute names in [0][] and
the non-virtaul ones in [1][].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)
public Map<String,Set<String>> getPropsToLdapObjectClasses()
MetaDataDefs.MD_DN_LDAP_OBJECT_CLASS and MetaDataDefs.MD_DN_LDAP_OBJECT_CLASSESprotected boolean setConnectorSearchContainer(String clsSearchContainer)
public boolean isDnConnAttrId(String connAttrId)
public boolean isDnLdapAttrId(String ldapAttrId)
@NotNull public Collection<String> getDnConnAttrIds(Collection<String> attrIds)
public void setNormalizeConnValueProps(Set<String> normalizeConnValueProps)
public Set<String> getNormalizeConnValueProps()
public boolean isNormalizeLdapAttrId(@NotNull
String ldapAttrId)
@NotNull
public MetaDataDefs.NormalizeConnValue getNormalizeMode(@NotNull
String ldapAttrId)
@Nullable
public MetaDataDefs.NormalizeConnValueStyle getNormalizeStyle(@NotNull
String ldapAttrId)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||