Class ResourceObjectIdentification<I extends ResourceObjectIdentifiers>
java.lang.Object
com.evolveum.midpoint.schema.processor.ResourceObjectIdentification<I>
- All Implemented Interfaces:
DebugDumpable
,Serializable
,Cloneable
- Direct Known Subclasses:
ResourceObjectIdentification.SecondaryOnly
,ResourceObjectIdentification.WithPrimary
public abstract class ResourceObjectIdentification<I extends ResourceObjectIdentifiers>
extends Object
implements Serializable, DebugDumpable, Cloneable
Identification of a resource object using its primary and/or secondary identifiers.
For facilitating type safety (mainly) across APIs, we provide two specific subclasses:
ResourceObjectIdentification.WithPrimary
and ResourceObjectIdentification.SecondaryOnly
.
NOTE: Making this class parameterized by the type of identifiers (primary-containing or secondary-only)
may or may not be a good idea. It makes the implementation nicer, but the clients are bothered with
additional `<?>` in the code. To be reconsidered.- Author:
- semancik
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Identification that does not contain a primary identifier.static class
Identification that contains a primary identifier. -
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescription@NotNull ResourceObjectIdentityType
asBean()
abstract ResourceObjectIdentification<I>
clone()
debugDump
(int indent) boolean
static @NotNull ResourceObjectIdentification<?>
fromAttributes
(@NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull Collection<? extends ShadowSimpleAttribute<?>> attributes) fromCompleteShadow
(@NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull ShadowType shadow) Returns identification for a shadow.fromCompleteShadow
(@NotNull ShadowType shadow) Returns identification for a shadow.static @NotNull ResourceObjectIdentification<?>
fromIdentifiers
(@NotNull ResourceObjectDefinition objectDefinition, @NotNull Collection<? extends ShadowSimpleAttribute<?>> allIdentifiers) @NotNull Collection<? extends ShadowSimpleAttribute<?>>
Returns all identifiers, both primary and secondary, as an unmodifiable collection.@NotNull QName
@Nullable ResourceObjectIdentifier<?>
abstract @Nullable ShadowSimpleAttribute<?>
@NotNull Set<? extends ResourceObjectIdentifier<?>>
@NotNull Collection<? extends ShadowSimpleAttribute<?>>
@NotNull ResourceObjectDefinition
@NotNull Set<? extends ResourceObjectIdentifier<?>>
@NotNull Collection<? extends ShadowSimpleAttribute<?>>
int
hashCode()
TODO Or should we compare only relevant parts of the definition? And compare identifiers in unordered way?boolean
static @NotNull ResourceObjectIdentification<?>
of
(@NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull ResourceObjectIdentifiers identifiers) static @NotNull ResourceObjectIdentification<?>
of
(@NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull Collection<? extends ShadowSimpleAttribute<?>> identifierAttributes) static @NotNull ResourceObjectIdentification<?>
of
(@NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull Collection<ResourceObjectIdentifier.Primary<?>> primaryIdentifiers, @NotNull Collection<ResourceObjectIdentifier.Secondary<?>> secondaryIdentifiers) SeeResourceObjectIdentifiers.of(Collection, Collection)
for preconditions.of
(@NotNull ResourceObjectDefinition resourceObjectDefinition, ResourceObjectIdentifiers.WithPrimary primaryIdentifiers) toString()
withPrimary
(@NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull ShadowSimpleAttribute<?> primaryIdentifierAttribute, @NotNull Collection<? extends ShadowSimpleAttribute<?>> secondaryIdentifierAttributes) Creates new identification with a primary identifier.withPrimaryAdded
(ResourceObjectIdentifier.Primary<?> primaryIdentifier) Enriches current identification with a primary identifier.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
-
Method Details
-
of
@NotNull public static @NotNull ResourceObjectIdentification<?> of(@NotNull @NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull @NotNull ResourceObjectIdentifiers identifiers) -
of
@NotNull public static @NotNull ResourceObjectIdentification<?> of(@NotNull @NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull @NotNull Collection<? extends ShadowSimpleAttribute<?>> identifierAttributes) throws SchemaException - Throws:
SchemaException
-
of
@NotNull public static ResourceObjectIdentification.WithPrimary of(@NotNull @NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull ResourceObjectIdentifiers.WithPrimary primaryIdentifiers) -
withPrimary
public static ResourceObjectIdentification.WithPrimary withPrimary(@NotNull @NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull @NotNull ShadowSimpleAttribute<?> primaryIdentifierAttribute, @NotNull @NotNull Collection<? extends ShadowSimpleAttribute<?>> secondaryIdentifierAttributes) Creates new identification with a primary identifier. -
withPrimaryAdded
public ResourceObjectIdentification.WithPrimary withPrimaryAdded(@NotNull ResourceObjectIdentifier.Primary<?> primaryIdentifier) Enriches current identification with a primary identifier. -
of
@NotNull public static @NotNull ResourceObjectIdentification<?> of(@NotNull @NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull @NotNull Collection<ResourceObjectIdentifier.Primary<?>> primaryIdentifiers, @NotNull @NotNull Collection<ResourceObjectIdentifier.Secondary<?>> secondaryIdentifiers) throws SchemaException SeeResourceObjectIdentifiers.of(Collection, Collection)
for preconditions.- Throws:
SchemaException
-
fromIdentifiers
@NotNull public static @NotNull ResourceObjectIdentification<?> fromIdentifiers(@NotNull @NotNull ResourceObjectDefinition objectDefinition, @NotNull @NotNull Collection<? extends ShadowSimpleAttribute<?>> allIdentifiers) throws SchemaException - Throws:
SchemaException
-
fromAttributes
@NotNull public static @NotNull ResourceObjectIdentification<?> fromAttributes(@NotNull @NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull @NotNull Collection<? extends ShadowSimpleAttribute<?>> attributes) -
fromCompleteShadow
@NotNull public static ResourceObjectIdentification.WithPrimary fromCompleteShadow(@NotNull @NotNull ShadowType shadow) Returns identification for a shadow. The shadow must have the primary identifier and correct definition. -
fromCompleteShadow
@NotNull public static ResourceObjectIdentification.WithPrimary fromCompleteShadow(@NotNull @NotNull ResourceObjectDefinition resourceObjectDefinition, @NotNull @NotNull ShadowType shadow) Returns identification for a shadow. The shadow must have the primary identifier. -
getIdentifiers
-
getPrimaryIdentifier
-
getPrimaryIdentifiers
-
getPrimaryIdentifierAttribute
-
getPrimaryIdentifiersAsAttributes
@NotNull public @NotNull Collection<? extends ShadowSimpleAttribute<?>> getPrimaryIdentifiersAsAttributes() -
getSecondaryIdentifiers
-
getSecondaryIdentifiersAsAttributes
@NotNull public @NotNull Collection<? extends ShadowSimpleAttribute<?>> getSecondaryIdentifiersAsAttributes() -
getAllIdentifiersAsAttributes
@NotNull public @NotNull Collection<? extends ShadowSimpleAttribute<?>> getAllIdentifiersAsAttributes()Returns all identifiers, both primary and secondary, as an unmodifiable collection. -
getResourceObjectDefinition
-
hasPrimaryIdentifier
public boolean hasPrimaryIdentifier() -
equals
-
hashCode
public int hashCode()TODO Or should we compare only relevant parts of the definition? And compare identifiers in unordered way? -
toString
-
asBean
- Throws:
SchemaException
-
ensurePrimary
-
clone
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
getObjectClassName
-