Class ProjectionContextKey
java.lang.Object
com.evolveum.midpoint.model.api.context.ProjectionContextKey
- All Implemented Interfaces:
- DebugDumpable,- HumanReadableDescribable,- ShortDumpable,- Serializable,- Cloneable
- Direct Known Subclasses:
- ProjectionContextKey.WithResource
public abstract class ProjectionContextKey
extends Object
implements Serializable, DebugDumpable, ShortDumpable, HumanReadableDescribable, Cloneable
Uniquely identifies 
ModelProjectionContext.
 (Originally, `ResourceShadowDiscriminator` was used as a key. However, it was overloaded with other duties,
 so it was better to create a specialized class for this.)
 There are three flavors of these objects:
 1. ProjectionContextKey.Classified: this is the most wanted state - we have resource and object type information;
 2. ProjectionContextKey.Unclassified: knowing the resource, but not the type (kind/intent) - should be avoided if at all possible;
 3. ProjectionContextKey.WithoutResource: almost no information; such a context is basically just a placeholder for broken links.
 == Construction
 === When you exactly know the flavor
 You can then use methods like:
 . classified(String, ResourceObjectTypeIdentification, String, int, boolean)
 . missing()
 === When uncertain about the flavor (classified/unclassified)
 Then there are "dispatching" creation methods like forKnownResource(String, ResourceObjectTypeIdentification, String, int, boolean) that create both classified and unclassified instances.
 === When using specific source
 Use custom methods like
 - fromBean(ShadowDiscriminatorType),
 - fromCoordinates(ResourceShadowCoordinates),
 - fromClassifiedShadow(ShadowType).
 === For potentially unclassified shadows
 Because keys for unclassified shadows are so dangerous, the best approach here is to use
 ProjectionContextKeyFactory.createKey(ShadowType, Task, OperationResult) method that tries
 regular or emergency classification before creating the key.- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic class
- 
Field SummaryFields inherited from interface com.evolveum.midpoint.util.DebugDumpableINDENT_STRING
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedProjectionContextKey(String resourceOid, ResourceObjectTypeIdentification typeIdentification, String tag, int order, boolean gone) 
- 
Method SummaryModifier and TypeMethodDescriptioncheckOrUpdateResourceOid(@NotNull String newValue) checkOrUpdateTypeIdentification(@NotNull ResourceObjectTypeIdentification newValue) classified(@NotNull String resourceOid, @NotNull ResourceObjectTypeIdentification typeIdentification, @Nullable String tag, int order, boolean gone) static ProjectionContextKeyclassified(@NotNull String resourceOid, @NotNull ShadowKindType kind, @NotNull String intent, @Nullable String tag) Kind and intent must not be "unknown".static ProjectionContextKeyclassified(@NotNull String resourceOid, @NotNull ShadowKindType kind, @NotNull String intent, @Nullable String tag, int order, boolean gone) Kind and intent must not be "unknown".clone()debugDump(int indent) booleanbooleanequivalent(ProjectionContextKey other) Similar toequals(Object)but ignores the order.static ProjectionContextKeyforKnownResource(@NotNull String resourceOid, @Nullable ResourceObjectTypeIdentification typeIdentification, @Nullable String tag) static ProjectionContextKeyforKnownResource(@NotNull String resourceOid, @Nullable ResourceObjectTypeIdentification typeIdentification, @Nullable String tag, int order, boolean gone) static ProjectionContextKeystatic ProjectionContextKeyfromClassifiedShadow(@NotNull ShadowType shadow) static ProjectionContextKeyfromCoordinates(@NotNull ResourceShadowCoordinates coordinates) static ProjectionContextKeyfromShadow(@NotNull ShadowType shadow, @Nullable ResourceObjectTypeIdentification typeIdentification) @Nullable String@Nullable ShadowKindTypegetKind()intgetOrder()getTag()gone()inthashCode()booleanbooleanisGone()"Gone" flag is true: the account no longer exists.static ProjectionContextKeymissing()voidShow the content of the object intended for diagnostics.toHumanReadableDescription(boolean writeOid) toString()updateTagIfChanged(String newValue) The usefulness of this method is not obvious; but - in fact - it is used e.g.withOrder(int order) withResourceOid(@NotNull String resourceOid) Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpabledebugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.util.ShortDumpableshortDump, shortDumpLazily
- 
Constructor Details- 
ProjectionContextKeyprotected ProjectionContextKey(String resourceOid, ResourceObjectTypeIdentification typeIdentification, String tag, int order, boolean gone) 
 
