Class ResourceAttributeContainerImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.ItemImpl<PrismContainerValue<C>,PrismContainerDefinition<C>>
com.evolveum.midpoint.prism.impl.PrismContainerImpl<ShadowAttributesType>
com.evolveum.midpoint.schema.processor.ResourceAttributeContainerImpl
- All Implemented Interfaces:
Freezable,Item<PrismContainerValue<ShadowAttributesType>,,PrismContainerDefinition<ShadowAttributesType>> Itemable,ItemDefinitionTransformer.TransformableItem,ParentVisitable,PathVisitable,PrismContainer<ShadowAttributesType>,PrismContainerable<ShadowAttributesType>,PrismContextSensitive,Revivable,Visitable,ResourceAttributeContainer,DebugDumpable,Serializable
public final class ResourceAttributeContainerImpl
extends com.evolveum.midpoint.prism.impl.PrismContainerImpl<ShadowAttributesType>
implements ResourceAttributeContainer
TODO review docs
Resource Object.
Resource Object understands resource-specific annotations, such as
identifiers, native object class, etc.
Object class can be determined by using the definition (inherited from
PropertyContainer)
- Author:
- Radovan Semancik
- See Also:
-
Field Summary
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismContainerImpl
compileTimeClassFields inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
definition, elementName, incomplete, parent, valuesFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ResourceAttribute<?> attribute) voidaddAdoptedIfNeeded(@NotNull PrismProperty<?> property) Adds aPrismProperty, converting toResourceAttributeif needed.voidapplyDefinition(PrismContainerDefinition<ShadowAttributesType> definition, boolean force) voidcheckConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) clone()Literal clone.cloneComplex(CloneStrategy strategy) Complex clone with different cloning strategies.<T> booleancontains(ResourceAttribute<T> attr) protected voidcopyValues(CloneStrategy strategy, ResourceAttributeContainerImpl clone) @NotNull Collection<ResourceAttribute<?>>extractAttributesByDefinitions(Collection<? extends ResourceAttributeDefinition> definitions) <X> ResourceAttribute<X>findAttribute(ResourceAttributeDefinition attributeDefinition) Finds a specific attribute in the resource object by definition.<X> ResourceAttribute<X>findAttribute(QName attributeQName) Finds a specific attribute in the resource object by name.<X> ResourceAttribute<X>findOrCreateAttribute(ResourceAttributeDefinition attributeDefinition) <X> ResourceAttribute<X>findOrCreateAttribute(QName attributeName) @NotNull Collection<ResourceAttribute<?>>TODO review docs Returns set of resource object attributes.protected StringReturns applicable definition.TODO review docs Returns description attribute of a resource object.TODO review docs Returns display name attribute of a resource object.TODO review docs Specifies which resource attribute should be used as a "technical" name for the account.TODO review docs Returns the native object class string for the resource object.Returns a (single) primary identifier.TODO review docs Returns primary identifiers.<T> PrismProperty<T>TODO review docs Returns a (single) secondary identifier.TODO review docs Returns secondary identifiers.booleanTODO review docs TODO consider removal Indicates whether definition is should be used as default account type.Methods inherited from class com.evolveum.midpoint.prism.impl.PrismContainerImpl
accept, add, addInternal, addInternalExecution, applyDefinition, assertDefinitions, canRepresent, canRepresent, checkDefinition, containsItem, copyValues, createDelta, createDelta, createImmutableClone, createNewValue, createParentIfNeeded, debugDump, deepCloneDefinition, diff, diff, diffModifications, equivalent, find, findContainer, findContainer, findCreateItem, findCreateItem, findItem, findItem, findItem, findOrCreateContainer, findOrCreateItem, findOrCreateItem, findOrCreateProperty, findOrCreateReference, findPartial, findProperty, findReference, findValue, getAllItems, getAllValues, getCompileTimeClass, getPropertyRealValue, getRealValue, getRealValues, getValue, getValue, hasCompleteDefinition, isEmpty, mergeValue, mergeValues, mergeValues, propagateDeepCloneDefinition, remove, removeContainer, removeItem, removeProperty, removeReference, setContainerRealValue, setDefinition, setPropertyRealValue, setPropertyRealValues, setRealValue, setValue, toString, trim, trimDefinitionTreeMethods inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
accept, acceptParentVisitor, add, addAll, addForced, addIgnoringEquivalents, addRespectingMetadataAndCloning, appendDebugDumpSuffix, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, clear, copyValues, diff, equals, equals, equals, fixupDelta, getElementName, getHighestId, getParent, getPath, getPathComponent, getPrismContext, getPrismContextLocal, getRealValue, getRealValuesArray, getUserData, getUserData, getValues, hashCode, hashCode, hashCode, isIncomplete, merge, normalize, performFreeze, recomputeAllValues, remove, remove, removeAll, removeRespectingMetadata, replace, replaceAll, revive, setElementName, setIncomplete, setParent, setPrismContext, setUserData, transformDefinition, valueRemovedMethods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutableMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutableMethods inherited from interface com.evolveum.midpoint.prism.Item
acceptParentVisitor, add, add, addAll, addAll, addIgnoringEquivalents, addRespectingMetadataAndCloning, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, clear, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, find, findValue, findValue, getAllItems, getAllValues, getAnyValue, getAnyValue, getClonedValues, getDisplayName, getElementName, getHelp, getHighestId, getParent, getPath, getPrismContextLocal, getRealValue, getRealValuesArray, getRealValuesOrRawTypes, getUserData, getUserData, hasAnyValue, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isEmpty, isIncomplete, isOperational, isRaw, isSingleValue, isSingleValueByDefinition, merge, normalize, recomputeAllValues, remove, remove, removeAll, removeIf, removeRespectingMetadata, replace, replaceAll, setElementName, setIncomplete, setParent, setPrismContext, setUserData, size, valuesStreamMethods inherited from interface com.evolveum.midpoint.prism.PrismContainer
accept, add, applyDefinition, canRepresent, canRepresent, containsItem, createDelta, createDelta, createImmutableClone, createNewValue, deepCloneDefinition, diff, diff, diffModifications, equivalent, findContainer, findCreateItem, findCreateItem, findItem, findItem, findItem, findOrCreateContainer, findOrCreateItem, findOrCreateItem, findOrCreateProperty, findOrCreateReference, findPartial, findProperty, findReference, findValue, getCompileTimeClass, getPropertyRealValue, getRealValue, getRealValues, getValue, getValue, getValues, mergeValue, mergeValues, mergeValues, remove, removeContainer, removeItem, removeProperty, removeReference, setContainerRealValue, setDefinition, setPropertyRealValue, setPropertyRealValues, setRealValue, setValue, trim, trimDefinitionTreeMethods inherited from interface com.evolveum.midpoint.prism.PrismContainerable
getComplexTypeDefinitionMethods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContextMethods inherited from interface com.evolveum.midpoint.schema.processor.ResourceAttributeContainer
containsAttribute, getResourceObjectDefinitionRequired
-
Method Details
-
getDefinition
Description copied from interface:ItemReturns applicable definition.May return null if no definition is applicable or the definition is not known.
- Specified by:
getDefinitionin interfaceItem<PrismContainerValue<ShadowAttributesType>,PrismContainerDefinition<ShadowAttributesType>> - Specified by:
getDefinitionin interfaceItemable- Specified by:
getDefinitionin interfacePrismContainer<ShadowAttributesType>- Specified by:
getDefinitionin interfacePrismContainerable<ShadowAttributesType>- Specified by:
getDefinitionin interfaceResourceAttributeContainer- Overrides:
getDefinitionin classcom.evolveum.midpoint.prism.impl.PrismContainerImpl<ShadowAttributesType>- Returns:
- applicable definition
-
getAttributes
Description copied from interface:ResourceAttributeContainerTODO review docs Returns set of resource object attributes. The order of attributes is insignificant. The returned set is imutable! Any change to it will be ignored.- Specified by:
getAttributesin interfaceResourceAttributeContainer- Returns:
- set of resource object attributes.
-
add
- Specified by:
addin interfaceResourceAttributeContainer- Throws:
SchemaException
-
addAdoptedIfNeeded
Description copied from interface:ResourceAttributeContainerAdds aPrismProperty, converting toResourceAttributeif needed. Requires the resource object definition (i.e. complex type definition) be present.- Specified by:
addAdoptedIfNeededin interfaceResourceAttributeContainer- Throws:
SchemaException
-
getPrimaryIdentifier
Description copied from interface:ResourceAttributeContainerReturns a (single) primary identifier. This method returns a property that acts as an (primary) identifier for the resource object. Primary identifiers are used to access the resource objects, retrieve them from resource, identify objects for modifications, etc. Returns null if no identifier is defined. Resource objects may have multiple (composite) identifiers, but this method assumes that there is only a single identifier. The method will throw exception if that assumption is not satisfied.- Specified by:
getPrimaryIdentifierin interfaceResourceAttributeContainer- Returns:
- identifier property
-
getPrimaryIdentifiers
Description copied from interface:ResourceAttributeContainerTODO review docs Returns primary identifiers. This method returns properties that act as (primary) identifiers for the resource object. Primary identifiers are used to access the resource objects, retrieve them from resource, identify objects for modifications, etc. Returns empty set if no identifier is defined. Must not return null. Resource objects may have multiple (composite) identifiers, all of them are returned. The returned set it immutable! Any modifications will be lost.- Specified by:
getPrimaryIdentifiersin interfaceResourceAttributeContainer- Returns:
- set of identifier properties
-
getSecondaryIdentifier
Description copied from interface:ResourceAttributeContainerTODO review docs Returns a (single) secondary identifier. This method returns a property that acts as an secondary identifier for the resource object. Secondary identifiers are used to confirm primary identification of resource object. Returns null if no secondary identifier is defined. Resource objects may have multiple (composite) identifiers, but this method assumes that there is only a single identifier. The method will throw exception if that assumption is not satisfied.- Specified by:
getSecondaryIdentifierin interfaceResourceAttributeContainer- Returns:
- secondary identifier property
-
getSecondaryIdentifiers
Description copied from interface:ResourceAttributeContainerTODO review docs Returns secondary identifiers. This method returns properties that act as secondary identifiers for the resource object. Secondary identifiers are used to confirm primary identification of resource object. Returns empty set if no identifier is defined. Must not return null. Resource objects may have multiple (composite) identifiers, all of them are returned.- Specified by:
getSecondaryIdentifiersin interfaceResourceAttributeContainer- Returns:
- set of secondary identifier properties
-
getAllIdentifiers
- Specified by:
getAllIdentifiersin interfaceResourceAttributeContainer
-
extractAttributesByDefinitions
@NotNull public @NotNull Collection<ResourceAttribute<?>> extractAttributesByDefinitions(Collection<? extends ResourceAttributeDefinition> definitions) - Specified by:
extractAttributesByDefinitionsin interfaceResourceAttributeContainer
-
getDescriptionAttribute
Description copied from interface:ResourceAttributeContainerTODO review docs Returns description attribute of a resource object. Returns null if there is no description attribute or the attribute is not known. The exception should be never thrown unless there is some bug in the code. The validation of model consistency should be done at the time of schema parsing.- Specified by:
getDescriptionAttributein interfaceResourceAttributeContainer- Returns:
- description attribute of a resource object.
-
getNamingAttribute
Description copied from interface:ResourceAttributeContainerTODO review docs Specifies which resource attribute should be used as a "technical" name for the account. This name will appear in log files and other troubleshooting tools. The name should be a form of unique identifier that can be used to locate the resource object for diagnostics. It should not contain white chars and special chars if that can be avoided and it should be reasonable short. It is different from a display name attribute. Display name is intended for a common user or non-technical administrator (such as role administrator). The naming attribute is intended for technical IDM administrators and developers.- Specified by:
getNamingAttributein interfaceResourceAttributeContainer- Returns:
- attribute that should be used as a "technical" name for the account.
-
getDisplayNameAttribute
Description copied from interface:ResourceAttributeContainerTODO review docs Returns display name attribute of a resource object. Returns null if there is no display name attribute or the attribute is not known. The exception should be never thrown unless there is some bug in the code. The validation of model consistency should be done at the time of schema parsing.- Specified by:
getDisplayNameAttributein interfaceResourceAttributeContainer- Returns:
- display name attribute of a resource object.
-
getNativeObjectClass
Description copied from interface:ResourceAttributeContainerTODO review docs Returns the native object class string for the resource object. Native object class is the name of the Resource Object Definition (Object Class) as it is seen by the resource itself. The name of the Resource Object Definition may be constrained by XSD or other syntax and therefore may be "mangled" to conform to such syntax. The native object class value will contain unmangled name (if available). Returns null if there is no native object class or the native object class is not known. The exception should be never thrown unless there is some bug in the code. The validation of model consistency should be done at the time of schema parsing.- Specified by:
getNativeObjectClassin interfaceResourceAttributeContainer- Returns:
- native object class
-
isDefaultInAKind
public boolean isDefaultInAKind()Description copied from interface:ResourceAttributeContainerTODO review docs TODO consider removal Indicates whether definition is should be used as default account type. If true value is returned then the definition should be used as a default account type definition. This is a way how a resource connector may suggest applicable object classes (resource object definitions) for accounts. If no information about account type is present, false should be returned. This method must return true only if isAccountType() returns true. The exception should be never thrown unless there is some bug in the code. The validation of at-most-one value should be done at the time of schema parsing. The exception may not even be thrown at all if the implementation is not able to determine duplicity.- Specified by:
isDefaultInAKindin interfaceResourceAttributeContainer- Returns:
- true if the definition should be used as account type.
-
findAttribute
Description copied from interface:ResourceAttributeContainerFinds a specific attribute in the resource object by name. Returns null if nothing is found.- Specified by:
findAttributein interfaceResourceAttributeContainer- Parameters:
attributeQName- attribute name to find.- Returns:
- found attribute or null
-
findAttribute
Description copied from interface:ResourceAttributeContainerFinds a specific attribute in the resource object by definition. Returns null if nothing is found.- Specified by:
findAttributein interfaceResourceAttributeContainer- Parameters:
attributeDefinition- attribute definition to find.- Returns:
- found attribute or null
-
findOrCreateAttribute
public <X> ResourceAttribute<X> findOrCreateAttribute(ResourceAttributeDefinition attributeDefinition) throws SchemaException - Specified by:
findOrCreateAttributein interfaceResourceAttributeContainer- Throws:
SchemaException
-
findOrCreateAttribute
- Specified by:
findOrCreateAttributein interfaceResourceAttributeContainer- Throws:
SchemaException
-
contains
- Specified by:
containsin interfaceResourceAttributeContainer
-
clone
Description copied from interface:ItemLiteral clone.- Specified by:
clonein interfaceItem<PrismContainerValue<ShadowAttributesType>,PrismContainerDefinition<ShadowAttributesType>> - Specified by:
clonein interfacePrismContainer<ShadowAttributesType>- Specified by:
clonein interfaceResourceAttributeContainer- Overrides:
clonein classcom.evolveum.midpoint.prism.impl.PrismContainerImpl<ShadowAttributesType>
-
cloneComplex
Description copied from interface:ItemComplex clone with different cloning strategies.- Specified by:
cloneComplexin interfaceItem<PrismContainerValue<ShadowAttributesType>,PrismContainerDefinition<ShadowAttributesType>> - Specified by:
cloneComplexin interfacePrismContainer<ShadowAttributesType>- Overrides:
cloneComplexin classcom.evolveum.midpoint.prism.impl.PrismContainerImpl<ShadowAttributesType>- See Also:
-
copyValues
-
checkConsistenceInternal
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) - Specified by:
checkConsistenceInternalin interfaceItem<PrismContainerValue<ShadowAttributesType>,PrismContainerDefinition<ShadowAttributesType>> - Overrides:
checkConsistenceInternalin classcom.evolveum.midpoint.prism.impl.PrismContainerImpl<ShadowAttributesType>
-
applyDefinition
public void applyDefinition(PrismContainerDefinition<ShadowAttributesType> definition, boolean force) throws SchemaException - Specified by:
applyDefinitionin interfaceItem<PrismContainerValue<ShadowAttributesType>,PrismContainerDefinition<ShadowAttributesType>> - Overrides:
applyDefinitionin classcom.evolveum.midpoint.prism.impl.ItemImpl<PrismContainerValue<ShadowAttributesType>,PrismContainerDefinition<ShadowAttributesType>> - Throws:
SchemaException
-
getDebugDumpClassName
- Overrides:
getDebugDumpClassNamein classcom.evolveum.midpoint.prism.impl.PrismContainerImpl<ShadowAttributesType>
-