Interface ResourceSchema
-
- All Superinterfaces:
Cloneable,DebugDumpable,DefinitionSearchImplementation,DefinitionsStore,Freezable,GlobalDefinitionsStore,LayeredDefinition,PrismContextSensitive,PrismSchema
- All Known Subinterfaces:
MutableResourceSchema
- All Known Implementing Classes:
ResourceSchemaImpl
public interface ResourceSchema extends PrismSchema, Cloneable, LayeredDefinition
A schema covering the whole resource. It contains both "raw" object class definition and "refined" object type and class definitions. - Raw (class) definitions are represented byResourceObjectClassDefinitionobjects and are obtained directly from the connector. - Refined (type or class) definitions (represented byResourceObjectTypeDefinitionandResourceObjectClassDefinition) are derived from the raw ones by merging them with information in `schemaHandling` part of the resource definition. 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 work at lower layers (e.g. when fetching and parsing the schema in ConnId connector). NOTE: Resolution of definitions is a complex process. So it's delegated toResourceObjectDefinitionResolver.- Author:
- semancik
-
-
Field Summary
Fields Modifier and Type Field Description static TraceLOGGER-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ResourceSchemaclone()default @Nullable ResourceObjectDefinitionfindDefaultDefinitionForKind(@NotNull ShadowKindType kind)Returns the "default for kind" type definition for given kind.default @NotNull ResourceObjectDefinitionfindDefaultDefinitionForKindRequired(@NotNull ShadowKindType kind)AsfindDefaultDefinitionForKind(ShadowKindType)but the definition must exist.default ResourceObjectDefinitionfindDefinitionForConstruction(@NotNull ConstructionType construction)Finds a definition forConstructionType.default @NotNull ResourceObjectDefinitionfindDefinitionForConstructionRequired(@NotNull ConstructionType constructionBean, @NotNull Supplier<String> contextSupplier)AsfindDefinitionForConstruction(ConstructionType)but throws an exception if the definition is not there.default @Nullable ResourceObjectDefinitionfindDefinitionForObjectClass(@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 ResourceObjectDefinitionfindDefinitionForObjectClassRequired(@NotNull QName name)AsfindDefinitionForObjectClass(QName)but throws an exception if there's no suitable definition.default @Nullable ResourceObjectDefinitionfindDefinitionForShadow(@NotNull ShadowType shadow)Convenience variant offindDefinitionForShadow(ShadowType, Collection).default @Nullable ResourceObjectDefinitionfindDefinitionForShadow(@NotNull ShadowType shadow, @NotNull Collection<QName> additionalAuxObjectClassNames)Returns appropriateResourceObjectDefinitionfor given shadow.default @Nullable ResourceObjectClassDefinitionfindObjectClassDefinition(@NotNull QName name)ReturnsResourceObjectClassDefinition(raw or refined) for a given object class name.default @NotNull ResourceObjectClassDefinitionfindObjectClassDefinitionRequired(@NotNull QName name)The same asfindObjectClassDefinition(QName)but throws an exception if there's no such definition.default @Nullable ResourceObjectDefinitionfindObjectDefinition(@NotNull ResourceObjectTypeIdentification typeIdentification)AsfindObjectDefinition(ShadowKindType, String)but with aggregate representation of type identification.default @Nullable ResourceObjectDefinitionfindObjectDefinition(@NotNull ShadowKindType kind, @NotNull String intent)Returns the definition for known kind and intent.default @Nullable ResourceObjectDefinitionfindObjectDefinition(@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 ResourceObjectDefinitionfindObjectDefinitionRequired(@NotNull ResourceObjectTypeIdentification typeIdentification)AsfindObjectDefinition(ResourceObjectTypeIdentification)but the definition must exist.default @NotNull ResourceObjectDefinitionfindObjectDefinitionRequired(@NotNull ShadowKindType kind, @NotNull String intent)AsfindObjectDefinition(ShadowKindType, String)but the definition must exist.ResourceSchemaforLayer(LayerType layer)Returns a representation of the schema for given layer.default @NotNull Collection<String>getIntentsForKind(ShadowKindType kind)TODO descriptiondefault @NotNull StringgetNamespace()Returns schema namespace.default @NotNull Collection<ResourceObjectClassDefinition>getObjectClassDefinitions()Returns definitions for all the object classes.default @NotNull Collection<QName>getObjectClassNames()Returns names of all object classes mentioned in the "raw" resource definition.default @Nullable ResourceObjectTypeDefinitiongetObjectTypeDefinition(@NotNull ResourceObjectTypeIdentification identification)Returns definition of the given type.default @Nullable ResourceObjectTypeDefinitiongetObjectTypeDefinition(@NotNull ShadowKindType kind, @NotNull String intent)Returns definition of the given type.default @NotNull Collection<ResourceObjectTypeDefinition>getObjectTypeDefinitions()Returns definitions for all the object types.default @NotNull List<? extends ResourceObjectTypeDefinition>getObjectTypeDefinitions(@Nullable ShadowKindType kind)Returns definitions for all types with given kind.default @NotNull Collection<ResourceObjectDefinition>getResourceObjectDefinitions()Returns definitions for all the object classes and types (currently that should be all definitions).default booleanisRaw()Returns true if the schema contains no "refined" (type) definitions.MutableResourceSchematoMutable()Returns an interface to mutate this schema.voidvalidate()TODO description-
Methods 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, findTypeDefinitionsByType, findTypeDefinitionsByType
-
Methods inherited from interface com.evolveum.midpoint.schema.processor.LayeredDefinition
getCurrentLayer
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
Methods inherited from interface com.evolveum.midpoint.prism.schema.PrismSchema
getComplexTypeDefinitions, getDefinitions, getDefinitions, getObjectDefinitions, getSubstitutions, isEmpty, serializeToXsd
-
-
-
-
Field Detail
-
LOGGER
static final Trace LOGGER
-
-
Method Detail
-
getResourceObjectDefinitions
@NotNull default @NotNull Collection<ResourceObjectDefinition> getResourceObjectDefinitions()
Returns definitions for all the object classes and types (currently that should be all definitions).
-
getObjectClassDefinitions
@NotNull default @NotNull Collection<ResourceObjectClassDefinition> getObjectClassDefinitions()
Returns definitions for all the object classes.
-
getObjectTypeDefinitions
@NotNull default @NotNull Collection<ResourceObjectTypeDefinition> 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.)
-
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.
-
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)
AsfindDefinitionForObjectClass(QName)but throws an exception if there's no suitable definition.
-
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
-
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)
Returns appropriateResourceObjectDefinitionfor 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 creatingCompositeObjectDefinitionin such cases.
-
findDefinitionForShadow
@Nullable default @Nullable ResourceObjectDefinition findDefinitionForShadow(@NotNull @NotNull ShadowType shadow)
Convenience variant offindDefinitionForShadow(ShadowType, Collection).
-
getObjectClassNames
@NotNull default @NotNull Collection<QName> getObjectClassNames()
Returns names of all object classes mentioned in the "raw" resource definition.
-
toMutable
MutableResourceSchema toMutable()
Returns an interface to mutate this schema.
-
forLayer
ResourceSchema forLayer(LayerType layer)
Returns a representation of the schema for given layer.
-
getNamespace
@NotNull default @NotNull String getNamespace()
Description copied from interface:PrismSchemaReturns schema namespace. All schema definitions are placed in the returned namespace.- Specified by:
getNamespacein interfacePrismSchema- Returns:
- schema namespace
-
validate
void validate() throws SchemaExceptionTODO description- Throws:
SchemaException
-
getIntentsForKind
@NotNull default @NotNull Collection<String> getIntentsForKind(ShadowKindType kind)
TODO description
-
clone
ResourceSchema clone()
-
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.
-
-