public class DefaultYangRuntimeHandler extends Object implements YangRuntimeService
| Constructor and Description |
|---|
DefaultYangRuntimeHandler(YangSerializerRegistry r,
org.onosproject.yang.model.SchemaContext c)
Creates a new YANG runtime manager.
|
| Modifier and Type | Method and Description |
|---|---|
CompositeData |
decode(CompositeStream external,
RuntimeContext c)
Decodes the external representation of a configuration model from the
specified composite stream into an in-memory representation.
|
CompositeStream |
encode(CompositeData internal,
RuntimeContext c)
Encodes the internal in-memory representation of a configuration model
to an external representation consumable from the resulting input stream.
|
public DefaultYangRuntimeHandler(YangSerializerRegistry r, org.onosproject.yang.model.SchemaContext c)
r - serializer registryc - root's schema contextpublic CompositeData decode(CompositeStream external, RuntimeContext c)
YangRuntimeServiceResource identifier stream "URI" will get decoded to resource identifier and resource data stream will get decoded to data node.
Protocols like NETCONF may opt only to have resource data without resource identifier, which implies the data node construction from logical root resource ("/").
Also protocols like NETCONF will have decorations around the input stream which will be reported back to protocol in output. Produced annotations will be in order of pre-order traversal.
decode in interface YangRuntimeServiceexternal - composite input stream carrying external
representation of configuration datac - additional YANG runtime context informationpublic CompositeStream encode(CompositeData internal, RuntimeContext c)
YangRuntimeServiceResource identifier in composite data will get encoded to resource identifier stream and data node will be encoded to resource data stream.
Logical root node "/" will be removed during encoding and will not be part of either resource identifier or data node.
Protocols like NETCONF may opt only to have data node with resource identifier as null in order to only get complete output in form of body without URI.
Also protocols like NETCONF would like to provide additional decorations for the node. These decoration should be in pre-order traversal order.
encode in interface YangRuntimeServiceinternal - in-memory representation of configuration datac - additional YANG runtime context informationCopyright © 2017. All rights reserved.