Package com.evolveum.midpoint.prism
Interface PrismContext
-
- All Superinterfaces:
ProtectorCreator
public interface PrismContext extends ProtectorCreator
- Author:
- semancik, mederly
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidadopt(Containerable containerable)<T extends Objectable>
voidadopt(ObjectDelta<T> delta)voidadopt(Objectable objectable)<C extends Containerable>
voidadopt(PrismContainer<C> object, Class<C> declaredType)<T extends Containerable>
voidadopt(PrismContainer<T> object)voidadopt(PrismContainerValue value)<C extends Containerable,O extends Objectable>
voidadopt(PrismContainerValue<C> prismContainerValue, Class<O> type, ItemPath path)<C extends Containerable>
voidadopt(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path)<C extends Containerable,O extends Objectable>
voidadopt(C containerable, Class<O> type, ItemPath path)voidconfigurePolyStringNormalizer(PolyStringNormalizerConfigurationType configuration)CanonicalItemPathcreateCanonicalItemPath(ItemPath itemPath)TemporaryCanonicalItemPathcreateCanonicalItemPath(ItemPath itemPath, QName objectType)Temporary<O extends Objectable>
@NotNull PrismObject<O>createKnownObject(@NotNull Class<O> clazz)Creates a new PrismObject of a given static type.<O extends Objectable>
OcreateKnownObjectable(@NotNull Class<O> clazz)Creates a new Objectable of a given static type.<O extends Objectable>
@NotNull PrismObject<O>createObject(@NotNull Class<O> clazz)Creates a new PrismObject of a given type.<O extends Objectable>
OcreateObjectable(@NotNull Class<O> clazz)Creates a new Objectable of a given type.ParsingContextcreateParsingContextForAllowMissingRefTypes()ParsingContextcreateParsingContextForCompatibilityMode()default PrismQueryLanguageParsercreateQueryParser()PrismQueryLanguageParsercreateQueryParser(Map<String,String> prefixToNamespace)@NotNull DefinitionFactorydefinitionFactory()@NotNull DeltaFactorydeltaFactory()Access point to the "old" way of creating deltas.<C extends Containerable>
S_ItemEntrydeltaFor(Class<C> objectClass)@NotNull StringdetectLanguage(@NotNull File file)@NotNull PrismSerializer<Element>domSerializer()Creates a serializer for DOM.UniformItemPathemptyPath()static PrismContextget()ParsingContextgetDefaultParsingContext()@NotNull PolyStringNormalizergetDefaultPolyStringNormalizer()Returns the default PolyString normalizer.ProtectorgetDefaultProtector()Returns the default protector.QNamegetDefaultReferenceTypeName()Type name for serialization of Referencable that's not of XML type (e.g.QNamegetDefaultRelation()If defined, it is considered to be the same as the relation of 'null'.QNamegetExtensionContainerTypeName()PrismMonitorgetMonitor()QNamegetObjectsElementName()If defined, marks the 'multiple objects' element.ParsingMigratorgetParsingMigrator()EquivalenceStrategygetProvenanceEquivalenceStrategy()@NotNull QueryConvertergetQueryConverter()@NotNull SchemaRegistrygetSchemaRegistry()Returns the schema registry.ValueMetadataFactorygetValueMetadataFactory()Hackshacks()voidinitialize()Initializes the prism context, e.g.booleanisDefaultRelation(QName relation)@NotNull ItemFactoryitemFactory()@NotNull ItemPathParseritemPathParser()@NotNull PrismSerializer<String>jsonSerializer()Creates a serializer for JSON language.default <T extends Objectable>
PrismObject<T>parseObject(File file)default <T extends Objectable>
PrismObject<T>parseObject(String dataString)@NotNull PrismParserNoIOparserFor(@NotNull RootXNode xnode)Creates a parser ready to process data from the given XNode tree.@NotNull PrismParserparserFor(@NotNull File file)Creates a parser ready to process the given file.@NotNull PrismParserparserFor(@NotNull InputStream stream)Creates a parser ready to process data from the given input stream.@NotNull PrismParserNoIOparserFor(@NotNull String data)Creates a parser ready to process data from the given string.@NotNull PrismParserNoIOparserFor(@NotNull Element element)Creates a parser ready to process data from the given DOM element.UniformItemPathpath(Object... namesOrIdsOrSegments)@NotNull QueryFactoryqueryFactory()Access point to the "old" way of creating queries, filters and paging instructions.S_FilterEntryOrEmptyqueryFor(Class<? extends Containerable> type)Starts a query builder with the goal of creating a query targeted at given object or container type.PrismQuerySerializerquerySerializer()booleanrelationMatches(@NotNull List<QName> relationQuery, QName relation)Returns true of any of the relation in the relationQuery list matches specified relation.booleanrelationMatches(QName relationQuery, QName relation)booleanrelationsEquivalent(QName relation1, QName relation2)@NotNull SchemaFactoryschemaFactory()@NotNull PrismSerializer<String>serializerFor(@NotNull String language)Creates a serializer for the given language.voidsetDefaultRelation(QName name)voidsetExtensionContainerTypeName(QName typeName)voidsetExtraValidation(boolean value)voidsetMonitor(PrismMonitor monitor)voidsetParsingMigrator(ParsingMigrator migrator)voidsetValueMetadataFactory(ValueMetadataFactory factory)default ItemPathtoPath(ItemPathType path)@NotNull UniformItemPathtoUniformPath(ItemPath path)TemporaryUniformItemPathtoUniformPath(ItemPathType path)@Nullable UniformItemPathtoUniformPathKeepNull(ItemPath path)@NotNull PrismSerializer<String>xmlSerializer()Creates a serializer for XML language.XNodeFactoryxnodeFactory()XNodeMutatorxnodeMutator()@NotNull PrismSerializer<RootXNode>xnodeSerializer()Creates a serializer for XNode.@NotNull PrismSerializer<String>yamlSerializer()Creates a serializer for YAML language.-
Methods inherited from interface com.evolveum.midpoint.prism.crypto.ProtectorCreator
createInitializedProtector, createProtector
-
-
-
-
Field Detail
-
LANG_XML
static final String LANG_XML
- See Also:
- Constant Field Values
-
LANG_JSON
static final String LANG_JSON
- See Also:
- Constant Field Values
-
LANG_YAML
static final String LANG_YAML
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
void initialize() throws SchemaException, SAXException, IOExceptionInitializes the prism context, e.g. loads and parses all the schemas.- Throws:
SchemaExceptionSAXExceptionIOException
-
configurePolyStringNormalizer
void configurePolyStringNormalizer(PolyStringNormalizerConfigurationType configuration) throws ClassNotFoundException, InstantiationException, IllegalAccessException
-
getSchemaRegistry
@NotNull @NotNull SchemaRegistry getSchemaRegistry()
Returns the schema registry.
-
getDefaultPolyStringNormalizer
@NotNull @NotNull PolyStringNormalizer getDefaultPolyStringNormalizer()
Returns the default PolyString normalizer.
-
getDefaultProtector
Protector getDefaultProtector()
Returns the default protector.
-
getQueryConverter
@NotNull @NotNull QueryConverter getQueryConverter()
-
parserFor
@NotNull @NotNull PrismParser parserFor(@NotNull @NotNull File file)
Creates a parser ready to process the given file.- Parameters:
file- File to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content of the file.
-
parserFor
@NotNull @NotNull PrismParser parserFor(@NotNull @NotNull InputStream stream)
Creates a parser ready to process data from the given input stream.- Parameters:
stream- Input stream to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content of the input stream.
-
parserFor
@NotNull @NotNull PrismParserNoIO parserFor(@NotNull @NotNull String data)
Creates a parser ready to process data from the given string. Format/language of the data will be auto-detected, so the typically followingPrismParser.language(String)can be omitted.- Parameters:
data- String with the data to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content.
-
parserFor
@NotNull @NotNull PrismParserNoIO parserFor(@NotNull @NotNull RootXNode xnode)
Creates a parser ready to process data from the given XNode tree.- Parameters:
xnode- XNode tree with the data to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content.
-
parserFor
@NotNull @NotNull PrismParserNoIO parserFor(@NotNull @NotNull Element element)
Creates a parser ready to process data from the given DOM element.- Parameters:
element- Element with the data to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content.
-
detectLanguage
@NotNull @NotNull String detectLanguage(@NotNull @NotNull File file) throws IOException
- Throws:
IOException
-
parseObject
default <T extends Objectable> PrismObject<T> parseObject(File file) throws SchemaException, IOException
- Throws:
SchemaExceptionIOException
-
parseObject
default <T extends Objectable> PrismObject<T> parseObject(String dataString) throws SchemaException
- Throws:
SchemaException
-
getParsingMigrator
ParsingMigrator getParsingMigrator()
-
setParsingMigrator
void setParsingMigrator(ParsingMigrator migrator)
-
adopt
<C extends Containerable> void adopt(PrismContainer<C> object, Class<C> declaredType) throws SchemaException
- Throws:
SchemaException
-
adopt
<T extends Containerable> void adopt(PrismContainer<T> object) throws SchemaException
- Throws:
SchemaException
-
adopt
void adopt(Objectable objectable) throws SchemaException
- Throws:
SchemaException
-
adopt
void adopt(Containerable containerable) throws SchemaException
- Throws:
SchemaException
-
adopt
void adopt(PrismContainerValue value) throws SchemaException
- Throws:
SchemaException
-
adopt
<T extends Objectable> void adopt(ObjectDelta<T> delta) throws SchemaException
- Throws:
SchemaException
-
adopt
<C extends Containerable,O extends Objectable> void adopt(C containerable, Class<O> type, ItemPath path) throws SchemaException
- Throws:
SchemaException
-
adopt
<C extends Containerable,O extends Objectable> void adopt(PrismContainerValue<C> prismContainerValue, Class<O> type, ItemPath path) throws SchemaException
- Throws:
SchemaException
-
adopt
<C extends Containerable> void adopt(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path) throws SchemaException
- Throws:
SchemaException
-
serializerFor
@NotNull @NotNull PrismSerializer<String> serializerFor(@NotNull @NotNull String language)
Creates a serializer for the given language.- Parameters:
language- Language (like xml, json, yaml).- Returns:
- The serializer.
-
xmlSerializer
@NotNull @NotNull PrismSerializer<String> xmlSerializer()
Creates a serializer for XML language.- Returns:
- The serializer.
-
jsonSerializer
@NotNull @NotNull PrismSerializer<String> jsonSerializer()
Creates a serializer for JSON language.- Returns:
- The serializer.
-
yamlSerializer
@NotNull @NotNull PrismSerializer<String> yamlSerializer()
Creates a serializer for YAML language.- Returns:
- The serializer.
-
domSerializer
@NotNull @NotNull PrismSerializer<Element> domSerializer()
Creates a serializer for DOM. The difference from XML serializer is that XML produces String output whereas this one produces a DOM Element.- Returns:
- The serializer.
-
xnodeSerializer
@NotNull @NotNull PrismSerializer<RootXNode> xnodeSerializer()
Creates a serializer for XNode. The output of this serializer is intermediate XNode representation.- Returns:
- The serializer.
-
createObject
@NotNull <O extends Objectable> @NotNull PrismObject<O> createObject(@NotNull @NotNull Class<O> clazz) throws SchemaException
Creates a new PrismObject of a given type.- Parameters:
clazz- Static type of the object to be created.- Returns:
- New PrismObject.
- Throws:
SchemaException- If a definition for the given class couldn't be found.
-
createObjectable
@NotNull <O extends Objectable> O createObjectable(@NotNull @NotNull Class<O> clazz) throws SchemaException
Creates a new Objectable of a given type.- Parameters:
clazz- Static type of the object to be created.- Returns:
- New PrismObject's objectable content.
- Throws:
SchemaException- If a definition for the given class couldn't be found.
-
createKnownObject
@NotNull <O extends Objectable> @NotNull PrismObject<O> createKnownObject(@NotNull @NotNull Class<O> clazz)
Creates a new PrismObject of a given static type. It is expected that the type exists, so any SchemaExceptions will be thrown as run-time exception.- Parameters:
clazz- Static type of the object to be created.- Returns:
- New PrismObject.
-
createKnownObjectable
@NotNull <O extends Objectable> O createKnownObjectable(@NotNull @NotNull Class<O> clazz)
Creates a new Objectable of a given static type. It is expected that the type exists, so any SchemaExceptions will be thrown as run-time exception.- Parameters:
clazz- Static type of the object to be created.- Returns:
- New PrismObject's objectable content.
-
getMonitor
PrismMonitor getMonitor()
-
setMonitor
void setMonitor(PrismMonitor monitor)
-
getDefaultRelation
QName getDefaultRelation()
If defined, it is considered to be the same as the relation of 'null'. Currently in midPoint, it is the value of org:default.
-
setDefaultRelation
void setDefaultRelation(QName name)
-
getObjectsElementName
QName getObjectsElementName()
If defined, marks the 'multiple objects' element.
-
getDefaultReferenceTypeName
@Experimental QName getDefaultReferenceTypeName()
Type name for serialization of Referencable that's not of XML type (e.g. DefaultReferencableImpl). In midPoint it's c:ObjectReferenceType.VERY EXPERIMENTAL. Maybe we should simply use t:ObjectReferenceType in such cases.
-
isDefaultRelation
boolean isDefaultRelation(QName relation)
-
relationMatches
boolean relationMatches(@NotNull @NotNull List<QName> relationQuery, QName relation)Returns true of any of the relation in the relationQuery list matches specified relation.
-
getExtensionContainerTypeName
@Experimental QName getExtensionContainerTypeName()
- Returns:
- Name of the generic type for object/container extension (e.g. c:ExtensionType).
-
setExtensionContainerTypeName
void setExtensionContainerTypeName(QName typeName)
-
getDefaultParsingContext
ParsingContext getDefaultParsingContext()
-
createParsingContextForAllowMissingRefTypes
ParsingContext createParsingContextForAllowMissingRefTypes()
-
createParsingContextForCompatibilityMode
ParsingContext createParsingContextForCompatibilityMode()
-
emptyPath
UniformItemPath emptyPath()
-
path
UniformItemPath path(Object... namesOrIdsOrSegments)
-
hacks
Hacks hacks()
-
xnodeFactory
XNodeFactory xnodeFactory()
-
xnodeMutator
XNodeMutator xnodeMutator()
-
toUniformPath
@NotNull @NotNull UniformItemPath toUniformPath(ItemPath path)
Temporary
-
toUniformPathKeepNull
@Nullable @Nullable UniformItemPath toUniformPathKeepNull(ItemPath path)
-
toUniformPath
UniformItemPath toUniformPath(ItemPathType path)
-
toPath
default ItemPath toPath(ItemPathType path)
-
createCanonicalItemPath
CanonicalItemPath createCanonicalItemPath(ItemPath itemPath, QName objectType)
Temporary
-
createCanonicalItemPath
CanonicalItemPath createCanonicalItemPath(ItemPath itemPath)
Temporary
-
deltaFor
<C extends Containerable> S_ItemEntry deltaFor(Class<C> objectClass) throws SchemaException
- Throws:
SchemaException
-
queryFor
S_FilterEntryOrEmpty queryFor(Class<? extends Containerable> type)
Starts a query builder with the goal of creating a query targeted at given object or container type.- Parameters:
type- Type of object or container values queried. This information is needed to resolve the definitions of items (properties, references, containers) used in query formulation. It is _not_ meant to restrict the objects returned when the query is eventually applied. If you want to restrict the type of objects returned right in the query (and not just when making e.g. the `searchObjects` call), please consider usingS_AtomicFilterEntry.type(Class)orS_AtomicFilterEntry.type(QName).
-
deltaFactory
@NotNull @NotNull DeltaFactory deltaFactory()
Access point to the "old" way of creating deltas. It is generally considered deprecated. DeltaBuilder (accessed via deltaFor method) should be used instead.However, because there is some functionality (like creation of empty deltas) that is not covered by the delta builder, we keep this method not marked as deprecated. Only particular parts of DeltaFactory are marked as deprecated.
-
queryFactory
@NotNull @NotNull QueryFactory queryFactory()
Access point to the "old" way of creating queries, filters and paging instructions. It is generally considered deprecated. QueryBuilder (accessed via queryFor method) should be used instead.However, because there is some functionality (like creation of standalone paging instructions) that is not covered by the query builder, we keep this method not marked as deprecated. Only particular parts of QueryFactory are marked as deprecated.
-
itemFactory
@NotNull @NotNull ItemFactory itemFactory()
-
definitionFactory
@NotNull @NotNull DefinitionFactory definitionFactory()
-
itemPathParser
@NotNull @NotNull ItemPathParser itemPathParser()
-
setExtraValidation
@Experimental void setExtraValidation(boolean value)
-
schemaFactory
@NotNull @NotNull SchemaFactory schemaFactory()
-
setValueMetadataFactory
@Experimental void setValueMetadataFactory(ValueMetadataFactory factory)
-
getValueMetadataFactory
@Experimental ValueMetadataFactory getValueMetadataFactory()
-
getProvenanceEquivalenceStrategy
@Experimental EquivalenceStrategy getProvenanceEquivalenceStrategy()
-
createQueryParser
default PrismQueryLanguageParser createQueryParser()
-
createQueryParser
PrismQueryLanguageParser createQueryParser(Map<String,String> prefixToNamespace)
-
querySerializer
PrismQuerySerializer querySerializer()
-
get
static PrismContext get()
-
-