Interface SchemaContext
-
- All Superinterfaces:
ActionNodeContainer
,AddedByUsesAware
,AugmentationTarget
,ContainerLike
,CopyableNode
,DataNodeContainer
,DataSchemaNode
,DocumentedNode
,DocumentedNode.WithStatus
,org.opendaylight.yangtools.concepts.Immutable
,MustConstraintAware
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Immutable>
,NotificationNodeContainer
,SchemaNode
,WhenConditionAware
- All Known Subinterfaces:
EffectiveModelContext
public interface SchemaContext extends ContainerLike, org.opendaylight.yangtools.concepts.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
-
-
Field Summary
Fields Modifier and Type Field Description static @NonNull org.opendaylight.yangtools.yang.common.QName
NAME
QName of NETCONF top-level data node.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Optional<Boolean>
effectiveConfig()
Deprecated.default Optional<ActionDefinition>
findAction(org.opendaylight.yangtools.yang.common.QName qname)
Deprecated.default Optional<DataSchemaNode>
findDataTreeChild(org.opendaylight.yangtools.yang.common.QName name)
Returns adata node
identified by a QName.Optional<Module>
findModule(@NonNull org.opendaylight.yangtools.yang.common.QNameModule qnameModule)
Returns the module matching specifiedQNameModule
, if present.default Optional<Module>
findModule(@NonNull org.opendaylight.yangtools.yang.common.XMLNamespace namespace)
Returns module instance (from the context) with specified namespace and no revision.default Optional<Module>
findModule(@NonNull org.opendaylight.yangtools.yang.common.XMLNamespace namespace, @NonNull Optional<org.opendaylight.yangtools.yang.common.Revision> revision)
Returns module instance (from the context) with specified namespace and revision.default Optional<Module>
findModule(@NonNull org.opendaylight.yangtools.yang.common.XMLNamespace namespace, @Nullable org.opendaylight.yangtools.yang.common.Revision revision)
Returns module instance (from the context) with specified namespace and revision.default Optional<? extends Module>
findModule(String name)
Returns module instance (from the context) with specified name and no revision.default Optional<? extends Module>
findModule(String name, @Nullable org.opendaylight.yangtools.yang.common.Revision revision)
Returns module instance (from the context) with specified name and revision.default Optional<? extends Module>
findModule(String name, Optional<org.opendaylight.yangtools.yang.common.Revision> revision)
Returns module instance (from the context) with specified name and an optional revision.default @NonNull Collection<? extends @NonNull Module>
findModules(String name)
Returns module instances (from the context) with a concrete name.default @NonNull Collection<? extends @NonNull Module>
findModules(org.opendaylight.yangtools.yang.common.XMLNamespace namespace)
Returns module instance (from the context) with concrete namespace.default Optional<NotificationDefinition>
findNotification(org.opendaylight.yangtools.yang.common.QName qname)
Find a notification based on its QName.default Collection<? extends ActionDefinition>
getActions()
Deprecated.default Collection<? extends AugmentationSchemaNode>
getAvailableAugmentations()
Deprecated.@NonNull Collection<? extends @NonNull DataSchemaNode>
getDataDefinitions()
Returns data schema node instances which represents direct subnodes (like leaf, leaf-list, list, container) in all YANG modules in the context.@NonNull Collection<? extends IdentitySchemaNode>
getDerivedIdentities(IdentitySchemaNode identity)
Get identities derived from a selected identity.default Optional<String>
getDescription()
Deprecated.@NonNull Collection<? extends ExtensionDefinition>
getExtensions()
Returns extension definition instances which are defined as the direct subelements in all YANG modules in the context.@NonNull Collection<? extends @NonNull Module>
getModules()
Returns modules which are part of the schema context.default Collection<? extends @NonNull MustDefinition>
getMustConstraints()
Deprecated.@NonNull Collection<? extends @NonNull RpcDefinition>
getOperations()
Returns rpc definition instances which are defined as the direct subelements in all YANG modules in the context.default SchemaPath
getPath()
Deprecated.default org.opendaylight.yangtools.yang.common.QName
getQName()
Deprecated.default Optional<String>
getReference()
Deprecated.default Status
getStatus()
Deprecated.default Collection<? extends UsesNode>
getUses()
Deprecated.default Optional<? extends org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression.QualifiedBound>
getWhenCondition()
Deprecated.default boolean
isAddedByUses()
Deprecated.default boolean
isAugmenting()
Deprecated.-
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DataNodeContainer
dataChildByName, findDataChildByName, findDataChildByName, findDataTreeChild, findDataTreeChild, getChildNodes, getDataChildByName, getGroupings, getTypeDefinitions
-
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.NotificationNodeContainer
getNotifications
-
-
-
-
Method Detail
-
getDataDefinitions
@NonNull Collection<? extends @NonNull 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
@NonNull Collection<? extends @NonNull 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 byModuleLike.getName()
orQNameModuleAware.getNamespace()
, modules having the same attribute are encountered newest revision first.- Returns:
- set of the modules which belong to the schema context
-
getOperations
@NonNull Collection<? extends @NonNull 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
@NonNull Collection<? extends 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 org.opendaylight.yangtools.yang.common.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 org.opendaylight.yangtools.yang.common.XMLNamespace 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 org.opendaylight.yangtools.yang.common.XMLNamespace namespace, @Nullable org.opendaylight.yangtools.yang.common.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 org.opendaylight.yangtools.yang.common.XMLNamespace namespace, @NonNull Optional<org.opendaylight.yangtools.yang.common.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<? extends Module> findModule(String name, Optional<org.opendaylight.yangtools.yang.common.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<? extends Module> findModule(String name, @Nullable org.opendaylight.yangtools.yang.common.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<? extends 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 @NonNull Collection<? extends @NonNull 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 @NonNull Collection<? extends @NonNull Module> findModules(org.opendaylight.yangtools.yang.common.XMLNamespace 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
- XMLNamespace instance with specified namespace- Returns:
- module instance which has namespace equal to the
namespace
ornull
in other cases
-
getActions
@Deprecated default Collection<? extends ActionDefinition> getActions()
Deprecated.Description copied from interface:ActionNodeContainer
Return the set of actions.- Specified by:
getActions
in interfaceActionNodeContainer
- Returns:
- set of action nodes
-
findAction
@Deprecated default Optional<ActionDefinition> findAction(org.opendaylight.yangtools.yang.common.QName qname)
Deprecated.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(org.opendaylight.yangtools.yang.common.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
@Deprecated default Optional<String> getDescription()
Deprecated.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
@Deprecated default Optional<String> getReference()
Deprecated.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
@Deprecated default Collection<? extends @NonNull MustDefinition> getMustConstraints()
Deprecated.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
@Deprecated default Optional<? extends org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression.QualifiedBound> getWhenCondition()
Deprecated.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
-
isAugmenting
@Deprecated default boolean isAugmenting()
Deprecated.Description copied from interface:CopyableNode
Returnstrue
if this node was added by augmentation, otherwise returnsfalse
.- Specified by:
isAugmenting
in interfaceCopyableNode
- Returns:
true
if this node was added by augmentation, otherwise returnsfalse
-
isAddedByUses
@Deprecated default boolean isAddedByUses()
Deprecated.Description copied from interface:AddedByUsesAware
Returnstrue
if this node was added by uses statement, otherwise returnsfalse
.- Specified by:
isAddedByUses
in interfaceAddedByUsesAware
- Returns:
true
if this node was added by uses statement, otherwise returnsfalse
-
effectiveConfig
@Deprecated default Optional<Boolean> effectiveConfig()
Deprecated.Description copied from interface:DataSchemaNode
Return the effective value ofconfig
substatement, if applicable.- Specified by:
effectiveConfig
in interfaceDataSchemaNode
- Returns:
- Effective
config
value, orOptional.empty()
not applicable.
-
getQName
@Deprecated default org.opendaylight.yangtools.yang.common.QName getQName()
Deprecated.Description copied from interface:SchemaNode
Returns QName of the instance of the typeSchemaNode
.- Specified by:
getQName
in interfaceSchemaNode
- Returns:
- QName with the name of the schema node
-
getPath
@Deprecated default SchemaPath getPath()
Deprecated.Description copied from interface:SchemaNode
Returns the schema path of the instance of the typeSchemaNode
.The default implementation throws an
UnsupportedOperationException
.- Specified by:
getPath
in interfaceSchemaNode
- Returns:
- schema path of the schema node
-
getStatus
@Deprecated default Status getStatus()
Deprecated.Description copied from interface:DocumentedNode.WithStatus
Returns status of the instance of the typeSchemaNode
.- Specified by:
getStatus
in interfaceDocumentedNode.WithStatus
- Returns:
- status of this node which represents the argument of the YANG
status
substatement
-
getUses
@Deprecated default Collection<? extends UsesNode> getUses()
Deprecated.Description copied from interface:DataNodeContainer
Returns grouping nodes used ny this container.- Specified by:
getUses
in interfaceDataNodeContainer
- Returns:
- Set of all uses nodes defined within this DataNodeContainer
-
getAvailableAugmentations
@Deprecated default Collection<? extends AugmentationSchemaNode> getAvailableAugmentations()
Deprecated.Description copied from interface:AugmentationTarget
Returns augmentations targeting this element.- Specified by:
getAvailableAugmentations
in interfaceAugmentationTarget
- Returns:
- set of augmentations targeting this element.
-
findDataTreeChild
@Beta default Optional<DataSchemaNode> findDataTreeChild(org.opendaylight.yangtools.yang.common.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
-
getDerivedIdentities
@Beta @NonNull Collection<? extends IdentitySchemaNode> getDerivedIdentities(IdentitySchemaNode identity)
Get identities derived from a selected identity.- Parameters:
identity
- base identity- Returns:
- collection of identities derived from this identity
- Throws:
NullPointerException
- if identity is nullIllegalArgumentException
- if the specified identity is not present in this context
-
-