Class ResourceSchemaFactory
java.lang.Object
com.evolveum.midpoint.schema.processor.ResourceSchemaFactory
The official place where resource schemas are created.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteCachedSchemas(PrismObject<ResourceType> resource) Removes schemas that are attached to the particular prism object using user data.static BareResourceSchemagetBareSchema(@NotNull PrismObject<ResourceType> resource) static BareResourceSchemagetBareSchema(@NotNull ResourceType resource) static CompleteResourceSchemagetCompleteSchema(@NotNull PrismObject<ResourceType> resource) Obtains refined schema for the resource.static @Nullable CompleteResourceSchemagetCompleteSchema(@NotNull ResourceType resource) static CompleteResourceSchemagetCompleteSchema(PrismObject<ResourceType> resource, LayerType layer) Returned schema is immutable.static CompleteResourceSchemagetCompleteSchema(ResourceType resourceType, LayerType layer) static @NotNull CompleteResourceSchemagetCompleteSchemaRequired(@NotNull PrismObject<ResourceType> resource) static @NotNull CompleteResourceSchemagetCompleteSchemaRequired(@NotNull ResourceType resource) We assume that missing schema is a configuration (not schema) problem.static @NotNull ResourceSchemagetCompleteSchemaRequired(PrismObject<ResourceType> resource, LayerType layer) static @NotNull ResourceSchemagetCompleteSchemaRequired(ResourceType resource, LayerType layer) static NativeResourceSchemagetNativeSchema(@NotNull PrismObject<ResourceType> resource) Obtains "raw" schema for the resource, i.e. the one without `schemaHandling` and similar configuration.static NativeResourceSchemagetNativeSchema(@NotNull ResourceType resource) static NativeResourceSchemagetNativeSchemaRequired(PrismObject<ResourceType> resource) static NativeResourceSchemagetNativeSchemaRequired(ResourceType resource) static booleanhasParsedSchema(ResourceType resource) static BareResourceSchemanativeToBare(@Nullable NativeResourceSchema nativeResourceSchema) static CompleteResourceSchemaparseCompleteSchema(@NotNull ResourceType resource, NativeResourceSchema nativeSchema) Parses the complete schema from the provided raw schema plus definitions in the resource.static CompleteResourceSchemaparseCompleteSchema(ResourceType resource) Executes the real parsing.static CompleteResourceSchemaparseCompleteSchemaWithAdditions(ResourceType resource, SchemaHandlingType additions) Parse "complete schema" of the resource with additional definitions which are not stored in the resource.static @NotNull NativeResourceSchemaparseNativeSchema(@NotNull Element sourceXsdElement, String description) static @NotNull BareResourceSchemaparseNativeSchemaAsBare(@NotNull Document sourceXsdDocument) static @NotNull BareResourceSchemaparseNativeSchemaAsBare(@NotNull Element sourceXsdElement) static ResourceSchemaExtenderschemaExtenderFor(ResourceType resource) Creates new schema extender for a given resource.
-
Constructor Details
-
ResourceSchemaFactory
public ResourceSchemaFactory()
-
-
Method Details
-
getCompleteSchema
@Nullable public static @Nullable CompleteResourceSchema getCompleteSchema(@NotNull @NotNull ResourceType resource) throws SchemaException, ConfigurationException -
getCompleteSchemaRequired
@NotNull public static @NotNull CompleteResourceSchema getCompleteSchemaRequired(@NotNull @NotNull ResourceType resource) throws ConfigurationException, SchemaException We assume that missing schema is a configuration (not schema) problem. -
getCompleteSchemaRequired
@NotNull public static @NotNull CompleteResourceSchema getCompleteSchemaRequired(@NotNull @NotNull PrismObject<ResourceType> resource) throws ConfigurationException, SchemaException -
getCompleteSchema
public static CompleteResourceSchema getCompleteSchema(ResourceType resourceType, LayerType layer) throws SchemaException, ConfigurationException -
getCompleteSchemaRequired
@NotNull public static @NotNull ResourceSchema getCompleteSchemaRequired(PrismObject<ResourceType> resource, LayerType layer) throws SchemaException, ConfigurationException -
getCompleteSchemaRequired
@NotNull public static @NotNull ResourceSchema getCompleteSchemaRequired(ResourceType resource, LayerType layer) throws SchemaException, ConfigurationException -
getCompleteSchema
public static CompleteResourceSchema getCompleteSchema(@NotNull @NotNull PrismObject<ResourceType> resource) throws SchemaException, ConfigurationException Obtains refined schema for the resource. Returns null if the resource does not contain any (native) schema. If the resource does NOT contain the schema, it must be mutable. Returned schema is immutable. -
deleteCachedSchemas
Removes schemas that are attached to the particular prism object using user data. -
getCompleteSchema
public static CompleteResourceSchema getCompleteSchema(PrismObject<ResourceType> resource, LayerType layer) throws SchemaException, ConfigurationException Returned schema is immutable. FIXME there is a lot of cloning if layer != MODEL! -
getNativeSchema
public static NativeResourceSchema getNativeSchema(@NotNull @NotNull ResourceType resource) throws SchemaException - Throws:
SchemaException
-
getNativeSchemaRequired
public static NativeResourceSchema getNativeSchemaRequired(ResourceType resource) throws SchemaException, ConfigurationException -
getNativeSchemaRequired
public static NativeResourceSchema getNativeSchemaRequired(PrismObject<ResourceType> resource) throws SchemaException, ConfigurationException -
getBareSchema
public static BareResourceSchema getBareSchema(@NotNull @NotNull PrismObject<ResourceType> resource) throws SchemaException - Throws:
SchemaException
-
getBareSchema
public static BareResourceSchema getBareSchema(@NotNull @NotNull ResourceType resource) throws SchemaException - Throws:
SchemaException
-
getNativeSchema
public static NativeResourceSchema getNativeSchema(@NotNull @NotNull PrismObject<ResourceType> resource) throws SchemaException Obtains "raw" schema for the resource, i.e. the one without `schemaHandling` and similar configuration. If the resource does NOT contain the schema, it must be mutable. The returned schema is immutable.- Throws:
SchemaException
-
hasParsedSchema
-
parseCompleteSchema
public static CompleteResourceSchema parseCompleteSchema(ResourceType resource) throws SchemaException, ConfigurationException Executes the real parsing. Returns complete schema (raw + refined). -
parseCompleteSchemaWithAdditions
public static CompleteResourceSchema parseCompleteSchemaWithAdditions(ResourceType resource, SchemaHandlingType additions) throws SchemaException, ConfigurationException Parse "complete schema" of the resource with additional definitions which are not stored in the resource. During the parsing the provided additional schema handling is considered as well as the schema handling and native schema which are already present in the resource.- Parameters:
resource- The resource schema of which should be parsed.additions- The additional definitions specified in schema handling.- Returns:
- Instance of parsed complete schema.
- Throws:
SchemaExceptionConfigurationException
-
schemaExtenderFor
public static ResourceSchemaExtender schemaExtenderFor(ResourceType resource) throws SchemaException Creates new schema extender for a given resource.- Parameters:
resource- The resource schema of which you would like to extend.- Returns:
- The new instance of the schema extender
- Throws:
SchemaException- When error occurs during parsing of resource native schema.
-
parseCompleteSchema
@Contract("_, null -> null; _, !null -> !null") public static CompleteResourceSchema parseCompleteSchema(@NotNull @NotNull ResourceType resource, NativeResourceSchema nativeSchema) throws SchemaException, ConfigurationException Parses the complete schema from the provided raw schema plus definitions in the resource. -
parseNativeSchema
@NotNull public static @NotNull NativeResourceSchema parseNativeSchema(@NotNull @NotNull Element sourceXsdElement, String description) throws SchemaException - Throws:
SchemaException
-
parseNativeSchemaAsBare
@TestOnly @NotNull public static @NotNull BareResourceSchema parseNativeSchemaAsBare(@NotNull @NotNull Document sourceXsdDocument) throws SchemaException - Throws:
SchemaException
-
parseNativeSchemaAsBare
@TestOnly @NotNull public static @NotNull BareResourceSchema parseNativeSchemaAsBare(@NotNull @NotNull Element sourceXsdElement) throws SchemaException - Throws:
SchemaException
-
nativeToBare
@Contract("null -> null; !null -> !null") public static BareResourceSchema nativeToBare(@Nullable @Nullable NativeResourceSchema nativeResourceSchema) throws SchemaException - Throws:
SchemaException
-