public abstract class AbstractSchemaContext extends Object implements SchemaContext
DocumentedNode.WithStatus
Modifier and Type | Field and Description |
---|---|
protected static Comparator<Module> |
NAME_REVISION_COMPARATOR
A
Module comparator based on Module.getName() and Module.getRevision() , ordering modules
lexicographically by their name and then in order of descending revision. |
protected static Comparator<Module> |
REVISION_COMPARATOR
A
Module comparator based on Module.getRevision() , placing latest revision first. |
NAME
Constructor and Description |
---|
AbstractSchemaContext() |
Modifier and Type | Method and Description |
---|---|
protected static TreeSet<Module> |
createModuleSet()
Create a TreeSet for containing Modules with the same name, such that the set is ordered
by
REVISION_COMPARATOR . |
Optional<DataSchemaNode> |
findDataChildByName(QName name)
Returns the child node corresponding to the specified name.
|
Optional<Module> |
findModule(QNameModule qnameModule)
Returns the module matching specified
QNameModule , if present. |
Optional<Module> |
findModule(String name,
Optional<Revision> revision)
Returns module instance (from the context) with specified name and an optional revision.
|
Set<Module> |
findModules(String name)
Returns module instances (from the context) with a concrete name.
|
Set<Module> |
findModules(URI namespace)
Returns module instance (from the context) with concrete namespace.
|
Set<AugmentationSchemaNode> |
getAvailableAugmentations()
Returns augmentations targeting this element.
|
Set<DataSchemaNode> |
getChildNodes()
Returns set of all child nodes defined within this DataNodeContainer.
|
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.
|
Set<ExtensionDefinition> |
getExtensions()
Returns extension definition instances which are defined as the direct
subelements in all YANG modules in the context.
|
Set<GroupingDefinition> |
getGroupings()
Returns set of all groupings defined within this DataNodeContainer.
|
protected abstract Map<QNameModule,Module> |
getModuleMap()
Returns the namespace+revision-to-module mapping.
|
protected abstract com.google.common.collect.SetMultimap<URI,Module> |
getNamespaceToModules()
Returns the namespace-to-module mapping.
|
protected abstract com.google.common.collect.SetMultimap<String,Module> |
getNameToModules()
Returns the module name-to-module mapping.
|
Set<NotificationDefinition> |
getNotifications()
Return the set of notifications in this container, keyed by QName.
|
Set<RpcDefinition> |
getOperations()
Returns rpc definition instances which are defined as the direct
subelements in all YANG modules in the context.
|
SchemaPath |
getPath()
Returns the schema path of the instance of the type
SchemaNode . |
QName |
getQName()
Returns QName of the instance of the type
SchemaNode . |
Status |
getStatus()
Returns status of the instance of the type
SchemaNode . |
Set<TypeDefinition<?>> |
getTypeDefinitions()
Returns set of all newly defined types within this DataNodeContainer.
|
List<UnknownSchemaNode> |
getUnknownSchemaNodes()
Returns unknown schema nodes which belongs to this instance.
|
Set<UsesNode> |
getUses()
Returns grouping nodes used ny this container.
|
boolean |
isAddedByUses()
Deprecated.
|
boolean |
isAugmenting()
Deprecated.
|
boolean |
isConfiguration()
Returns
true if the data represents configuration data,
otherwise returns false . |
boolean |
isPresenceContainer()
Returns true if this container is marked as presence.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findDataTreeChild, findModule, findModule, findModule, findModule, findModule, getActions, getDescription, getModules, getMustConstraints, getReference, getWhenCondition
findDataTreeChild, findDataTreeChild, getDataChildByName
protected static final Comparator<Module> REVISION_COMPARATOR
Module
comparator based on Module.getRevision()
, placing latest revision first. Note this
comparator does not take into account module name and so two modules with different names but same revisions
compare as equal.protected static final Comparator<Module> NAME_REVISION_COMPARATOR
Module
comparator based on Module.getName()
and Module.getRevision()
, ordering modules
lexicographically by their name and then in order of descending revision. This comparator assumes that
the combination of these two attributes is sufficient to be consistent with hashCode/equals.protected static final TreeSet<Module> createModuleSet()
REVISION_COMPARATOR
.protected abstract com.google.common.collect.SetMultimap<URI,Module> getNamespaceToModules()
protected abstract com.google.common.collect.SetMultimap<String,Module> getNameToModules()
protected abstract Map<QNameModule,Module> getModuleMap()
public Set<DataSchemaNode> getDataDefinitions()
SchemaContext
getDataDefinitions
in interface SchemaContext
DataSchemaNode
instances which represents
YANG data nodes at the module top levelpublic Set<NotificationDefinition> getNotifications()
NotificationNodeContainer
AugmentationSchemaNode
s, GroupingDefinition
s, ListSchemaNode
s and
ContainerSchemaNode
s can also contain NotificationDefinition
s.getNotifications
in interface NotificationNodeContainer
public Set<RpcDefinition> getOperations()
SchemaContext
getOperations
in interface SchemaContext
RpcDefinition
instances which represents
nodes defined via rpc
YANG keywordpublic Set<ExtensionDefinition> getExtensions()
SchemaContext
getExtensions
in interface SchemaContext
ExtensionDefinition
instances which
represents nodes defined via extension
YANG keywordpublic Optional<Module> findModule(String name, Optional<Revision> revision)
SchemaContext
findModule
in interface SchemaContext
name
- string with the module namerevision
- date of the module revisionname
and revision
.public Optional<Module> findModule(QNameModule qnameModule)
SchemaContext
QNameModule
, if present.findModule
in interface SchemaContext
qnameModule
- requested QNameModulepublic Set<Module> findModules(URI namespace)
SchemaContext
findModules
in interface SchemaContext
namespace
- URI instance with specified namespacenamespace
or null
in other casespublic Set<Module> findModules(String name)
SchemaContext
findModules
in interface SchemaContext
name
- string with the module name@Deprecated public boolean isAugmenting()
CopyableNode
true
if this node was added by augmentation,
otherwise returns false
.isAugmenting
in interface CopyableNode
true
if this node was added by augmentation,
otherwise returns false
@Deprecated public boolean isAddedByUses()
AddedByUsesAware
true
if this node was added by uses statement,
otherwise returns false
.isAddedByUses
in interface AddedByUsesAware
true
if this node was added by uses statement,
otherwise returns false
public boolean isConfiguration()
DataSchemaNode
true
if the data represents configuration data,
otherwise returns false
.isConfiguration
in interface DataSchemaNode
true
if the data represents configuration data,
otherwise returns false
public QName getQName()
SchemaNode
SchemaNode
.getQName
in interface SchemaNode
public SchemaPath getPath()
SchemaNode
SchemaNode
.getPath
in interface SchemaNode
public Status getStatus()
DocumentedNode.WithStatus
SchemaNode
.getStatus
in interface DocumentedNode.WithStatus
status
substatementpublic List<UnknownSchemaNode> getUnknownSchemaNodes()
DocumentedNode
getUnknownSchemaNodes
in interface DocumentedNode
public Set<TypeDefinition<?>> getTypeDefinitions()
DataNodeContainer
getTypeDefinitions
in interface DataNodeContainer
public Set<DataSchemaNode> getChildNodes()
DataNodeContainer
Note that the nodes returned are NOT data nodes
, but rather DataSchemaNode
s,
hence ChoiceSchemaNode
and CaseSchemaNode
are present instead of their children. This
is consistent with schema tree
.
getChildNodes
in interface DataNodeContainer
public Set<GroupingDefinition> getGroupings()
DataNodeContainer
getGroupings
in interface DataNodeContainer
public Optional<DataSchemaNode> findDataChildByName(QName name)
DataNodeContainer
Note that the nodes searched are NOT data nodes
, but rather DataSchemaNode
s,
hence ChoiceSchemaNode
and CaseSchemaNode
are returned instead of their matching children.
findDataChildByName
in interface DataNodeContainer
name
- QName of childpublic Set<UsesNode> getUses()
DataNodeContainer
getUses
in interface DataNodeContainer
public boolean isPresenceContainer()
ContainerSchemaNode
isPresenceContainer
in interface ContainerSchemaNode
public Set<AugmentationSchemaNode> getAvailableAugmentations()
AugmentationTarget
getAvailableAugmentations
in interface AugmentationTarget
Copyright © 2019 OpenDaylight. All rights reserved.