Class ShadowAssociationValue
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.PrismValueImpl
com.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
com.evolveum.midpoint.schema.processor.ShadowAssociationValue
- All Implemented Interfaces:
Freezable
,ItemDefinitionTransformer.TransformableValue
,MidpointOriginMetadata
,ParentVisitable
,PathVisitable
,PrismContainerValue<ShadowAssociationValueType>
,PrismValue
,PrismVisitable
,Revivable
,SchemaLookup.Aware
,Visitable
,ShadowLikeValue
,DebugDumpable
,Serializable
@Experimental
public class ShadowAssociationValue
extends com.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
implements ShadowLikeValue
Represents a specific shadow association value - i.e. something that is put into
ShadowReferenceAttribute
.
For example, a single group membership for a given account: `joe` is a member of `admins`.
NOTE: As an experiment, we try to keep instances as consistent as possible. E.g., we require correct `shadowRef` etc.
Any places where this is checked, will throw IllegalStateException
instead of SchemaException
.
We will simply not allow creating a non-compliant association object. At least we'll try to do this.
The exception are situations where the object exists between instantiation and providing the data.
*Instantiation*
In particular, we must provide reasonable CTD when instantiating this object.
Otherwise, PrismContainerValue.asContainerable()
will fail.
TODO check if it's possible to implement this approach regarding createNewValue in ShadowAssociation- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.PrismContainerValue
PrismContainerValue.RemovedItemDefinitionException
-
Field Summary
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismContainerValueImpl
complexTypeDefinition, DIFFERENT_ITEMS_EXCEPTION, items, unqualifiedItemNames
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
defaultEquivalenceStrategy
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
appendExtraHeaderDump
(StringBuilder sb, int indent, boolean wasIndent) clone()
Literal clone.cloneComplex
(CloneStrategy strategy) Complex clone with different cloning strategies.protected void
copyValues
(CloneStrategy strategy, ShadowAssociationValue clone) debugDump
(int indent) static ShadowAssociationValue
empty
(@NotNull ShadowAssociationDefinition definition) We need the definition to provide correct CTD.protected boolean
equalsItems
(PrismContainerValue<ShadowAssociationValueType> other, ParameterizedEquivalenceStrategy strategy) fillFromReferenceAttributeValue
(@NotNull ShadowReferenceAttributeValue refAttrValue) Fills-in this value from a (fully resolved)ShadowReferenceAttributeValue
.static @NotNull ShadowAssociationValue
fromAssociationDataObject
(@NotNull AbstractShadow associationObject, @NotNull ShadowAssociationDefinition associationDefinition) Creates a new value from the association object.static @NotNull ShadowAssociationValue
fromBean
(@NotNull ShadowAssociationValueType bean, @NotNull ShadowAssociationDefinition definition) Converts association value bean to wrappedShadowAssociationValue
basically by cloning its content and selected properties (e.g., parent and ID).@NotNull AbstractShadow
Returns the associated object as anAbstractShadow
.@NotNull Collection<ShadowSimpleAttribute<?>>
Note that these attributes are always simple.@Nullable ShadowAttributesContainer
@NotNull ShadowAttributesContainer
@NotNull ShadowAssociationDefinition
@NotNull Collection<ShadowReferenceAttribute>
@Nullable ShadowAttributesContainer
@NotNull ShadowAttributesContainer
@NotNull ShadowAttributesContainer
@NotNull ShadowAttributesContainer
@Nullable ObjectReferenceType
@NotNull ObjectReferenceType
@NotNull ShadowReferenceAttributeValue
@NotNull ShadowType
@NotNull AbstractShadow
boolean
boolean
boolean
matches
(ShadowAssociationValue other) static @NotNull EqualsChecker<ShadowAssociationValue>
TODO better name@NotNull ShadowReferenceAttributeValue
Converts this value into the low-level representation by a reference attribute.@NotNull ShadowReferenceAttributeValue
Methods inherited from class com.evolveum.midpoint.prism.impl.PrismContainerValueImpl
accept, accept, acceptParentVisitor, add, add, addAll, addAllReplaceExisting, addRawElement, addReplaceExisting, applyDefinition, applyDefinition, applyDefinition, asContainerable, asContainerable, asContainerable, asContainerables, asContainerables, asPrismContainerValues, assertDefinitions, assertDefinitions, asSingleValuedContainer, canRepresent, checkConsistenceInternal, clear, contains, contains, containsItem, containsRealValue, copyValues, createDetachedSubItem, createImmutableClone, createProperty, createProperty, debugDumpIdentifiers, deleteRawElement, detailedDebugDumpStart, diffMatchingRepresentation, equals, equivalent, find, findContainer, findItem, findItem, findOrCreateContainer, findOrCreateItem, findOrCreateItem, findOrCreateItem, findOrCreateProperty, findOrCreateProperty, findOrCreateReference, findPartial, findProperty, findProperty, findReference, getAllItems, getAllValues, getCompileTimeClass, getComplexTypeDefinition, getContainer, getId, getIdentifier, getItemNames, getItems, getItems, getParent, getPath, getPathComponent, getProperties, getPropertyRealValue, getRealClass, getRealValue, getRootValue, getTypeName, getValue, hasCompleteDefinition, hashCode, hasNoItems, isEmpty, isIdOnly, isRaw, keepPaths, merge, mergeContent, normalize, performFreeze, recompute, remove, removeAll, removeContainer, removeItems, removeOperationalItems, removePaths, removeProperty, removeRawElement, removeReference, replace, representsSameValue, revive, setId, setOriginTypeRecursive, setPropertyRealValue, simpleAdd, size, subtract, toHumanReadableString, toPcvList, toString, transformDefinition
Methods inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
appendOriginDump, clearParent, copyValues, diff, diffMatchingRepresentation, equals, equals, getOriginObject, getOriginType, getParentContainerValue, getSchemaContext, getUserData, getUserData, getValueMetadata, getValueMetadataIfExists, hashCode, hashCode, hasValueMetadata, isTransient, recompute, schemaLookup, setOriginObject, setOriginType, setParent, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutable
Methods inherited from interface com.evolveum.midpoint.prism.metadata.MidpointOriginMetadata
getOriginObject, getOriginType, setOriginObject, setOriginType
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainerValue
acceptVisitor, checkNothingExceptFor, findItem, getItemRealValue, schemaLookup
Methods inherited from interface com.evolveum.midpoint.prism.PrismValue
applyDefinitionLegacy, applyDefinitionLegacy, clearParent, cloneIfImmutable, deleteValueMetadata, diff, equals, getNearestValueOfType, getParentContainerValue, getRealValueIfExists, getRealValueOrRawType, getRootObjectable, getSchemaContext, getUserData, getUserData, getValueMetadata, getValueMetadataAsContainer, getValueMetadataIfExists, hashCode, hasRealClass, hasValueMetadata, isObjectable, isOfType, isTransient, recompute, setParent, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata
-
Method Details
-
fromBean
@NotNull public static @NotNull ShadowAssociationValue fromBean(@NotNull @NotNull ShadowAssociationValueType bean, @NotNull @NotNull ShadowAssociationDefinition definition) throws SchemaException Converts association value bean to wrappedShadowAssociationValue
basically by cloning its content and selected properties (e.g., parent and ID). We should not use the original value any more, e.g. because of the copied "parent" value.- Throws:
SchemaException
-
fromAssociationDataObject
@NotNull public static @NotNull ShadowAssociationValue fromAssociationDataObject(@NotNull @NotNull AbstractShadow associationObject, @NotNull @NotNull ShadowAssociationDefinition associationDefinition) throws SchemaException Creates a new value from the association object.- Throws:
SchemaException
-
empty
public static ShadowAssociationValue empty(@NotNull @NotNull ShadowAssociationDefinition definition) We need the definition to provide correct CTD. -
clone
Description copied from interface:PrismValue
Literal clone.- Specified by:
clone
in interfacePrismContainerValue<ShadowAssociationValueType>
- Specified by:
clone
in interfacePrismValue
- Overrides:
clone
in classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-
cloneComplex
Description copied from interface:PrismValue
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfacePrismContainerValue<ShadowAssociationValueType>
- Specified by:
cloneComplex
in interfacePrismValue
- Overrides:
cloneComplex
in classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
- See Also:
-
copyValues
-
getDefinition
- Specified by:
getDefinition
in interfacePrismContainerValue<ShadowAssociationValueType>
- Overrides:
getDefinition
in classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-
getDefinitionRequired
-
appendExtraHeaderDump
- Overrides:
appendExtraHeaderDump
in classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-
getAttributesContainer
-
getAttributesContainerRequired
-
getAttributes
Note that these attributes are always simple. -
getOrCreateAttributesContainer
-
getObjectsContainerRequired
-
getObjectsContainer
-
getObjectReferences
-
getOrCreateObjectsContainer
-
getSingleObjectRefRequired
-
getSingleObjectRefRelaxed
-
getSingleObjectRefValueRequired
-
getSingleObjectShadowRequired
-
getSingleObjectShadowBeanRequired
-
toReferenceAttributeValue
@NotNull public @NotNull ShadowReferenceAttributeValue toReferenceAttributeValue() throws SchemaExceptionConverts this value into the low-level representation by a reference attribute. Returns a free (parent-less) object.- Throws:
SchemaException
-
toReferenceAttributeValueUnchecked
@TestOnly @NotNull public @NotNull ShadowReferenceAttributeValue toReferenceAttributeValueUnchecked() -
fillFromReferenceAttributeValue
public ShadowAssociationValue fillFromReferenceAttributeValue(@NotNull @NotNull ShadowReferenceAttributeValue refAttrValue) throws SchemaException Fills-in this value from a (fully resolved)ShadowReferenceAttributeValue
. This is an inversion oftoReferenceAttributeValue()
.- Throws:
SchemaException
-
equalsItems
protected boolean equalsItems(PrismContainerValue<ShadowAssociationValueType> other, ParameterizedEquivalenceStrategy strategy) - Overrides:
equalsItems
in classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-
semanticEqualsChecker
TODO better name -
matches
-
getActivation
-
getAssociationDataObject
Returns the associated object as anAbstractShadow
. Fails if there's none. -
hasAssociationObject
public boolean hasAssociationObject() -
isInboundMembershipSynchronizationDisabled
public boolean isInboundMembershipSynchronizationDisabled() -
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
- Overrides:
debugDump
in classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-