Class SchemaRegistryStateImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.schema.SchemaRegistryStateImpl
- All Implemented Interfaces:
Freezable
,DefinitionsStore
,GlobalDefinitionsStore
,SchemaLookup
,SchemaLookup.Mutable
,SchemaRegistryState
,DebugDumpable
public class SchemaRegistryStateImpl
extends AbstractFreezable
implements DebugDumpable, SchemaLookup.Mutable
Contains caches and provides definitions.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder for SchemaRegistryState.Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.SchemaLookup
SchemaLookup.Aware, SchemaLookup.Based, SchemaLookup.Mutable
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistryState
SchemaRegistryState.DerivationKey<R>, SchemaRegistryState.IsList
-
Field Summary
Modifier and TypeFieldDescriptionprotected final PrismContext
A prism context this schema registry is part of.Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescriptiondebugDump
(int indent) <T> Class<T>
determineClassForType
(QName type) <T> Class<T>
<T> Class<T>
determineCompileTimeClassInternal
(QName type, boolean cacheAlsoNegativeResults) determineParentDefinition
(@NotNull ComplexTypeDefinition child, @NotNull ItemPath rest) <ID extends ItemDefinition>
IDfindItemDefinitionByType
(@NotNull QName typeName, @NotNull Class<ID> definitionClass) Looking up item definition by type name.<ID extends ItemDefinition>
@NotNull List<ID>findItemDefinitionsByCompileTimeClass
(@NotNull Class<?> compileTimeClass, @NotNull Class<ID> definitionClass) Looking up item definitions by compile-time class.<ID extends ItemDefinition>
@NotNull List<ID>findItemDefinitionsByElementName
(@NotNull QName elementName, @NotNull Class<ID> definitionClass) Looking up item definitions by element name.<O extends Objectable>
PrismObjectDefinition<O>findObjectDefinitionByCompileTimeClass
(@NotNull Class<O> compileTimeClass) <O extends Objectable>
PrismObjectDefinition<O>findObjectDefinitionByType
(@NotNull QName typeName) findSchemaByCompileTimeClass
(@NotNull Class<?> compileTimeClass) findSchemaByNamespace
(String namespaceURI) findSchemaDescriptionByNamespace
(String namespaceURI) findSchemaDescriptionByPrefix
(String prefix) <TD extends TypeDefinition>
TDfindTypeDefinitionByCompileTimeClass
(@NotNull Class<?> compileTimeClass, @NotNull Class<TD> definitionClass) <TD extends TypeDefinition>
TDfindTypeDefinitionByType
(@NotNull QName typeName, @NotNull Class<TD> definitionClass) <TD extends TypeDefinition>
@NotNull Collection<? extends TD>findTypeDefinitionsByType
(@NotNull QName typeName, @NotNull Class<TD> definitionClass) <R,
E extends Exception>
RgetDerivedObject
(SchemaRegistryState.DerivationKey<R> derivationKey, CheckedFunction<SchemaRegistryState, R, E> mapping) Returns derived value specific to this schema context state, supplied derivation key and mapping.// * @return System-wide "standard prefixes" registry.org.apache.commons.collections4.MultiValuedMap<String,
SchemaDescription> getPrismSchema
(String namespace) @NotNull SchemaRegistryState.IsList
Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.protected void
<T extends SchemaLookup.Based>
voidregisterSchemaSpecific
(Class<T> serviceClass, Function<SchemaLookup, T> factory) resolverFor
(SchemaContextDefinition schemaContextDefinition) <T extends SchemaLookup.Based>
TschemaSpecific
(@NotNull Class<T> type) Returns schema-specific serviceMethods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable
Methods inherited from interface com.evolveum.midpoint.prism.schema.GlobalDefinitionsStore
findComplexTypeDefinitionByCompileTimeClass, findComplexTypeDefinitionByType, findContainerDefinitionByCompileTimeClass, findContainerDefinitionByElementName, findContainerDefinitionByType, findItemDefinitionByCompileTimeClass, findItemDefinitionByElementName, findItemDefinitionByElementName, findItemDefinitionByType, findItemDefinitionsByElementName, findObjectDefinitionByElementName, findPropertyDefinitionByElementName, findReferenceDefinitionByElementName, findSimpleTypeDefinitionByType, findTypeDefinitionByType, findTypeDefinitionsByElementName, findTypeDefinitionsByType
-
Field Details
-
prismContext
A prism context this schema registry is part of. Should be non-null.
-
-
Method Details
-
getParsedSchemas
-
getValueMetadataDefinition
-
getJavaxSchema
- Specified by:
getJavaxSchema
in interfaceSchemaRegistryState
-
getNamespacePrefixMapper
Description copied from interface:SchemaRegistryState
// * @return System-wide "standard prefixes" registry. //- Specified by:
getNamespacePrefixMapper
in interfaceSchemaRegistryState
-
findItemDefinitionsByCompileTimeClass
@NotNull public <ID extends ItemDefinition> @NotNull List<ID> findItemDefinitionsByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStore
Looking up item definitions by compile-time class. So, for example having AssignmentType.class we try to find a definition of "assignment" item. BEWARE. This method is unsound. There might be many items of AssignmentType.class.- Specified by:
findItemDefinitionsByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
findItemDefinitionByType
@Nullable public <ID extends ItemDefinition> ID findItemDefinitionByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStore
Looking up item definition by type name. So, for example having c:AssignmentType we try to find a definition of "assignment" item. BEWARE. This method is unsound. There might be many items with c:AssignmentType type.- Specified by:
findItemDefinitionByType
in interfaceGlobalDefinitionsStore
-
findItemDefinitionsByElementName
@NotNull public <ID extends ItemDefinition> @NotNull List<ID> findItemDefinitionsByElementName(@NotNull @NotNull QName elementName, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStore
Looking up item definitions by element name. The name can be qualified or unqualified. In the latter case there can be more than one definition returned.- Specified by:
findItemDefinitionsByElementName
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionByCompileTimeClass
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionByType
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByType
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionsByType
@NotNull public <TD extends TypeDefinition> @NotNull Collection<? extends TD> findTypeDefinitionsByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionsByType
in interfaceGlobalDefinitionsStore
-
findObjectDefinitionByCompileTimeClass
@Experimental public <O extends Objectable> PrismObjectDefinition<O> findObjectDefinitionByCompileTimeClass(@NotNull @NotNull Class<O> compileTimeClass) - Specified by:
findObjectDefinitionByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
findObjectDefinitionByType
public <O extends Objectable> PrismObjectDefinition<O> findObjectDefinitionByType(@NotNull @NotNull QName typeName) - Specified by:
findObjectDefinitionByType
in interfaceGlobalDefinitionsStore
-
findSchemaDescriptionByNamespace
- Specified by:
findSchemaDescriptionByNamespace
in interfaceSchemaRegistryState
-
findSchemaDescriptionByPrefix
- Specified by:
findSchemaDescriptionByPrefix
in interfaceSchemaRegistryState
-
getDerivedObject
public <R,E extends Exception> R getDerivedObject(SchemaRegistryState.DerivationKey<R> derivationKey, CheckedFunction<SchemaRegistryState, R, throws EE> mapping) Description copied from interface:SchemaRegistryState
Returns derived value specific to this schema context state, supplied derivation key and mapping. Returns cached value if it was already computed and is available. If value is not available, it is computed by supplied mapping function. Do not use for short-lived values. Use-cases should be like caching parser instances with already done lookups for repository or other long-lived components, which needs to be recomputed when schemas are changed.- Specified by:
getDerivedObject
in interfaceSchemaRegistryState
- Returns:
- Throws:
E
-
resolveUnqualifiedTypeName
- Specified by:
resolveUnqualifiedTypeName
in interfaceSchemaRegistryState
- Throws:
SchemaException
-
determineParentDefinition
public ComplexTypeDefinition determineParentDefinition(@NotNull @NotNull ComplexTypeDefinition child, @NotNull @NotNull ItemPath rest) - Specified by:
determineParentDefinition
in interfaceSchemaRegistryState
-
getPrismSchema
- Specified by:
getPrismSchema
in interfaceSchemaRegistryState
-
getSchemas
- Specified by:
getSchemas
in interfaceSchemaRegistryState
-
findSchemaByCompileTimeClass
- Specified by:
findSchemaByCompileTimeClass
in interfaceSchemaRegistryState
-
findSchemaByNamespace
- Specified by:
findSchemaByNamespace
in interfaceSchemaRegistryState
-
isList
@NotNull public @NotNull SchemaRegistryState.IsList isList(@Nullable @Nullable QName xsiType, @NotNull @NotNull QName elementName) Description copied from interface:SchemaRegistryState
Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.- Specified by:
isList
in interfaceSchemaRegistryState
- Returns:
- YES if it is a list, NO if it's not, MAYBE if it probably is a list but some further content-based checks are needed
-
determineClassForType
- Specified by:
determineClassForType
in interfaceSchemaRegistryState
-
getCompileTimePackages
- Specified by:
getCompileTimePackages
in interfaceSchemaRegistryState
-
determineCompileTimeClass
- Specified by:
determineCompileTimeClass
in interfaceSchemaRegistryState
-
determineCompileTimeClassInternal
- Specified by:
determineCompileTimeClassInternal
in interfaceSchemaRegistryState
-
performFreeze
protected void performFreeze()- Overrides:
performFreeze
in classAbstractFreezable
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
resolverFor
- Specified by:
resolverFor
in interfaceSchemaLookup
-
definitionFactory
- Specified by:
definitionFactory
in interfaceSchemaLookup
-
registerSchemaSpecific
public <T extends SchemaLookup.Based> void registerSchemaSpecific(Class<T> serviceClass, Function<SchemaLookup, T> factory) - Specified by:
registerSchemaSpecific
in interfaceSchemaLookup.Mutable
-
schemaSpecific
Description copied from interface:SchemaLookup
Returns schema-specific service- Specified by:
schemaSpecific
in interfaceSchemaLookup
- Type Parameters:
T
- Type of schema specific service- Returns:
- Requested service or null, if service is not available.
-