- 
- 
Method Details- 
classifiedpublic static ProjectionContextKey.Classified classified(@NotNull @NotNull String resourceOid, @NotNull @NotNull ResourceObjectTypeIdentification typeIdentification, @Nullable @Nullable String tag, int order, boolean gone) 
- 
classifiedpublic static ProjectionContextKey classified(@NotNull @NotNull String resourceOid, @NotNull @NotNull ShadowKindType kind, @NotNull @NotNull String intent, @Nullable @Nullable String tag) Kind and intent must not be "unknown".
- 
classifiedpublic static ProjectionContextKey classified(@NotNull @NotNull String resourceOid, @NotNull @NotNull ShadowKindType kind, @NotNull @NotNull String intent, @Nullable @Nullable String tag, int order, boolean gone) Kind and intent must not be "unknown".
- 
forKnownResource@VisibleForTesting public static ProjectionContextKey forKnownResource(@NotNull @NotNull String resourceOid, @Nullable @Nullable ResourceObjectTypeIdentification typeIdentification, @Nullable @Nullable String tag) 
- 
forKnownResourcepublic static ProjectionContextKey forKnownResource(@NotNull @NotNull String resourceOid, @Nullable @Nullable ResourceObjectTypeIdentification typeIdentification, @Nullable @Nullable String tag, int order, boolean gone) 
- 
missing
- 
fromCoordinatespublic static ProjectionContextKey fromCoordinates(@NotNull @NotNull ResourceShadowCoordinates coordinates) 
- 
fromBean
- 
fromClassifiedShadow
- 
fromShadowpublic static ProjectionContextKey fromShadow(@NotNull @NotNull ShadowType shadow, @Nullable @Nullable ResourceObjectTypeIdentification typeIdentification) 
- 
getResourceOid
- 
getTypeIdentification
- 
getKind
- 
getIntent
- 
getTag
- 
getOrderpublic int getOrder()
- 
isGonepublic boolean isGone()"Gone" flag is true: the account no longer exists. The data we have are the latest metadata we were able to get. The projection will be marked as gone if we discover that the associated resource object is gone. Or the shadow is gone and we can no longer associate the resource object. In any way the "gone" projection is marked for removal. It will be eventually unlinked and the shadow will be deleted. The shadow may stay around in the "dead" state for some time for reporting purposes. In the terms of shadow lifecycle state, this covers corpse and tombstone states.
- 
toResourceShadowDiscriminatorType
- 
equals
- 
hashCodepublic int hashCode()
- 
equivalentSimilar toequals(Object)but ignores the order. TODO what about comparing irregular keys (no resource? no kind/intent?)
- 
toString
- 
shortDumpDescription 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 interface- ShortDumpable
- Parameters:
- sb- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
 
- 
toHumanReadableDescription- Specified by:
- toHumanReadableDescriptionin interface- HumanReadableDescribable
 
- 
toHumanReadableDescription
- 
debugDump- Specified by:
- debugDumpin interface- DebugDumpable
 
- 
clone
- 
withResourceOid
- 
checkOrUpdateResourceOid
- 
checkOrUpdateTypeIdentificationpublic ProjectionContextKey checkOrUpdateTypeIdentification(@NotNull @NotNull ResourceObjectTypeIdentification newValue) 
- 
updateTagIfChangedThe usefulness of this method is not obvious; but - in fact - it is used e.g. in `TestMultiAccount.test350`, when tag is changed from `Ix` to `ix`, when treating conflicting accounts in `ProjectionValuesProcessor`. Maybe we should reconsider if/when the tag should be updated.
- 
withOrder
- 
gone
- 
isClassifiedpublic boolean isClassified()
 
-