Class LayerRefinedResourceSchemaImpl
- java.lang.Object
-
- com.evolveum.midpoint.common.refinery.LayerRefinedResourceSchemaImpl
-
- All Implemented Interfaces:
LayerRefinedResourceSchema
,RefinedResourceSchema
,Freezable
,PrismContextSensitive
,DefinitionSearchImplementation
,DefinitionsStore
,GlobalDefinitionsStore
,PrismSchema
,ResourceSchema
,DebugDumpable
public class LayerRefinedResourceSchemaImpl extends Object implements LayerRefinedResourceSchema
- Author:
- semancik This class enhances RefinedResourceSchema with a layer-specific view. TODO: However, there are a few unresolved issues that should be dealt with: 1) Although it might seem to contain LayerRefinedObjectClassDefinitions (LROCDs), it is not the case: it generates them on the fly by calling LROCD.wrap method every time. 2) When accessing attributes via findItemDefinition of this object, a non-layered version of attribute container is returned.
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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, findObjectDefinitionByCompileTimeClass, findObjectDefinitionByElementName, findObjectDefinitionByType, findPropertyDefinitionByElementName, findReferenceDefinitionByElementName, findSimpleTypeDefinitionByType, findTypeDefinitionByType, findTypeDefinitionsByType
-
Methods inherited from interface com.evolveum.midpoint.prism.schema.PrismSchema
getComplexTypeDefinitions, getObjectDefinitions
-
Methods inherited from interface com.evolveum.midpoint.common.refinery.RefinedResourceSchema
getObjectDefinition, getObjectDefinition
-
Methods inherited from interface com.evolveum.midpoint.schema.processor.ResourceSchema
findObjectClassDefinition, findObjectClassDefinition, getObjectClassDefinitions, getObjectClassList
-
-
-
-
Method Detail
-
getLayer
@NotNull public @NotNull LayerType getLayer()
- Specified by:
getLayer
in interfaceLayerRefinedResourceSchema
-
getRefinedDefinitions
public List<? extends RefinedObjectClassDefinition> getRefinedDefinitions(ShadowKindType kind)
- Specified by:
getRefinedDefinitions
in interfaceRefinedResourceSchema
-
getOriginalResourceSchema
public ResourceSchema getOriginalResourceSchema()
- Specified by:
getOriginalResourceSchema
in interfaceRefinedResourceSchema
-
getRefinedDefinition
public LayerRefinedObjectClassDefinition getRefinedDefinition(ShadowKindType kind, ShadowType shadow)
- Specified by:
getRefinedDefinition
in interfaceLayerRefinedResourceSchema
- Specified by:
getRefinedDefinition
in interfaceRefinedResourceSchema
-
getNamespace
@NotNull public @NotNull String getNamespace()
Description copied from interface:PrismSchema
Returns schema namespace. All schema definitions are placed in the returned namespace.- Specified by:
getNamespace
in interfacePrismSchema
- Returns:
- schema namespace
-
getRefinedDefinition
public LayerRefinedObjectClassDefinition getRefinedDefinition(ShadowKindType kind, String intent)
Description copied from interface:RefinedResourceSchema
if null accountType is provided, default account definition is returned.- Specified by:
getRefinedDefinition
in interfaceLayerRefinedResourceSchema
- Specified by:
getRefinedDefinition
in interfaceRefinedResourceSchema
-
getDefinitions
@NotNull public @NotNull Collection<Definition> getDefinitions()
Description copied from interface:PrismSchema
Returns set of definitions. The set contains all definitions of all types that were parsed. Order of definitions is insignificant.- Specified by:
getDefinitions
in interfacePrismSchema
- Returns:
- set of definitions
-
determineCompositeObjectClassDefinition
public CompositeRefinedObjectClassDefinition determineCompositeObjectClassDefinition(ResourceShadowDiscriminator discriminator)
- Specified by:
determineCompositeObjectClassDefinition
in interfaceRefinedResourceSchema
-
determineCompositeObjectClassDefinition
public CompositeRefinedObjectClassDefinition determineCompositeObjectClassDefinition(PrismObject<ShadowType> shadow) throws SchemaException
- Specified by:
determineCompositeObjectClassDefinition
in interfaceRefinedResourceSchema
- Throws:
SchemaException
-
getDefinitions
@NotNull public <T extends Definition> @NotNull List<T> getDefinitions(@NotNull @NotNull Class<T> type)
Description copied from interface:PrismSchema
Returns set of definitions of a given type. The set contains all definitions of the given type that were parsed. Order of definitions is insignificant.- Specified by:
getDefinitions
in interfacePrismSchema
- Returns:
- set of definitions
-
determineCompositeObjectClassDefinition
public CompositeRefinedObjectClassDefinition determineCompositeObjectClassDefinition(PrismObject<ShadowType> shadow, Collection<QName> additionalAuxiliaryObjectClassQNames) throws SchemaException
- Specified by:
determineCompositeObjectClassDefinition
in interfaceRefinedResourceSchema
- Throws:
SchemaException
-
determineCompositeObjectClassDefinition
public CompositeRefinedObjectClassDefinition determineCompositeObjectClassDefinition(QName structuralObjectClassQName, ShadowKindType kind, String intent)
- Specified by:
determineCompositeObjectClassDefinition
in interfaceRefinedResourceSchema
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfacePrismContextSensitive
-
serializeToXsd
@NotNull public @NotNull Document serializeToXsd() throws SchemaException
- Specified by:
serializeToXsd
in interfacePrismSchema
- Throws:
SchemaException
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePrismSchema
-
getRefinedDefinition
public RefinedObjectClassDefinition getRefinedDefinition(ShadowKindType kind, Collection<String> intents) throws SchemaException
Description copied from interface:RefinedResourceSchema
If no intents are provided, default account definition is returned. We check whether there is only one relevant rOCD.- Specified by:
getRefinedDefinition
in interfaceRefinedResourceSchema
- Throws:
SchemaException
-
getRefinedDefinition
public LayerRefinedObjectClassDefinition getRefinedDefinition(QName typeName)
- Specified by:
getRefinedDefinition
in interfaceLayerRefinedResourceSchema
- Specified by:
getRefinedDefinition
in interfaceRefinedResourceSchema
-
getDefaultRefinedDefinition
public LayerRefinedObjectClassDefinition getDefaultRefinedDefinition(ShadowKindType kind)
- Specified by:
getDefaultRefinedDefinition
in interfaceLayerRefinedResourceSchema
- Specified by:
getDefaultRefinedDefinition
in interfaceRefinedResourceSchema
-
findRefinedDefinitionByObjectClassQName
public LayerRefinedObjectClassDefinition findRefinedDefinitionByObjectClassQName(ShadowKindType kind, QName objectClass)
- Specified by:
findRefinedDefinitionByObjectClassQName
in interfaceRefinedResourceSchema
-
findObjectClassDefinition
public ObjectClassComplexTypeDefinition findObjectClassDefinition(QName objectClassQName)
- Specified by:
findObjectClassDefinition
in interfaceRefinedResourceSchema
- Specified by:
findObjectClassDefinition
in interfaceResourceSchema
-
forLayer
public LayerRefinedResourceSchema forLayer(LayerType layer)
- Specified by:
forLayer
in interfaceRefinedResourceSchema
-
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
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
findObjectClassDefinition
public ObjectClassComplexTypeDefinition findObjectClassDefinition(ShadowKindType kind, String intent)
- Specified by:
findObjectClassDefinition
in interfaceResourceSchema
-
getRefinedDefinitions
public List<? extends RefinedObjectClassDefinition> getRefinedDefinitions()
- Specified by:
getRefinedDefinitions
in interfaceRefinedResourceSchema
-
findDefaultObjectClassDefinition
public ObjectClassComplexTypeDefinition findDefaultObjectClassDefinition(ShadowKindType kind)
- Specified by:
findDefaultObjectClassDefinition
in interfaceResourceSchema
-
toMutable
public MutableResourceSchema toMutable()
- Specified by:
toMutable
in interfaceResourceSchema
-
isImmutable
public boolean isImmutable()
- Specified by:
isImmutable
in interfaceFreezable
-
getSubstitutions
public com.google.common.collect.Multimap<QName,ItemDefinition<?>> getSubstitutions()
- Specified by:
getSubstitutions
in interfacePrismSchema
-
-