Class ResourceSchemaFactory
java.lang.Object
com.evolveum.midpoint.schema.processor.ResourceSchemaFactory
The official place where resource schemas are created.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BareResourceSchema
getBareSchema
(@NotNull PrismObject<ResourceType> resource) static BareResourceSchema
getBareSchema
(@NotNull ResourceType resource) static CompleteResourceSchema
getCompleteSchema
(@NotNull PrismObject<ResourceType> resource) Obtains refined schema for the resource.static @Nullable CompleteResourceSchema
getCompleteSchema
(@NotNull ResourceType resource) static CompleteResourceSchema
getCompleteSchema
(PrismObject<ResourceType> resource, LayerType layer) Returned schema is immutable.static CompleteResourceSchema
getCompleteSchema
(ResourceType resourceType, LayerType layer) static @NotNull CompleteResourceSchema
getCompleteSchemaRequired
(@NotNull PrismObject<ResourceType> resource) static @NotNull CompleteResourceSchema
getCompleteSchemaRequired
(@NotNull ResourceType resource) We assume that missing schema is a configuration (not schema) problem.static @NotNull ResourceSchema
getCompleteSchemaRequired
(PrismObject<ResourceType> resource, LayerType layer) static @NotNull ResourceSchema
getCompleteSchemaRequired
(ResourceType resource, LayerType layer) static NativeResourceSchema
getNativeSchema
(@NotNull PrismObject<ResourceType> resource) Obtains "raw" schema for the resource, i.e.static NativeResourceSchema
getNativeSchema
(@NotNull ResourceType resource) static NativeResourceSchema
getNativeSchemaRequired
(PrismObject<ResourceType> resource) static NativeResourceSchema
getNativeSchemaRequired
(ResourceType resource) static boolean
hasParsedSchema
(ResourceType resource) static BareResourceSchema
nativeToBare
(@Nullable NativeResourceSchema nativeResourceSchema) static CompleteResourceSchema
parseCompleteSchema
(@NotNull ResourceType resource, NativeResourceSchema nativeSchema) Parses the complete schema from the provided raw schema plus definitions in the resource.static CompleteResourceSchema
parseCompleteSchema
(ResourceType resource) Executes the real parsing.static @NotNull NativeResourceSchema
parseNativeSchema
(@NotNull Element sourceXsdElement, String description) static @NotNull BareResourceSchema
parseNativeSchemaAsBare
(@NotNull Document sourceXsdDocument) static @NotNull BareResourceSchema
parseNativeSchemaAsBare
(@NotNull Element sourceXsdElement)
-
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. -
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
@VisibleForTesting public static CompleteResourceSchema parseCompleteSchema(ResourceType resource) throws SchemaException, ConfigurationException Executes the real parsing. Returns complete schema (raw + refined). Normally internal to this class, but may be called externally from the test code. DO NOT call it directly from the production code. The returned schema is NOT immutable here, but we want to ensure immutability throughout the running system. UsegetCompleteSchema(PrismObject)
instead. -
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
-