Package com.evolveum.midpoint.prism.impl
Class PrismReferenceValueImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.PrismValueImpl
com.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
- All Implemented Interfaces:
Freezable,ItemDefinitionTransformer.TransformableValue,MidpointOriginMetadata,PathVisitable,PrismContextSensitive,PrismReferenceValue,PrismValue,Revivable,Visitable,DebugDumpable,ShortDumpable,Serializable
- Author:
- Radovan Semancik
- See Also:
-
Field Summary
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
defaultEquivalenceStrategyFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionPrismReferenceValueImpl(String oid, OriginType type, Objectable source) PrismReferenceValueImpl(String oid, QName targetType) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidapplyDefinition(ItemDefinition definition, boolean force) voidapplyDefinition(PrismReferenceDefinition definition, boolean force) static @NotNull List<Referencable>asReferencables(@NotNull Collection<PrismReferenceValue> values) static @NotNull List<PrismReferenceValue>asReferenceValues(@NotNull Collection<? extends Referencable> referencables) voidcheckConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) clone()Literal clone.cloneComplex(CloneStrategy strategy) Complex clone with different cloning strategies.static booleancontainsOid(Collection<PrismReferenceValue> values, @NotNull String oid) protected voidcopyValues(CloneStrategy strategy, PrismReferenceValueImpl clone) Show the content of the object intended for diagnostics by system administrator.debugDump(int indent) debugDump(int indent, boolean expandObject) booleanequals(PrismReferenceValue other, @NotNull ParameterizedEquivalenceStrategy strategy) booleanequals(PrismValue other, @NotNull ParameterizedEquivalenceStrategy strategy) <IV extends PrismValue,ID extends ItemDefinition<?>>
PartiallyResolvedItem<IV,ID> findPartial(ItemPath path) <I extends Item<?,?>>
IfindReferencedItem(ItemPath path, Class<I> type) Returns object that this reference points to.getOid()OID of the object that this reference refers to (reference target).Class<?>@NotNull ReferencableReturns the statically-typed "real value".Returns cached name of the target object.Returns XSD type of the object that this reference refers to.getTargetTypeCompileTimeClass(PrismContext prismContext) inthashCode(@NotNull ParameterizedEquivalenceStrategy strategy) booleanisEmpty()booleanisRaw()voidrecompute(PrismContext prismContext) voidrevive(PrismContext prismContext) TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)voidsetDescription(String description) voidsetFilter(SearchFilterType filter) voidsetObject(PrismObject object) voidvoidsetReferentialIntegrity(ReferentialIntegrityType referentialIntegrity) voidsetRelation(QName relation) voidsetResolutionTime(EvaluationTimeType resolutionTime) voidsetTargetName(PolyString name) voidsetTargetName(PolyStringType name) voidsetTargetType(QName targetType) voidsetTargetType(QName targetType, boolean allowEmptyNamespace) voidShow the content of the object intended for diagnostics.Returns a version of this value that is canonical, that means it has the minimal form.toString()voidtransformDefinition(ComplexTypeDefinition parentDef, ItemDefinition<?> itemDef, ItemDefinitionTransformer transformation) Methods inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
accept, appendOriginDump, applyDefinition, clearParent, copyValues, diff, diffMatchingRepresentation, diffMatchingRepresentation, equals, equals, getAllItems, getAllValues, getOriginObject, getOriginType, getParent, getParentContainerValue, getPath, getPathComponent, getPrismContext, getRootValue, getTypeName, getUserData, getUserData, getValueMetadata, hashCode, hashCode, hasValueMetadata, isTransient, normalize, performFreeze, recompute, representsSameValue, setOriginObject, setOriginType, setParent, setPrismContext, 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
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.PrismContextSensitive
getPrismContextMethods inherited from interface com.evolveum.midpoint.prism.PrismReferenceValue
determineTargetTypeName, getEffectiveResolutionTimeMethods inherited from interface com.evolveum.midpoint.prism.PrismValue
accept, applyDefinition, clearParent, cloneIfImmutable, diff, equals, getAllItems, getAllValues, getNearestValueOfType, getParent, getParentContainerValue, getPath, getRealValueIfExists, getRealValueOrRawType, getRootObjectable, getRootValue, getTypeName, getUserData, getUserData, getValueMetadata, getValueMetadataAsContainer, hashCode, hasRealClass, hasValueMetadata, isObjectable, isOfType, isTransient, normalize, recompute, representsSameValue, setParent, setPrismContext, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata, valueMetadataMethods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
Constructor Details
-
PrismReferenceValueImpl
public PrismReferenceValueImpl() -
PrismReferenceValueImpl
-
PrismReferenceValueImpl
-
PrismReferenceValueImpl
-
-
Method Details
-
getOid
OID of the object that this reference refers to (reference target). May return null, but the reference is in that case incomplete and unusable.- Specified by:
getOidin interfacePrismReferenceValue- Returns:
- the target oid
-
setOid
- Specified by:
setOidin interfacePrismReferenceValue
-
getObject
Returns object that this reference points to. The object is supposed to be used for caching and optimizations. Only oid and type of the object really matters for the reference. The object is transient. It will NOT be serialized. Therefore the client must expect that the object can disappear when serialization boundary is crossed. The client must expect that the object is null.- Specified by:
getObjectin interfacePrismReferenceValue
-
setObject
- Specified by:
setObjectin interfacePrismReferenceValue
-
getTargetType
Returns XSD type of the object that this reference refers to. It may be used in XPath expressions and similar filters. May return null if the type name is not set.- Specified by:
getTargetTypein interfacePrismReferenceValue- Returns:
- the target type name
-
setTargetType
- Specified by:
setTargetTypein interfacePrismReferenceValue
-
setTargetType
- Specified by:
setTargetTypein interfacePrismReferenceValue- Parameters:
allowEmptyNamespace- This is an ugly hack. See comment in DOMUtil.validateNonEmptyQName.
-
getTargetName
Returns cached name of the target object. This is a ephemeral value. It is usually not stored. It may be computed at object retrieval time or it may not be present at all. This is NOT an authoritative information. Setting it or changing it will not influence the reference meaning. OID is the only authoritative linking mechanism.- Specified by:
getTargetNamein interfacePrismReferenceValue- Returns:
- cached name of the target object.
-
setTargetName
- Specified by:
setTargetNamein interfacePrismReferenceValue
-
setTargetName
- Specified by:
setTargetNamein interfacePrismReferenceValue
-
getTargetTypeCompileTimeClass
- Specified by:
getTargetTypeCompileTimeClassin interfacePrismReferenceValue
-
getTargetTypeCompileTimeClass
- Specified by:
getTargetTypeCompileTimeClassin interfacePrismReferenceValue
-
getRelation
- Specified by:
getRelationin interfacePrismReferenceValue
-
setRelation
- Specified by:
setRelationin interfacePrismReferenceValue
-
relation
- Specified by:
relationin interfacePrismReferenceValue
-
getDescription
- Specified by:
getDescriptionin interfacePrismReferenceValue
-
setDescription
- Specified by:
setDescriptionin interfacePrismReferenceValue
-
getFilter
- Specified by:
getFilterin interfacePrismReferenceValue
-
setFilter
- Specified by:
setFilterin interfacePrismReferenceValue
-
getResolutionTime
- Specified by:
getResolutionTimein interfacePrismReferenceValue
-
setResolutionTime
- Specified by:
setResolutionTimein interfacePrismReferenceValue
-
getReferentialIntegrity
- Specified by:
getReferentialIntegrityin interfacePrismReferenceValue
-
setReferentialIntegrity
- Specified by:
setReferentialIntegrityin interfacePrismReferenceValue
-
getDefinition
- Specified by:
getDefinitionin interfacePrismReferenceValue- Overrides:
getDefinitionin classPrismValueImpl
-
isRaw
public boolean isRaw()- Specified by:
isRawin interfacePrismValue
-
find
- Specified by:
findin interfacePrismValue
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path) - Specified by:
findPartialin interfacePrismReferenceValue
-
applyDefinition
- Specified by:
applyDefinitionin interfacePrismReferenceValue- Specified by:
applyDefinitionin interfacePrismValue- Overrides:
applyDefinitionin classPrismValueImpl- Throws:
SchemaException
-
applyDefinition
public void applyDefinition(PrismReferenceDefinition definition, boolean force) throws SchemaException - Specified by:
applyDefinitionin interfacePrismReferenceValue- Throws:
SchemaException
-
recompute
- Specified by:
recomputein interfacePrismValue- Specified by:
recomputein classPrismValueImpl
-
checkConsistenceInternal
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) - Specified by:
checkConsistenceInternalin interfacePrismValue- Specified by:
checkConsistenceInternalin classPrismValueImpl
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacePrismValue
-
toCanonical
Returns a version of this value that is canonical, that means it has the minimal form. E.g. it will have only OID and no object.- Specified by:
toCanonicalin interfacePrismReferenceValue
-
equals
public boolean equals(PrismValue other, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy) - Specified by:
equalsin interfacePrismValue- Overrides:
equalsin classPrismValueImpl
-
equals
public boolean equals(PrismReferenceValue other, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy) -
hashCode
- Specified by:
hashCodein interfacePrismValue- Overrides:
hashCodein classPrismValueImpl
-
toString
-
asReferencable
- Specified by:
asReferencablein interfacePrismReferenceValue
-
asReferencables
@NotNull public static @NotNull List<Referencable> asReferencables(@NotNull @NotNull Collection<PrismReferenceValue> values) -
asReferenceValues
@NotNull public static @NotNull List<PrismReferenceValue> asReferenceValues(@NotNull @NotNull Collection<? extends Referencable> referencables) -
debugDump
Description copied from interface:DebugDumpableShow the content of the object intended for diagnostics by system administrator. The out put should be suitable to use in system logs at "debug" level. It may be multi-line, but in that case it should be well indented and quite terse. As it is intended to be used by system administrator, it should not use any developer terms such as class names, exceptions or stack traces.- Specified by:
debugDumpin interfaceDebugDumpable- Returns:
- content of the object intended for diagnostics by system administrator.
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable
-
debugDump
- Specified by:
debugDumpin interfacePrismReferenceValue
-
clone
Description copied from class:PrismValueImplLiteral clone.- Specified by:
clonein interfacePrismReferenceValue- Specified by:
clonein interfacePrismValue- Specified by:
clonein classPrismValueImpl
-
createImmutableClone
- Specified by:
createImmutableClonein interfacePrismReferenceValue- Specified by:
createImmutableClonein interfacePrismValue- Overrides:
createImmutableClonein classPrismValueImpl
-
cloneComplex
Description copied from class:PrismValueImplComplex clone with different cloning strategies.- Specified by:
cloneComplexin interfacePrismReferenceValue- Specified by:
cloneComplexin interfacePrismValue- Specified by:
cloneComplexin classPrismValueImpl- See Also:
-
copyValues
-
toHumanReadableString
- Specified by:
toHumanReadableStringin interfacePrismValue- Specified by:
toHumanReadableStringin classPrismValueImpl
-
getRealClass
- Specified by:
getRealClassin interfacePrismReferenceValue- Specified by:
getRealClassin interfacePrismValue- Specified by:
getRealClassin classPrismValueImpl
-
getRealValue
Description copied from interface:PrismValueReturns the statically-typed "real value". TODO specify when exactly the returned value can be null. TODO decide for containers: they throw an exception if the value is not statically typed.- Specified by:
getRealValuein interfacePrismReferenceValue- Specified by:
getRealValuein interfacePrismValue- Specified by:
getRealValuein classPrismValueImpl
-
containsOid
public static boolean containsOid(Collection<PrismReferenceValue> values, @NotNull @NotNull String oid) -
revive
Description copied from interface:RevivableTODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)- Specified by:
revivein interfaceRevivable- Overrides:
revivein classPrismValueImpl
-
shortDump
Description copied from interface:ShortDumpableShow the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDumpin interfaceShortDumpable- Parameters:
sb- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
accept
- Specified by:
acceptin interfacePrismValue- Specified by:
acceptin interfaceVisitable- Overrides:
acceptin classPrismValueImpl
-
transformDefinition
public void transformDefinition(ComplexTypeDefinition parentDef, ItemDefinition<?> itemDef, ItemDefinitionTransformer transformation) - Specified by:
transformDefinitionin interfaceItemDefinitionTransformer.TransformableValue
-
findReferencedItem
- Specified by:
findReferencedItemin interfacePrismReferenceValue
-