Class ResourceObjectDefinitionResolver
- java.lang.Object
-
- com.evolveum.midpoint.schema.processor.ResourceObjectDefinitionResolver
-
public class ResourceObjectDefinitionResolver extends Object
Methods for determining object definition for given kind/intent/object class. There are two basic methods: -getDefinitionForShadow(ResourceSchema, ShadowType)
does an approximate lookup. Providing some information is more important than absolute precision. -getObjectDefinitionPrecisely(ResourceType, ShadowKindType, String, QName, Collection, boolean)
is the ultimate method for determining the definition as precisely as possible. The particular cases of definition lookup are handled byResourceSchema
itself. Other differences between these two classes are: - Methods in this class try to handle kind/intent values of "unknown". - Methods in this class add auxiliary object classes to definitions found. NOTE: This is a preliminary version of the algorithms. These methods will most probably evolve in the future.
-
-
Constructor Summary
Constructors Constructor Description ResourceObjectDefinitionResolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @Nullable ResourceObjectDefinition
getDefinitionForShadow(@NotNull ResourceSchema resourceSchema, @NotNull PrismObject<ShadowType> shadow)
A version ofgetDefinitionForShadow(ResourceSchema, ShadowType)
.static @Nullable ResourceObjectDefinition
getDefinitionForShadow(@NotNull ResourceSchema resourceSchema, @NotNull ShadowType shadow)
Returns appropriateResourceObjectDefinition
for given shadow.static ResourceObjectDefinition
getObjectDefinitionPrecisely(@NotNull ResourceType resource, @Nullable ShadowKindType kind, @Nullable String intent, @Nullable QName objectClassName, @NotNull Collection<QName> additionalAuxiliaryObjectClassNames, boolean unknownValuesSupported)
Determines object type/class definition in a precise way.
-
-
-
Method Detail
-
getDefinitionForShadow
@Nullable public static @Nullable ResourceObjectDefinition getDefinitionForShadow(@NotNull @NotNull ResourceSchema resourceSchema, @NotNull @NotNull ShadowType shadow)
Returns appropriateResourceObjectDefinition
for given shadow. We are not too strict here. Unknown kind/intent values are ignored (treated like null). Intent without kind is ignored. Takes auxiliary object classes defined in the shadow into account. Note: we could be even more relaxed (in the future): 1. Currently the consistency between kind, intent, and OC is checked. We could avoid this. 2. TheResourceSchema.findObjectDefinition(ShadowKindType, String, QName)
method used throws an exception when it cannot decide among various definitions for given kind (when intent and OC is null). We could be more permissive and return any of them.
-
getDefinitionForShadow
@Nullable public static @Nullable ResourceObjectDefinition getDefinitionForShadow(@NotNull @NotNull ResourceSchema resourceSchema, @NotNull @NotNull PrismObject<ShadowType> shadow)
A version ofgetDefinitionForShadow(ResourceSchema, ShadowType)
.
-
getObjectDefinitionPrecisely
@Contract(" _, null, null, null, _, _ -> null; _, _, _, !null, _, _ -> !null; _, !null, !null, _, _, _ -> !null; _, null, !null, _, _, _ -> fail") public static ResourceObjectDefinition getObjectDefinitionPrecisely(@NotNull @NotNull ResourceType resource, @Nullable @Nullable ShadowKindType kind, @Nullable @Nullable String intent, @Nullable @Nullable QName objectClassName, @NotNull @NotNull Collection<QName> additionalAuxiliaryObjectClassNames, boolean unknownValuesSupported) throws SchemaException, ConfigurationException
Determines object type/class definition in a precise way. The decision is based on kind/intent/objectclass triple, and later enriched by aux object class names. Basic schema is: - no kind or kind=UNKNOWN -> decision is based on the OC - kind present -> decision is based on kind/intent (optionally OC), then checked against OC (For details please see the code.)- Parameters:
additionalAuxiliaryObjectClassNames
- Auxiliary object classes that should be "baked into" the definition, in addition to any classes specified in the resolved object type.unknownValuesSupported
- If we allow the use of "unknown" kind or intent. This is usually the case when we obtain the coordinates from an existing shadow. On the contrary, if we are looking up according to user-provided data (e.g. query), we don't want to allow unknown values.- Throws:
SchemaException
ConfigurationException
- See Also:
ResourceSchema.findObjectDefinition(ShadowKindType, String, QName)
,ResourceSchema.findDefinitionForObjectClass(QName)
,getDefinitionForShadow(ResourceSchema, ShadowType)
-
-