Interface SchemaContext
-
- All Superinterfaces:
ActionNodeContainer
,AddedByUsesAware
,AugmentationTarget
,ContainerSchemaNode
,CopyableNode
,DataNodeContainer
,DataSchemaNode
,DocumentedNode
,DocumentedNode.WithStatus
,Immutable
,MustConstraintAware
,MutationBehaviour<Immutable>
,NotificationNodeContainer
,SchemaNode
,WhenConditionAware
- All Known Subinterfaces:
AnnotationSchemaNodeAwareSchemaContext
,EffectiveModelContext
- All Known Implementing Classes:
AbstractSchemaContext
,EffectiveSchemaContext
,FilteringSchemaContextProxy
,SimpleSchemaContext
public interface SchemaContext extends ContainerSchemaNode, Immutable
The interface represents static view of compiled yang files, contains the methods for obtaining all the top level context data (data from all modules) like YANG notifications, extensions, operations... Instances MUST be immutable and thus usage in multi threaded environment is safe.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opendaylight.yangtools.yang.model.api.DocumentedNode
DocumentedNode.WithStatus
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Optional<ActionDefinition>
findAction(QName qname)
Find an action based on its QName.default Optional<DataSchemaNode>
findDataTreeChild(QName name)
Returns adata node
identified by a QName.default Optional<Module>
findModule(@NonNull URI namespace)
Returns module instance (from the context) with specified namespace and no revision.default Optional<Module>
findModule(@NonNull URI namespace, @NonNull Optional<Revision> revision)
Returns module instance (from the context) with specified namespace and revision.default Optional<Module>
findModule(@NonNull URI namespace, @Nullable Revision revision)
Returns module instance (from the context) with specified namespace and revision.Optional<Module>
findModule(@NonNull QNameModule qnameModule)
Returns the module matching specifiedQNameModule
, if present.default Optional<Module>
findModule(String name)
Returns module instance (from the context) with specified name and no revision.default Optional<Module>
findModule(String name, @Nullable Revision revision)
Returns module instance (from the context) with specified name and revision.default Optional<Module>
findModule(String name, Optional<Revision> revision)
Returns module instance (from the context) with specified name and an optional revision.default Set<Module>
findModules(String name)
Returns module instances (from the context) with a concrete name.default Set<Module>
findModules(URI namespace)
Returns module instance (from the context) with concrete namespace.default Optional<NotificationDefinition>
findNotification(QName qname)
Find a notification based on its QName.default Set<ActionDefinition>
getActions()
Return the set of actions.Set<DataSchemaNode>
getDataDefinitions()
Returns data schema node instances which represents direct subnodes (like leaf, leaf-list, list, container) in all YANG modules in the context.default Optional<String>
getDescription()
Returns the value of the argument of YANGdescription
keyword.Set<ExtensionDefinition>
getExtensions()
Returns extension definition instances which are defined as the direct subelements in all YANG modules in the context.Set<Module>
getModules()
Returns modules which are part of the schema context.default Collection<MustDefinition>
getMustConstraints()
Specifies the rules which the node which containsmust
YANG substatement has to match.Set<RpcDefinition>
getOperations()
Returns rpc definition instances which are defined as the direct subelements in all YANG modules in the context.default Optional<String>
getReference()
Returns the value of the argument of YANGreference
keyword.default Optional<RevisionAwareXPath>
getWhenCondition()
Returns when statement.-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.AddedByUsesAware
isAddedByUses
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.AugmentationTarget
getAvailableAugmentations
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode
isPresenceContainer
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.CopyableNode
isAugmenting
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DataNodeContainer
findDataChildByName, findDataChildByName, findDataTreeChild, findDataTreeChild, getChildNodes, getDataChildByName, getGroupings, getTypeDefinitions, getUses
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DataSchemaNode
isConfiguration
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DocumentedNode
getUnknownSchemaNodes
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DocumentedNode.WithStatus
getStatus
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.NotificationNodeContainer
getNotifications
-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.SchemaNode
getPath, getQName
-
-
-
-
Field Detail
-
NAME
static final @NonNull QName NAME
QName of NETCONF top-level data node.
-
-
Method Detail
-
getDataDefinitions
Set<DataSchemaNode> getDataDefinitions()
Returns data schema node instances which represents direct subnodes (like leaf, leaf-list, list, container) in all YANG modules in the context.- Returns:
- set of
DataSchemaNode
instances which represents YANG data nodes at the module top level
-
getModules
Set<Module> getModules()
Returns modules which are part of the schema context. Returned set is required to have its iteration ordered by module revision, so that if modules are filtered byModule.getName()
orModule.getNamespace()
, modules having the same attribute are encountered newest revision first.- Returns:
- set of the modules which belong to the schema context
-
getOperations
Set<RpcDefinition> getOperations()
Returns rpc definition instances which are defined as the direct subelements in all YANG modules in the context.- Returns:
- set of
RpcDefinition
instances which represents nodes defined viarpc
YANG keyword
-
getExtensions
Set<ExtensionDefinition> getExtensions()
Returns extension definition instances which are defined as the direct subelements in all YANG modules in the context.- Returns:
- set of
ExtensionDefinition
instances which represents nodes defined viaextension
YANG keyword
-
findModule
Optional<Module> findModule(@NonNull QNameModule qnameModule)
Returns the module matching specifiedQNameModule
, if present.- Parameters:
qnameModule
- requested QNameModule- Returns:
- Module, if present.
- Throws:
NullPointerException
- if qnameModule is null
-
findModule
default Optional<Module> findModule(@NonNull URI namespace)
Returns module instance (from the context) with specified namespace and no revision.- Parameters:
namespace
- module namespace- Returns:
- module instance which has name and revision the same as are the values specified in parameters
namespace
and no revision.
-
findModule
default Optional<Module> findModule(@NonNull URI namespace, @Nullable Revision revision)
Returns module instance (from the context) with specified namespace and revision.- Parameters:
namespace
- module namespacerevision
- module revision, may be null- Returns:
- module instance which has name and revision the same as are the values specified in parameters
namespace
andrevision
.
-
findModule
default Optional<Module> findModule(@NonNull URI namespace, @NonNull Optional<Revision> revision)
Returns module instance (from the context) with specified namespace and revision.- Parameters:
namespace
- module namespacerevision
- module revision, may be null- Returns:
- module instance which has name and revision the same as are the values specified in parameters
namespace
andrevision
.
-
findModule
default Optional<Module> findModule(String name, Optional<Revision> revision)
Returns module instance (from the context) with specified name and an optional revision.- Parameters:
name
- string with the module namerevision
- date of the module revision- Returns:
- module instance which has name and revision the same as are the values specified in parameters
name
andrevision
.
-
findModule
default Optional<Module> findModule(String name, @Nullable Revision revision)
Returns module instance (from the context) with specified name and revision.- Parameters:
name
- string with the module namerevision
- date of the module revision, may be null- Returns:
- module instance which has name and revision the same as are the values specified in parameters
name
andrevision
.
-
findModule
default Optional<Module> findModule(String name)
Returns module instance (from the context) with specified name and no revision.- Parameters:
name
- string with the module name- Returns:
- module instance which has name and revision the same as are the values specified in
name
and no revision. - Throws:
NullPointerException
- if name is null
-
findModules
default Set<Module> findModules(String name)
Returns module instances (from the context) with a concrete name. Returned Set is required to have its iteration order guarantee that the latest revision is encountered first.- Parameters:
name
- string with the module name- Returns:
- set of module instances with specified name.
-
findModules
default Set<Module> findModules(URI namespace)
Returns module instance (from the context) with concrete namespace. Returned Set is required to have its iteration order guarantee that the latest revision is encountered first.- Parameters:
namespace
- URI instance with specified namespace- Returns:
- module instance which has namespace equal to the
namespace
ornull
in other cases
-
getActions
default Set<ActionDefinition> getActions()
Description copied from interface:ActionNodeContainer
Return the set of actions.- Specified by:
getActions
in interfaceActionNodeContainer
- Returns:
- set of action nodes
-
findAction
default Optional<ActionDefinition> findAction(QName qname)
Description copied from interface:ActionNodeContainer
Find an action based on its QName. Default implementation searches the set returned byActionNodeContainer.getActions()
.- Specified by:
findAction
in interfaceActionNodeContainer
- Parameters:
qname
- Action's QName- Returns:
- Action definition, if found
-
findNotification
default Optional<NotificationDefinition> findNotification(QName qname)
Description copied from interface:NotificationNodeContainer
Find a notification based on its QName. Default implementation searches the set returned byNotificationNodeContainer.getNotifications()
.- Specified by:
findNotification
in interfaceNotificationNodeContainer
- Parameters:
qname
- Notification QName- Returns:
- Notification definition, if found
-
getDescription
default Optional<String> getDescription()
Description copied from interface:DocumentedNode
Returns the value of the argument of YANGdescription
keyword.- Specified by:
getDescription
in interfaceDocumentedNode
- Returns:
- string with the description, or empty if description was not provided.
-
getReference
default Optional<String> getReference()
Description copied from interface:DocumentedNode
Returns the value of the argument of YANGreference
keyword.- Specified by:
getReference
in interfaceDocumentedNode
- Returns:
- string with reference to some other document, or empty if reference was not provided.
-
getMustConstraints
default Collection<MustDefinition> getMustConstraints()
Description copied from interface:MustConstraintAware
Specifies the rules which the node which containsmust
YANG substatement has to match.- Specified by:
getMustConstraints
in interfaceMustConstraintAware
- Returns:
- collection of
MustDefinition
(XPath) instances which represents the concrete data constraints
-
getWhenCondition
default Optional<RevisionAwareXPath> getWhenCondition()
Description copied from interface:WhenConditionAware
Returns when statement.If when condition is present node defined by the parent data definition statement is only valid when the returned XPath expression conceptually evaluates to "true" for a particular instance, then the node defined by the parent data definition statement is valid; otherwise, it is not.
- Specified by:
getWhenCondition
in interfaceWhenConditionAware
- Returns:
- XPath condition
-
findDataTreeChild
@Beta default Optional<DataSchemaNode> findDataTreeChild(QName name)
Description copied from interface:DataNodeContainer
Returns adata node
identified by a QName. This method is distinct fromDataNodeContainer.findDataChildByName(QName)
in that it skips overChoiceSchemaNode
s andCaseSchemaNode
s, hence mirroring layout of thedata tree
, notschema tree
.- Specified by:
findDataTreeChild
in interfaceDataNodeContainer
- Parameters:
name
- QName identifier of the data node- Returns:
- Direct or indirect child of this DataNodeContainer which is a
data node
, empty otherwise
-
-