Class AttributeMetaData
java.lang.Object
de.aristaflow.adept2.core.orgmodelmanager.AttributeMetaData
- All Implemented Interfaces:
Serializable,Iterable<AttributeMetaData.MetaDataElement>
- Direct Known Subclasses:
OmeAttributeMetaData
public class AttributeMetaData
extends Object
implements Iterable<AttributeMetaData.MetaDataElement>, Serializable
AttributeMetaData is a simple immutable container class for
AttributeMetaData.MetaDataElement-objects, supposed to conveniently hold all available
meta information about the attributes of one entity type.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUsed to hold information about a single attribute. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,Collection<String>> The attribute names (all lower case) and the (names of the) corresponding source OM extension ordered by their priority.protected Collection<String>The (name of the) OM extensions that either have a mapping or a UID column and thus can be a source for (attribute values of) entities of this entity type.protected Map<String,Collection<String>> The (name of the) OM extensions being mapped to the corresponding attributes (attribute names, all lower case) which have the OM extension as source.The UID attributes (all lower case) indexed by the corresponding OM extension names.protected Collection<String>The source OM extensions attributes (all lower case). -
Constructor Summary
ConstructorsConstructorDescriptionAttributeMetaData(AttributeMetaData.MetaDataElement[] metaDataElements) Constructs a newAttributeMetaData-object containing the givenAttributeMetaData.MetaDataElements. -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Returns theAttributeMetaData.MetaDataElementat the given index.Returns theAttributeMetaData.MetaDataElementfor the given attribute name ornullif none is contained for this attribute name.Gets the attribute names (all lower case) and the (names of the) corresponding source OM extension ordered by their priority.intgetCount()Gets the amount ofAttributeMetaData.MetaDataElements held by this container (without the OM extension-specific attributes).intgetCount(boolean includeOmExtAttributes) Gets the amount ofAttributeMetaData.MetaDataElements held by this container, optionally including the OM extension-specific attributes (hidden source and enabled attributes of all OM extensions for which a mapping exists).Gets the (name of the) OM extensions that either have a mapping or a UID column.getMetaDataElementFor(String combAttrName) Gets theMetaDataElementfor the entity type of this attribute meta data and the designated attribute name if it refers to an attribute of this attribute meta data.getMetaDataEnabledAttr(EntityType entType, String ome) Gets theMetaDataElementfor the enabled attribute for the designated entity type and the designated OM extension.getMetaDataSourceAttr(EntityType entType, String attrName) Gets theMetaDataElementfor the attribute containing the source OM extension name for the designated entity type and attribute name.String[]getNames()Gets the names of all attributes in a new array (without the OM extension-specific attributes).String[]getNames(boolean includeOmExtAttributes) Deprecated, for removal: This API element is subject to removal in a future version.String[]getNames(Collection<String> ommKnownOmes) Gets the names of all attributes in a new array, optionally including the OM extension-specific attributes (hidden source and enabled attributes for the designated extensions).Gets the (name of the) OM extensions being mapped to the corresponding attributes (attribute names, all lower case) which have the OM extension as source.Gets the (name of the) OM extensions being mapped to the corresponding UID attributes (attribute names, all lower case).Gets the attributes specifying the OM extensions currently providing the value of the corresponding attribute (all lower case).iterator()toArray()Returns an array containing allAttributeMetaData.MetaDataElements.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
attr2OmExts
The attribute names (all lower case) and the (names of the) corresponding source OM extension ordered by their priority. -
omExt2Attrs
The (name of the) OM extensions being mapped to the corresponding attributes (attribute names, all lower case) which have the OM extension as source. -
omExt2Uid
The UID attributes (all lower case) indexed by the corresponding OM extension names. -
knownOmExts
The (name of the) OM extensions that either have a mapping or a UID column and thus can be a source for (attribute values of) entities of this entity type.
This isomExt2Attrs.keySet() unified withomExt2Uid.keySet(). -
srcAttrs
The source OM extensions attributes (all lower case).
-
-
Constructor Details
-
AttributeMetaData
Constructs a newAttributeMetaData-object containing the givenAttributeMetaData.MetaDataElements.- Parameters:
metaDataElements- theAttributeMetaData.MetaDataElements this container should hold
-
-
Method Details
-
getNames
Gets the names of all attributes in a new array (without the OM extension-specific attributes).- Returns:
- The names of all attributes in a new array (without the OM extension-specific attributes).
-
getNames
@Deprecated(since="14.0.0", forRemoval=true) public String[] getNames(boolean includeOmExtAttributes) Deprecated, for removal: This API element is subject to removal in a future version.UsegetNames(Collection)instead.Gets the names of all attributes in a new array, optionally including the OM extension-specific attributes (hidden source and enabled attributes).- Parameters:
includeOmExtAttributes- whether to include OM extension-specific attributes (hidden source and enabled attributes).- Returns:
- The names of all attributes in a new array, optionally including the OM extension-specific attributes (hidden source and enabled attributes).
-
getNames
Gets the names of all attributes in a new array, optionally including the OM extension-specific attributes (hidden source and enabled attributes for the designated extensions).
The designated collection restricts the attribute names to the OM extensions known by the OMM. This meta data may know more OM extensions (there may be mappings for OM extensions which are not loaded by the OMM).- Parameters:
ommKnownOmes- If this is notnull, OM extension-specific attributes will be included, which are all hidden source attributes and the enabled attributes of this OM extensions.- Returns:
- The names of all attributes in a new array, optionally including the OM extension-specific attributes (hidden source and the enabled attributes of the designated OM extensions).
-
getCount
public int getCount()Gets the amount ofAttributeMetaData.MetaDataElements held by this container (without the OM extension-specific attributes).- Returns:
- The amount of
AttributeMetaData.MetaDataElements held by this container (without the OM extension-specific attributes).
-
getCount
public int getCount(boolean includeOmExtAttributes) Gets the amount ofAttributeMetaData.MetaDataElements held by this container, optionally including the OM extension-specific attributes (hidden source and enabled attributes of all OM extensions for which a mapping exists).- Parameters:
includeOmExtAttributes- Whether to include OM extension-specific attributes (hidden source and enabled attributes).- Returns:
- The amount of
AttributeMetaData.MetaDataElements held by this container, optionally including the OM extension-specific attributes (hidden source and enabled attributes).
-
get
Returns theAttributeMetaData.MetaDataElementat the given index.- Parameters:
index- the index for which theAttributeMetaData.MetaDataElementshould be returned- Returns:
- the
AttributeMetaData.MetaDataElementat the given index
-
get
Returns theAttributeMetaData.MetaDataElementfor the given attribute name ornullif none is contained for this attribute name.- Parameters:
attrName- the attribute name for which theAttributeMetaData.MetaDataElementshould be returned- Returns:
- the
AttributeMetaData.MetaDataElementfor the given attribute name ornullif none is contained for this attribute name
-
toArray
Returns an array containing allAttributeMetaData.MetaDataElements.- Returns:
- an array containing all
AttributeMetaData.MetaDataElements
-
getAttrsMappedToOmExts
Gets the attribute names (all lower case) and the (names of the) corresponding source OM extension ordered by their priority. Attributes without an OM extension mapping will not be in the map.- Returns:
- The attribute names (all lower case) and the (names of the) corresponding source OM extension ordered by their priority or an empty map.
-
getOmExtsMappingAttrs
Gets the (name of the) OM extensions being mapped to the corresponding attributes (attribute names, all lower case) which have the OM extension as source. If there is no mapping for the entity, the map will be empty.- Returns:
- The (name of the) OM extensions being mapped to the corresponding attributes (attribute names, all lower case) which have the OM extension as source.
-
getOmExtUidAttrs
Gets the (name of the) OM extensions being mapped to the corresponding UID attributes (attribute names, all lower case). An entity having a UID attribute for an OM extension indicates that the entity is being synchronised via the OM extension. Such entities may be automatically created and do not need attributes stemming from the corresponding OM extension.- Returns:
- The (name of the) OM extensions being mapped to the corresponding UID attributes (attribute names, all lower case).
-
getKnownOmExts
Gets the (name of the) OM extensions that either have a mapping or a UID column. These OM extension can be a source for (attribute values of) entities of this entity type.
This is the union of the key sets ofgetOmExtsMappingAttrs()andgetOmExtUidAttrs().- Returns:
- The (name of the) OM extensions that either have a mapping or a UID column and thus can be a source for (attribute values of) entities of this entity type.
-
getSrcAttrs
Gets the attributes specifying the OM extensions currently providing the value of the corresponding attribute (all lower case). These source attributes are not part of the normal meta data.- Returns:
- The (name of the) attribute specifying the OM extensions currently providing the value of the corresponding attribute.
-
iterator
- Specified by:
iteratorin interfaceIterable<AttributeMetaData.MetaDataElement>
-
getMetaDataElementFor
Gets theMetaDataElementfor the entity type of this attribute meta data and the designated attribute name if it refers to an attribute of this attribute meta data. This is eithergetMetaDataEnabledAttr(EntityType, String)for the enabled attribute of a specific OM extension (which has to be known) orgetMetaDataSourceAttr(EntityType, String)for the OM extension source attribute of a specific (known) attribute. The designated attribute name has to be a combined attribute name either for an OM extension specific enabled attribute or OM extension source attribute for another attribute. If this is a different name or the OM extension name or the attribute are not known,nullwill be returned.- Parameters:
combAttrName- The combined attribute name either referring to an OM extension specific enabled attribute of a known OM extension or a source OM extension attribute of a known attribute.- Returns:
- The
MetaDataElementfor the designated combined attribute name of a known OM extension or a known attribute ornullif the name is no appropriate combined attribute name.
-
getMetaDataEnabledAttr
public static AttributeMetaData.MetaDataElement getMetaDataEnabledAttr(EntityType entType, String ome) Gets theMetaDataElementfor the enabled attribute for the designated entity type and the designated OM extension. This is separate since the corresponding meta data does not contain the corresponding meta data element but just one for the global#ENTITY_ENABLEDattribute.- Parameters:
entType- The entity type for which to get the meta data for the OM extension-specific#ENTITY_ENABLEDattribute.ome- The name of the OM extension for which to get the meta data for the#ENTITY_ENABLEDattribute.- Returns:
- The
MetaDataElementfor the enabled attribute for the designated entity type and the designated OM extension.
-
getMetaDataSourceAttr
public static AttributeMetaData.MetaDataElement getMetaDataSourceAttr(EntityType entType, String attrName) Gets theMetaDataElementfor the attribute containing the source OM extension name for the designated entity type and attribute name. This is separate since the corresponding meta data does not contain the corresponding meta data element OM extension source attributes.
If the designated attribute is not valid for an attribute with OM extension mapping, e. g. UID or enabled,nullwill be returned.- Parameters:
entType- The entity type for which to get the meta data of the source OM extension attribute.attrName- The name of the attribute for which to get the meta data for the attribute containing the OM extension name that is the current source for the value of the designated attribute.- Returns:
- The
MetaDataElementfor the OM extension source attribute for the designated entity type and the designated attribute name. This will benullif the designated attribute is not a valid for an OM extension mapping, e. g. UID or enabled.
-
getNames(Collection)instead.