Interface SchemaContext

All Superinterfaces:
ActionNodeContainer, AddedByUsesAware, AugmentationTarget, ContainerLike, CopyableNode, DataNodeContainer, DataSchemaNode, DocumentedNode, DocumentedNode.WithStatus, Immutable, MustConstraintAware, NotificationNodeContainer, SchemaNode, WhenConditionAware
All Known Subinterfaces:
AnnotationSchemaNodeAwareSchemaContext, EffectiveModelContext
All Known Implementing Classes:
AbstractSchemaContext, EffectiveSchemaContext, FilteringSchemaContextProxy, SimpleSchemaContext

public interface SchemaContext extends ContainerLike, 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.
  • Field Details

    • NAME

      static final @NonNull QName NAME
      QName of NETCONF top-level data node.
  • Method Details

    • 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 by ModuleLike.getName() or QNameModuleAware.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 via rpc 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 via extension YANG keyword
    • findModule

      Optional<Module> findModule(@NonNull QNameModule qnameModule)
      Returns the module matching specified QNameModule, if present.
      Parameters:
      qnameModule - requested QNameModule
      Returns:
      Module, if present.
      Throws:
      NullPointerException - if qnameModule is null
    • findModule

      default Optional<Module> findModule(@NonNull 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 XMLNamespace namespace, @Nullable Revision revision)
      Returns module instance (from the context) with specified namespace and revision.
      Parameters:
      namespace - module namespace
      revision - module revision, may be null
      Returns:
      module instance which has name and revision the same as are the values specified in parameters namespace and revision.
    • findModule

      default Optional<Module> findModule(@NonNull XMLNamespace namespace, @NonNull Optional<Revision> revision)
      Returns module instance (from the context) with specified namespace and revision.
      Parameters:
      namespace - module namespace
      revision - module revision, may be null
      Returns:
      module instance which has name and revision the same as are the values specified in parameters namespace and revision.
    • findModule

      default Optional<? extends 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 name
      revision - date of the module revision
      Returns:
      module instance which has name and revision the same as are the values specified in parameters name and revision.
    • findModule

      default Optional<? extends Module> findModule(String name, @Nullable Revision revision)
      Returns module instance (from the context) with specified name and revision.
      Parameters:
      name - string with the module name
      revision - 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 and revision.
    • 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(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 or null 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 interface ActionNodeContainer
      Returns:
      set of action nodes
    • findAction

      @Deprecated default Optional<ActionDefinition> findAction(QName qname)
      Deprecated.
      Description copied from interface: ActionNodeContainer
      Find an action based on its QName. Default implementation searches the set returned by ActionNodeContainer.getActions().
      Specified by:
      findAction in interface ActionNodeContainer
      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 by NotificationNodeContainer.getNotifications().
      Specified by:
      findNotification in interface NotificationNodeContainer
      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 YANG description keyword.
      Specified by:
      getDescription in interface DocumentedNode
      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 YANG reference keyword.
      Specified by:
      getReference in interface DocumentedNode
      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 contains must YANG substatement has to match.
      Specified by:
      getMustConstraints in interface MustConstraintAware
      Returns:
      collection of MustDefinition (XPath) instances which represents the concrete data constraints
    • getWhenCondition

      @Deprecated default Optional<? extends 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 interface WhenConditionAware
      Returns:
      XPath condition
    • isAugmenting

      @Deprecated default boolean isAugmenting()
      Deprecated.
      Description copied from interface: CopyableNode
      Returns true if this node was added by augmentation, otherwise returns false.
      Specified by:
      isAugmenting in interface CopyableNode
      Returns:
      true if this node was added by augmentation, otherwise returns false
    • isAddedByUses

      @Deprecated default boolean isAddedByUses()
      Deprecated.
      Description copied from interface: AddedByUsesAware
      Returns true if this node was added by uses statement, otherwise returns false.
      Specified by:
      isAddedByUses in interface AddedByUsesAware
      Returns:
      true if this node was added by uses statement, otherwise returns false
    • effectiveConfig

      @Deprecated default Optional<Boolean> effectiveConfig()
      Deprecated.
      Description copied from interface: DataSchemaNode
      Return the effective value of config substatement, if applicable.
      Specified by:
      effectiveConfig in interface DataSchemaNode
      Returns:
      Effective config value, or Optional.empty() not applicable.
    • getQName

      @Deprecated default QName getQName()
      Deprecated.
      Description copied from interface: SchemaNode
      Returns QName of the instance of the type SchemaNode.
      Specified by:
      getQName in interface SchemaNode
      Returns:
      QName with the name of the schema node
    • getStatus

      @Deprecated default Status getStatus()
      Deprecated.
      Description copied from interface: DocumentedNode.WithStatus
      Returns status of the instance of the type SchemaNode.
      Specified by:
      getStatus in interface DocumentedNode.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 interface DataNodeContainer
      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 interface AugmentationTarget
      Returns:
      set of augmentations targeting this element.
    • findDataTreeChild

      @Beta default Optional<DataSchemaNode> findDataTreeChild(QName name)
      Description copied from interface: DataNodeContainer
      Returns a data node identified by a QName. This method is distinct from DataNodeContainer.findDataChildByName(QName) in that it skips over ChoiceSchemaNodes and CaseSchemaNodes, hence mirroring layout of the data tree, not schema tree.
      Specified by:
      findDataTreeChild in interface DataNodeContainer
      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 null
      IllegalArgumentException - if the specified identity is not present in this context