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,Walkable,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, unqualifiedItemNamesFields inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
defaultEquivalenceStrategyFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanappendExtraHeaderDump(StringBuilder sb, int indent, boolean wasIndent) clone()Literal clone.cloneComplex(@NotNull CloneStrategy strategy) Complex clone with different cloning strategies.protected voidcopyValues(CloneStrategy strategy, ShadowAssociationValue clone) debugDump(int indent) static ShadowAssociationValueempty(@NotNull ShadowAssociationDefinition definition) Creates an empty value.protected booleanequalsItems(PrismContainerValue<ShadowAssociationValueType> other, ParameterizedEquivalenceStrategy strategy) Custom logic of comparing the content of an association value - applies to all equivalence strategies, except for the "more literal" ones.fillFromReferenceAttributeValue(@NotNull ShadowReferenceAttributeValue refAttrValue) Fills-in this value from a (fully resolved)ShadowReferenceAttributeValue.static @NotNull ShadowAssociationValuefromAssociationDataObject(@NotNull AbstractShadow associationObject, @NotNull ShadowAssociationDefinition associationDefinition) Creates a new value from the association object (a shadow).static @NotNull ShadowAssociationValuefromBean(@NotNull ShadowAssociationValueType bean, @NotNull ShadowAssociationDefinition associationDef) Converts association value bean to wrappedShadowAssociationValuebasically by cloning its content and selected properties (e.g., parent and ID).@NotNull AbstractShadowReturns the associated object as anAbstractShadow.@NotNull Collection<ShadowSimpleAttribute<?>>Note that these attributes are always simple.@Nullable ShadowAttributesContainer@NotNull ShadowAttributesContainer@NotNull ShadowAssociationDefinition@NotNull ShadowAssociationDefinition@NotNull Collection<ShadowReferenceAttribute>@Nullable ShadowAttributesContainer@NotNull ShadowAttributesContainer@NotNull ShadowAttributesContainer@Nullable ObjectReferenceType@NotNull ObjectReferenceType@NotNull ShadowReferenceAttributeValue@NotNull AbstractShadowbooleanbooleanmatches(ShadowAssociationValue other) static @NotNull EqualsChecker<ShadowAssociationValue>Returns an equals checker that compares two association values by their meaning.@NotNull ShadowReferenceAttributeValueConverts this value into the low-level representation by a reference attribute.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, idAsProperty, isEmpty, isIdOnly, isRaw, keepPaths, merge, mergeContent, normalize, performFreeze, recompute, remove, removeAll, removeContainer, removeItem, removeItems, removeMetadataFromPaths, removeOperationalItems, removePaths, removeProperty, removeRawElement, removeReference, replace, representsSameValue, revive, setId, setOriginTypeRecursive, setPropertyRealValue, simpleAdd, size, subtract, toHumanReadableString, toPcvList, toString, transformDefinition, walkMethods 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, setValueMetadataMethods 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, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutableMethods inherited from interface com.evolveum.midpoint.prism.metadata.MidpointOriginMetadata
getOriginObject, getOriginType, setOriginObject, setOriginTypeMethods inherited from interface com.evolveum.midpoint.prism.PrismContainerValue
acceptVisitor, checkNothingExceptFor, findItem, getItemRealValue, schemaLookupMethods 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 associationDef) throws SchemaException Converts association value bean to wrappedShadowAssociationValuebasically 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 (a shadow).- Throws:
SchemaException
-
empty
public static ShadowAssociationValue empty(@NotNull @NotNull ShadowAssociationDefinition definition) Creates an empty value. We need the association definition to provide correct CTD. -
clone
Description copied from interface:PrismValueLiteral clone.- Specified by:
clonein interfacePrismContainerValue<ShadowAssociationValueType>- Specified by:
clonein interfacePrismValue- Overrides:
clonein classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-
cloneComplex
Description copied from interface:PrismValueComplex clone with different cloning strategies.- Specified by:
cloneComplexin interfacePrismContainerValue<ShadowAssociationValueType>- Specified by:
cloneComplexin interfacePrismValue- Overrides:
cloneComplexin classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>- See Also:
-
copyValues
-
getDefinition
- Specified by:
getDefinitionin interfacePrismContainerValue<ShadowAssociationValueType>- Overrides:
getDefinitionin classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-
getDefinitionRequired
-
appendExtraHeaderDump
- Overrides:
appendExtraHeaderDumpin classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-
getAttributesContainer
-
getAttributesContainerRequired
-
getAttributes
Note that these attributes are always simple. -
getOrCreateAttributesContainer
-
getObjectsContainer
-
getObjectReferences
-
getOrCreateObjectsContainer
-
getSingleObjectRefRequired
-
getSingleObjectRefRelaxed
-
getSingleObjectRefValueRequired
-
getSingleObjectShadowRequired
-
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
-
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) Custom logic of comparing the content of an association value - applies to all equivalence strategies, except for the "more literal" ones. It is useful e.g. when doing computations in the projector (e.g., IDI->triple conversion, value matching, etc). I am not sure if the current mode selection (literal DOM & operational data) is 100% correct. But it's a good start. We can adapt it when needed.- Overrides:
equalsItemsin classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-
semanticEqualsChecker
Returns an equals checker that compares two association values by their meaning. It takes care of the fact that `icfs:uid` is generated by the connector and its existence/non-existence should pose no difference to the comparison result. Less intuitive fact is that `icfs:name` can be generated for embedded objects as well - this is a work-around to the fact that ConnId requires `icfs:name` to be present on all objects. So the comparison code ignores the presence of `icfs:name` as well. -
matches
-
getActivation
-
getAssociationDataObject
Returns the associated object as anAbstractShadow. Fails if there's none. -
isComplex
public boolean isComplex() -
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable- Overrides:
debugDumpin classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-