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
public class PrismReferenceValueImpl extends PrismValueImpl implements PrismReferenceValue
- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
defaultEquivalenceStrategy
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description PrismReferenceValueImpl()PrismReferenceValueImpl(String oid)PrismReferenceValueImpl(String oid, OriginType type, Objectable source)PrismReferenceValueImpl(String oid, QName targetType)
-
Method Summary
-
Methods inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
accept, appendOriginDump, applyDefinition, clearParent, copyValues, diff, diffMatchingRepresentation, diffMatchingRepresentation, equals, equals, 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, 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
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.PrismContextSensitive
getPrismContext
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismValue
accept, applyDefinition, clearParent, diff, equals, getAllValues, getParent, getParentContainerValue, getPath, getRealValueOrRawType, getRootValue, getTypeName, getUserData, getUserData, getValueMetadata, getValueMetadataAsContainer, hashCode, hasRealClass, hasValueMetadata, isTransient, normalize, recompute, representsSameValue, setParent, setPrismContext, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata, valueMetadata
-
Methods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
-
-
-
Constructor Detail
-
PrismReferenceValueImpl
public PrismReferenceValueImpl()
-
PrismReferenceValueImpl
public PrismReferenceValueImpl(String oid)
-
PrismReferenceValueImpl
public PrismReferenceValueImpl(String oid, OriginType type, Objectable source)
-
-
Method Detail
-
getOid
public String 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
public void setOid(String oid)
- Specified by:
setOidin interfacePrismReferenceValue
-
getObject
public PrismObject 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
public void setObject(PrismObject object)
- Specified by:
setObjectin interfacePrismReferenceValue
-
getTargetType
public QName 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
public void setTargetType(QName targetType)
- Specified by:
setTargetTypein interfacePrismReferenceValue
-
setTargetType
public void setTargetType(QName targetType, boolean allowEmptyNamespace)
- Specified by:
setTargetTypein interfacePrismReferenceValue- Parameters:
allowEmptyNamespace- This is an ugly hack. See comment in DOMUtil.validateNonEmptyQName.
-
getTargetName
public PolyString 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
public void setTargetName(PolyString name)
- Specified by:
setTargetNamein interfacePrismReferenceValue
-
setTargetName
public void setTargetName(PolyStringType name)
- Specified by:
setTargetNamein interfacePrismReferenceValue
-
getTargetTypeCompileTimeClass
public Class<Objectable> getTargetTypeCompileTimeClass()
- Specified by:
getTargetTypeCompileTimeClassin interfacePrismReferenceValue
-
getTargetTypeCompileTimeClass
public Class<Objectable> getTargetTypeCompileTimeClass(PrismContext prismContext)
- Specified by:
getTargetTypeCompileTimeClassin interfacePrismReferenceValue
-
getRelation
public QName getRelation()
- Specified by:
getRelationin interfacePrismReferenceValue
-
setRelation
public void setRelation(QName relation)
- Specified by:
setRelationin interfacePrismReferenceValue
-
relation
public PrismReferenceValueImpl relation(QName relation)
- Specified by:
relationin interfacePrismReferenceValue
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfacePrismReferenceValue
-
setDescription
public void setDescription(String description)
- Specified by:
setDescriptionin interfacePrismReferenceValue
-
getFilter
public SearchFilterType getFilter()
- Specified by:
getFilterin interfacePrismReferenceValue
-
setFilter
public void setFilter(SearchFilterType filter)
- Specified by:
setFilterin interfacePrismReferenceValue
-
getResolutionTime
public EvaluationTimeType getResolutionTime()
- Specified by:
getResolutionTimein interfacePrismReferenceValue
-
setResolutionTime
public void setResolutionTime(EvaluationTimeType resolutionTime)
- Specified by:
setResolutionTimein interfacePrismReferenceValue
-
getReferentialIntegrity
public ReferentialIntegrityType getReferentialIntegrity()
- Specified by:
getReferentialIntegrityin interfacePrismReferenceValue
-
setReferentialIntegrity
public void setReferentialIntegrity(ReferentialIntegrityType referentialIntegrity)
- Specified by:
setReferentialIntegrityin interfacePrismReferenceValue
-
getDefinition
public PrismReferenceDefinition getDefinition()
- Specified by:
getDefinitionin interfacePrismReferenceValue- Overrides:
getDefinitionin classPrismValueImpl
-
isRaw
public boolean isRaw()
- Specified by:
isRawin interfacePrismValue
-
find
public Object find(ItemPath path)
- Specified by:
findin interfacePrismValue
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartialin interfacePrismReferenceValue
-
applyDefinition
public void applyDefinition(ItemDefinition definition, boolean force) throws SchemaException
- 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
public void recompute(PrismContext prismContext)
- 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
public PrismReferenceValueImpl 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
public int hashCode(@NotNull @NotNull ParameterizedEquivalenceStrategy strategy)- Specified by:
hashCodein interfacePrismValue- Overrides:
hashCodein classPrismValueImpl
-
asReferencable
public Referencable 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
public String 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
public String debugDump(int indent)
- Specified by:
debugDumpin interfaceDebugDumpable
-
debugDump
public String debugDump(int indent, boolean expandObject)
- Specified by:
debugDumpin interfacePrismReferenceValue
-
clone
public PrismReferenceValueImpl clone()
Description copied from class:PrismValueImplLiteral clone.- Specified by:
clonein interfacePrismReferenceValue- Specified by:
clonein interfacePrismValue- Specified by:
clonein classPrismValueImpl
-
createImmutableClone
public PrismReferenceValue createImmutableClone()
- Specified by:
createImmutableClonein interfacePrismReferenceValue- Specified by:
createImmutableClonein interfacePrismValue- Overrides:
createImmutableClonein classPrismValueImpl
-
cloneComplex
public PrismReferenceValueImpl cloneComplex(CloneStrategy strategy)
Description copied from class:PrismValueImplComplex clone with different cloning strategies.- Specified by:
cloneComplexin interfacePrismReferenceValue- Specified by:
cloneComplexin interfacePrismValue- Specified by:
cloneComplexin classPrismValueImpl- See Also:
CloneStrategy
-
copyValues
protected void copyValues(CloneStrategy strategy, PrismReferenceValueImpl clone)
-
toHumanReadableString
public String toHumanReadableString()
- Specified by:
toHumanReadableStringin interfacePrismValue- Specified by:
toHumanReadableStringin classPrismValueImpl
-
getRealClass
public Class<?> getRealClass()
- Specified by:
getRealClassin interfacePrismReferenceValue- Specified by:
getRealClassin interfacePrismValue- Specified by:
getRealClassin classPrismValueImpl
-
getRealValue
@Nullable public @Nullable Referencable getRealValue()
- 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
public void revive(PrismContext prismContext) throws SchemaException
- Specified by:
revivein interfaceRevivable- Overrides:
revivein classPrismValueImpl- Throws:
SchemaException
-
shortDump
public void shortDump(StringBuilder sb)
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
public void accept(Visitor visitor)
- 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
public <I extends Item<?,?>> I findReferencedItem(ItemPath path, Class<I> type)
- Specified by:
findReferencedItemin interfacePrismReferenceValue
-
-