Interface ResourceSchema
- All Superinterfaces:
Cloneable
,DebugDumpable
,DefinitionSearchImplementation
,DefinitionsStore
,Freezable
,GlobalDefinitionsStore
,LayeredDefinition
,PrismSchema
- All Known Subinterfaces:
BareResourceSchema
,CompleteResourceSchema
- All Known Implementing Classes:
BareResourceSchemaImpl
,CompleteResourceSchemaImpl
,ResourceSchemaImpl
A schema covering the whole resource.
It contains object classes and types definitions and reference types definitions.
It refers to the
NativeResourceSchema
upon which it was built.
This interface contains a lot of methods that try to find object type/class definition matching criteria.
NOTE: There can be schemas that contain no refined definitions. Either the resource definition
contains no `schemaHandling`, or we intentionally want to avoid them. See BareResourceSchema
.
NOTE: Resolution of definitions is a complex process. So it's delegated to ResourceObjectDefinitionResolver
.- Author:
- semancik
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.PrismSchema
PrismSchema.PrismSchemaMutator
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescriptionclone()
default @Nullable ResourceObjectDefinition
findDefaultDefinitionForKind
(@NotNull ShadowKindType kind) Returns the "default for kind" type definition for given kind.default @NotNull ResourceObjectDefinition
findDefaultDefinitionForKindRequired
(@NotNull ShadowKindType kind) AsfindDefaultDefinitionForKind(ShadowKindType)
but the definition must exist.default ResourceObjectDefinition
findDefinitionForConstruction
(@NotNull ConstructionType construction) Finds a definition forConstructionType
.default @NotNull ResourceObjectDefinition
findDefinitionForConstructionRequired
(@NotNull ConstructionType constructionBean, @NotNull Supplier<String> contextSupplier) AsfindDefinitionForConstruction(ConstructionType)
but throws an exception if the definition is not there.default @Nullable ResourceObjectDefinition
findDefinitionForObjectClass
(@NotNull QName name) Returns a type or class definition for a given object class: - if there's a "default for class" type defined, it is returned (this is a kind of pre-4.5 behavior) - otherwise, the object class definition is returned (if there's any)default @NotNull ResourceObjectDefinition
findDefinitionForObjectClassRequired
(@NotNull QName name) AsfindDefinitionForObjectClass(QName)
but throws an exception if there's no suitable definition.default @Nullable ResourceObjectDefinition
findDefinitionForShadow
(@NotNull ShadowType shadow) Convenience variant offindDefinitionForShadow(ShadowType, Collection)
.default @Nullable ResourceObjectDefinition
findDefinitionForShadow
(@NotNull ShadowType shadow, @NotNull Collection<QName> additionalAuxObjectClassNames) Returns appropriateResourceObjectDefinition
for given shadow.default @Nullable ResourceObjectClassDefinition
findObjectClassDefinition
(@NotNull QName name) ReturnsResourceObjectClassDefinition
(raw or refined) for a given object class name.default @NotNull ResourceObjectClassDefinition
findObjectClassDefinitionRequired
(@NotNull QName name) The same asfindObjectClassDefinition(QName)
but throws an exception if there's no such definition.default @NotNull ResourceObjectClassDefinition
findObjectClassDefinitionRequired
(@NotNull QName name, @NotNull Supplier<String> contextSupplier) default @Nullable ResourceObjectDefinition
findObjectDefinition
(@NotNull ResourceObjectTypeIdentification typeIdentification) AsfindObjectDefinition(ShadowKindType, String)
but with aggregate representation of type identification.default @Nullable ResourceObjectDefinition
findObjectDefinition
(@NotNull ShadowKindType kind, @NotNull String intent) Returns the definition for known kind and intent.default @Nullable ResourceObjectDefinition
findObjectDefinition
(@NotNull ShadowKindType kind, @NotNull String intent, @Nullable QName objectClassName) AsfindObjectDefinition(ShadowKindType, String)
but checks the object class compatibility (if object class name is provided).default @NotNull ResourceObjectDefinition
findObjectDefinitionRequired
(@NotNull ResourceObjectTypeIdentification typeIdentification) AsfindObjectDefinition(ResourceObjectTypeIdentification)
but the definition must exist.default @NotNull ResourceObjectDefinition
findObjectDefinitionRequired
(@NotNull ShadowKindType kind, @NotNull String intent) AsfindObjectDefinition(ShadowKindType, String)
but the definition must exist.forLayerImmutable
(LayerType layer) Returns a representation of the schema for given layer (immutable).default @NotNull Collection<String>
TODO descriptiondefault @NotNull String
All top-level definitions (types, items) are in this namespace.@NotNull NativeResourceSchema
default @NotNull Collection<ResourceObjectClassDefinition>
Returns definitions for all the object classes.default int
default @NotNull Collection<QName>
Returns names of all object classes mentioned in the "raw" resource definition.default @Nullable ResourceObjectTypeDefinition
getObjectTypeDefinition
(@NotNull ResourceObjectTypeIdentification identification) Returns definition of the given type.default @Nullable ResourceObjectTypeDefinition
getObjectTypeDefinition
(@NotNull ShadowKindType kind, @NotNull String intent) Returns definition of the given type.default @NotNull ResourceObjectTypeDefinition
getObjectTypeDefinitionRequired
(@NotNull ResourceObjectTypeIdentification identification) default @NotNull Collection<ResourceObjectTypeDefinition>
Returns definitions for all the object types.default @NotNull List<ResourceObjectTypeDefinition>
getObjectTypeDefinitions
(@NotNull Predicate<ResourceObjectTypeDefinition> predicate) Returns all matching object type definitions.default @NotNull List<? extends ResourceObjectTypeDefinition>
getObjectTypeDefinitions
(@Nullable ShadowKindType kind) Returns definitions for all types with given kind.default @NotNull Collection<ResourceObjectDefinition>
Returns definitions for all the object classes and types (currently that should be all definitions).default boolean
isRaw()
Returns true if the schema contains no "refined" (type) definitions.mutator()
Returns an interface to mutate this schema.static @NotNull QName
qualifyTypeName
(@NotNull String localPart) void
validate()
TODO descriptionMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutable
Methods inherited from interface com.evolveum.midpoint.prism.schema.GlobalDefinitionsStore
findComplexTypeDefinitionByCompileTimeClass, findComplexTypeDefinitionByType, findContainerDefinitionByCompileTimeClass, findContainerDefinitionByElementName, findContainerDefinitionByType, findItemDefinitionByCompileTimeClass, findItemDefinitionByElementName, findItemDefinitionByElementName, findItemDefinitionByType, findItemDefinitionByType, findItemDefinitionsByCompileTimeClass, findItemDefinitionsByElementName, findItemDefinitionsByElementName, findObjectDefinitionByCompileTimeClass, findObjectDefinitionByElementName, findObjectDefinitionByType, findPropertyDefinitionByElementName, findReferenceDefinitionByElementName, findSimpleTypeDefinitionByType, findTypeDefinitionByCompileTimeClass, findTypeDefinitionByType, findTypeDefinitionByType, findTypeDefinitionsByElementName, findTypeDefinitionsByType, findTypeDefinitionsByType
Methods inherited from interface com.evolveum.midpoint.schema.processor.LayeredDefinition
getCurrentLayer
Methods inherited from interface com.evolveum.midpoint.prism.schema.PrismSchema
builder, getComplexTypeDefinitions, getDefinitions, getDefinitions, getObjectDefinitions, getSourceDescription, getSubstitutions, isEmpty, isRuntime, serializeToXsd, size
-
Field Details
-
LOGGER
-
-
Method Details
-
getResourceObjectDefinitions
Returns definitions for all the object classes and types (currently that should be all definitions). -
getObjectClassDefinitions
Returns definitions for all the object classes. -
getObjectClassDefinitionsCount
default int getObjectClassDefinitionsCount() -
getObjectTypeDefinitions
Returns definitions for all the object types. -
getObjectTypeDefinitions
@NotNull default @NotNull List<? extends ResourceObjectTypeDefinition> getObjectTypeDefinitions(@Nullable @Nullable ShadowKindType kind) Returns definitions for all types with given kind. (If null, returns all types.) -
getObjectTypeDefinitions
@NotNull default @NotNull List<ResourceObjectTypeDefinition> getObjectTypeDefinitions(@NotNull @NotNull Predicate<ResourceObjectTypeDefinition> predicate) Returns all matching object type definitions. -
getObjectTypeDefinition
@Nullable default @Nullable ResourceObjectTypeDefinition getObjectTypeDefinition(@NotNull @NotNull ShadowKindType kind, @NotNull @NotNull String intent) Returns definition of the given type. No hacks/guesses here. -
getObjectTypeDefinition
@Nullable default @Nullable ResourceObjectTypeDefinition getObjectTypeDefinition(@NotNull @NotNull ResourceObjectTypeIdentification identification) Returns definition of the given type. No hacks/guesses here. -
getObjectTypeDefinitionRequired
@NotNull default @NotNull ResourceObjectTypeDefinition getObjectTypeDefinitionRequired(@NotNull @NotNull ResourceObjectTypeIdentification identification) -
findDefaultDefinitionForKind
@Nullable default @Nullable ResourceObjectDefinition findDefaultDefinitionForKind(@NotNull @NotNull ShadowKindType kind) Returns the "default for kind" type definition for given kind. Applies `account/default` hack if nothing relevant can be found. -
findDefaultDefinitionForKindRequired
@NotNull default @NotNull ResourceObjectDefinition findDefaultDefinitionForKindRequired(@NotNull @NotNull ShadowKindType kind) AsfindDefaultDefinitionForKind(ShadowKindType)
but the definition must exist. -
findObjectDefinition
@Nullable default @Nullable ResourceObjectDefinition findObjectDefinition(@NotNull @NotNull ShadowKindType kind, @NotNull @NotNull String intent) Returns the definition for known kind and intent. Applies `account/default` hack if nothing relevant can be found. -
findObjectDefinitionRequired
@NotNull default @NotNull ResourceObjectDefinition findObjectDefinitionRequired(@NotNull @NotNull ShadowKindType kind, @NotNull @NotNull String intent) AsfindObjectDefinition(ShadowKindType, String)
but the definition must exist. -
findObjectDefinition
@Nullable default @Nullable ResourceObjectDefinition findObjectDefinition(@NotNull @NotNull ResourceObjectTypeIdentification typeIdentification) AsfindObjectDefinition(ShadowKindType, String)
but with aggregate representation of type identification. Applies `account/default` hack if nothing relevant can be found. -
findObjectDefinitionRequired
@NotNull default @NotNull ResourceObjectDefinition findObjectDefinitionRequired(@NotNull @NotNull ResourceObjectTypeIdentification typeIdentification) AsfindObjectDefinition(ResourceObjectTypeIdentification)
but the definition must exist. Applies `account/default` hack if nothing relevant can be found. -
findDefinitionForObjectClass
@Nullable default @Nullable ResourceObjectDefinition findDefinitionForObjectClass(@NotNull @NotNull QName name) Returns a type or class definition for a given object class: - if there's a "default for class" type defined, it is returned (this is a kind of pre-4.5 behavior) - otherwise, the object class definition is returned (if there's any) -
findDefinitionForObjectClassRequired
@NotNull default @NotNull ResourceObjectDefinition findDefinitionForObjectClassRequired(@NotNull @NotNull QName name) throws SchemaException AsfindDefinitionForObjectClass(QName)
but throws an exception if there's no suitable definition.- Throws:
SchemaException
-
findObjectClassDefinition
@Nullable default @Nullable ResourceObjectClassDefinition findObjectClassDefinition(@NotNull @NotNull QName name) ReturnsResourceObjectClassDefinition
(raw or refined) for a given object class name. -
findObjectClassDefinitionRequired
@NotNull default @NotNull ResourceObjectClassDefinition findObjectClassDefinitionRequired(@NotNull @NotNull QName name) throws SchemaException The same asfindObjectClassDefinition(QName)
but throws an exception if there's no such definition.- Throws:
SchemaException
-
findObjectClassDefinitionRequired
@NotNull default @NotNull ResourceObjectClassDefinition findObjectClassDefinitionRequired(@NotNull @NotNull QName name, @NotNull @NotNull Supplier<String> contextSupplier) throws SchemaException - Throws:
SchemaException
-
findObjectDefinition
@Nullable default @Nullable ResourceObjectDefinition findObjectDefinition(@NotNull @NotNull ShadowKindType kind, @NotNull @NotNull String intent, @Nullable @Nullable QName objectClassName) AsfindObjectDefinition(ShadowKindType, String)
but checks the object class compatibility (if object class name is provided). -
findDefinitionForConstruction
default ResourceObjectDefinition findDefinitionForConstruction(@NotNull @NotNull ConstructionType construction) Finds a definition forConstructionType
. The method is different from the ones looking for kind/intent because here is a special handling of the default values. -
findDefinitionForConstructionRequired
@NotNull default @NotNull ResourceObjectDefinition findDefinitionForConstructionRequired(@NotNull @NotNull ConstructionType constructionBean, @NotNull @NotNull Supplier<String> contextSupplier) throws SchemaException AsfindDefinitionForConstruction(ConstructionType)
but throws an exception if the definition is not there.- Throws:
SchemaException
-
findDefinitionForShadow
@Nullable default @Nullable ResourceObjectDefinition findDefinitionForShadow(@NotNull @NotNull ShadowType shadow, @NotNull @NotNull Collection<QName> additionalAuxObjectClassNames) throws SchemaException Returns appropriateResourceObjectDefinition
for given shadow. We are not too strict here. Unknown kind/intent values are ignored (treated like null). Incomplete classification is considered as kind=null, intent=null. Takes auxiliary object classes defined in the shadow, in the structural object definition, and those explicitly provided itself into account - by creatingCompositeObjectDefinition
in such cases.- Throws:
SchemaException
-
findDefinitionForShadow
@Nullable default @Nullable ResourceObjectDefinition findDefinitionForShadow(@NotNull @NotNull ShadowType shadow) throws SchemaException Convenience variant offindDefinitionForShadow(ShadowType, Collection)
.- Throws:
SchemaException
-
getObjectClassNames
Returns names of all object classes mentioned in the "raw" resource definition. -
mutator
ResourceSchema.ResourceSchemaMutator mutator()Returns an interface to mutate this schema.- Specified by:
mutator
in interfacePrismSchema
-
forLayerImmutable
Returns a representation of the schema for given layer (immutable). -
getNamespace
Description copied from interface:PrismSchema
All top-level definitions (types, items) are in this namespace.- Specified by:
getNamespace
in interfacePrismSchema
-
validate
TODO description- Throws:
SchemaException
-
getIntentsForKind
TODO description -
serializeNativeToXsd
- Throws:
SchemaException
-
clone
ResourceSchema clone() -
qualifyTypeName
-
isRaw
default boolean isRaw()Returns true if the schema contains no "refined" (type) definitions. BEWARE! Even schemas obtained viaResourceSchemaFactory.getCompleteSchema(ResourceType)
method may seem raw, if there's no `schemaHandling` section. This should be perhaps fixed. -
getNativeSchema
-