@Beta public class BindingNormalizedNodeCodecRegistry extends Object implements TreeNodeSerializerRegistry, BindingTreeCodecFactory, BindingNormalizedNodeWriterFactory, BindingNormalizedNodeSerializer
Constructor and Description |
---|
BindingNormalizedNodeCodecRegistry(TreeNodeSerializerGenerator generator)
Prepare generator for generating serializers and create loader for serializers.
|
Modifier and Type | Method and Description |
---|---|
BindingCodecContext |
create(BindingRuntimeContext context)
Creates Binding Codec Tree for specified Binding runtime context.
|
BindingCodecContext |
create(org.opendaylight.yangtools.yang.model.api.SchemaContext context,
Class<?>... bindingClasses)
Creates Binding Codec Tree for schema context according to binding
classes.
|
<T extends TreeNode> |
deserializeFunction(InstanceIdentifier<T> path)
Deserialize function based on tree node codec context resolved by binding path.
|
Map.Entry<InstanceIdentifier<?>,TreeNode> |
fromNormalizedNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier path,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> data)
Translates supplied YANG Instance Identifier and NormalizedNode into
Binding data.
|
Notification |
fromNormalizedNodeNotification(org.opendaylight.yangtools.yang.model.api.SchemaPath path,
org.opendaylight.yangtools.yang.data.api.schema.ContainerNode data)
Translates supplied NormalizedNode Notification into Binding data.
|
TreeNode |
fromNormalizedNodeOperationData(org.opendaylight.yangtools.yang.model.api.SchemaPath path,
org.opendaylight.yangtools.yang.data.api.schema.ContainerNode data)
Translates supplied NormalizedNode operation (RPC, Action) input or
output into Binding data.
|
InstanceIdentifier<?> |
fromYangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier dom)
Translates supplied YANG Instance Identifier into Binding instance
identifier.
|
BindingTreeCodec |
getCodecContext()
Get binding tree codec context.
|
TreeNodeSerializer |
getSerializer(Class<? extends TreeNode> type)
Returns implementation of requested serializer.
|
BindingStreamEventWriter |
newNotificationWriter(Class<? extends Notification<?>> notification,
org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
Creates a
BindingStreamEventWriter for notification which will
translate to NormalizedNode model and invoke proper events on supplied
NormalizedNodeStreamWriter . |
BindingStreamEventWriter |
newOperationWriter(Class<? extends Instantiable<?>> operationInputOrOutput,
org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
Creates a
BindingStreamEventWriter for operation data which will
translate to NormalizedNode model and invoke proper events on supplied
NormalizedNodeStreamWriter . |
BindingStreamEventWriter |
newWriter(InstanceIdentifier<?> path,
org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
Creates a
BindingStreamEventWriter for data tree path which will
translate to NormalizedNode model and invoke proper events on supplied
NormalizedNodeStreamWriter . |
Map.Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,BindingStreamEventWriter> |
newWriterAndIdentifier(InstanceIdentifier<?> path,
org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
Creates a
BindingStreamEventWriter for data tree path which will
translate to NormalizedNode model and invoke proper events on supplied
NormalizedNodeStreamWriter . |
void |
onBindingRuntimeContextUpdated(BindingRuntimeContext context)
Create codec context based on runtime context and notify generator that runtime context has been
updated.
|
<T extends TreeNode> |
toNormalizedNode(InstanceIdentifier<T> path,
T data)
Translates supplied Binding Instance Identifier and data into
NormalizedNode representation.
|
org.opendaylight.yangtools.yang.data.api.schema.ContainerNode |
toNormalizedNodeNotification(Notification data)
Translates supplied Binding Notification or output into NormalizedNode
notification.
|
org.opendaylight.yangtools.yang.data.api.schema.ContainerNode |
toNormalizedNodeOperationData(TreeNode data)
Translates supplied Binding operation (RPC, Action) input or output into
NormalizedNode data.
|
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier |
toYangInstanceIdentifier(InstanceIdentifier<?> binding)
Translates supplied Binding Instance Identifier into NormalizedNode
instance identifier.
|
public BindingNormalizedNodeCodecRegistry(TreeNodeSerializerGenerator generator)
generator
- - serializer generatorpublic TreeNodeSerializer getSerializer(Class<? extends TreeNode> type)
TreeNodeSerializerRegistry
getSerializer
in interface TreeNodeSerializerRegistry
type
- input binding classpublic BindingTreeCodec getCodecContext()
public void onBindingRuntimeContextUpdated(BindingRuntimeContext context)
context
- - runtime context@Nullable public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier toYangInstanceIdentifier(@Nonnull InstanceIdentifier<?> binding)
BindingNormalizedNodeSerializer
toYangInstanceIdentifier
in interface BindingNormalizedNodeSerializer
binding
- - Binding Instance Identifier@Nullable public InstanceIdentifier<?> fromYangInstanceIdentifier(@Nonnull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier dom)
BindingNormalizedNodeSerializer
fromYangInstanceIdentifier
in interface BindingNormalizedNodeSerializer
dom
- - YANG Instance Identifier@Nullable public <T extends TreeNode> Map.Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>> toNormalizedNode(InstanceIdentifier<T> path, T data)
BindingNormalizedNodeSerializer
toNormalizedNode
in interface BindingNormalizedNodeSerializer
T
- data typepath
- - Binding Instance Identifier pointing to datadata
- - representing Data Tree@Nonnull public org.opendaylight.yangtools.yang.data.api.schema.ContainerNode toNormalizedNodeNotification(@Nonnull Notification data)
BindingNormalizedNodeSerializer
toNormalizedNodeNotification
in interface BindingNormalizedNodeSerializer
data
- NormalizedNode representing notification data@Nonnull public org.opendaylight.yangtools.yang.data.api.schema.ContainerNode toNormalizedNodeOperationData(@Nonnull TreeNode data)
BindingNormalizedNodeSerializer
toNormalizedNodeOperationData
in interface BindingNormalizedNodeSerializer
data
- - NormalizedNode representing rpc/action data@Nullable public Map.Entry<InstanceIdentifier<?>,TreeNode> fromNormalizedNode(@Nonnull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier path, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> data)
BindingNormalizedNodeSerializer
fromNormalizedNode
in interface BindingNormalizedNodeSerializer
path
- - Binding Instance Identifierdata
- - NormalizedNode representing data@Nullable public Notification fromNormalizedNodeNotification(@Nonnull org.opendaylight.yangtools.yang.model.api.SchemaPath path, @Nonnull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode data)
BindingNormalizedNodeSerializer
fromNormalizedNodeNotification
in interface BindingNormalizedNodeSerializer
path
- - Schema Path of Notification, schema path is absolute, and
consists of Notification QNamedata
- - NormalizedNode representing data@Nullable public TreeNode fromNormalizedNodeOperationData(@Nonnull org.opendaylight.yangtools.yang.model.api.SchemaPath path, @Nonnull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode data)
BindingNormalizedNodeSerializer
fromNormalizedNodeOperationData
in interface BindingNormalizedNodeSerializer
path
- - schema path of operation data, schema path consists of
rpc/action QName and input/output QName.data
- - NormalizedNode representing data@Nonnull public Map.Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,BindingStreamEventWriter> newWriterAndIdentifier(@Nonnull InstanceIdentifier<?> path, @Nonnull org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
BindingNormalizedNodeWriterFactory
BindingStreamEventWriter
for data tree path which will
translate to NormalizedNode model and invoke proper events on supplied
NormalizedNodeStreamWriter
.
Also provides translation of supplied Instance Identifier to
YangInstanceIdentifier
so client code, does not need to translate
that separately.
If YangInstanceIdentifier
is not needed, please use
BindingNormalizedNodeWriterFactory.newWriter(InstanceIdentifier, NormalizedNodeStreamWriter)
method
to conserve resources.
newWriterAndIdentifier
in interface BindingNormalizedNodeWriterFactory
path
- - Binding Path in conceptual data tree, for which writer
should be instantiateddomWriter
- - Stream writer on which events will be invokedBindingStreamEventWriter
which
will write to supplied NormalizedNodeStreamWriter
@Nonnull public BindingStreamEventWriter newWriter(@Nonnull InstanceIdentifier<?> path, @Nonnull org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
BindingNormalizedNodeWriterFactory
BindingStreamEventWriter
for data tree path which will
translate to NormalizedNode model and invoke proper events on supplied
NormalizedNodeStreamWriter
.
This variation does not provide YANG instance identifier and is useful
for use-cases, where InstanceIdentifier
translation is done in
other way, or YANG instance identifier is unnecessary (e.g.
notifications, operations).
newWriter
in interface BindingNormalizedNodeWriterFactory
path
- - Binding Path in conceptual data tree, for which writer
should be instantiateddomWriter
- - Stream writer on which events will be invokedBindingStreamEventWriter
which will write to supplied
NormalizedNodeStreamWriter
@Nonnull public BindingStreamEventWriter newNotificationWriter(@Nonnull Class<? extends Notification<?>> notification, @Nonnull org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
BindingNormalizedNodeWriterFactory
BindingStreamEventWriter
for notification which will
translate to NormalizedNode model and invoke proper events on supplied
NormalizedNodeStreamWriter
.newNotificationWriter
in interface BindingNormalizedNodeWriterFactory
notification
- - binding class representing notification, for which writer
should be instantiateddomWriter
- - stream writer on which events will be invokedBindingStreamEventWriter
which will write to supplied
NormalizedNodeStreamWriter
@Nonnull public BindingStreamEventWriter newOperationWriter(@Nonnull Class<? extends Instantiable<?>> operationInputOrOutput, @Nonnull org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
BindingNormalizedNodeWriterFactory
BindingStreamEventWriter
for operation data which will
translate to NormalizedNode model and invoke proper events on supplied
NormalizedNodeStreamWriter
.newOperationWriter
in interface BindingNormalizedNodeWriterFactory
operationInputOrOutput
- - binding class representing operation (RPC, Action) input or
output, for which writer should be instantiateddomWriter
- - stream writer on which events will be invokedBindingStreamEventWriter
which will write to supplied
NormalizedNodeStreamWriter
public <T extends TreeNode> Function<Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>>,Optional<T>> deserializeFunction(InstanceIdentifier<T> path)
path
- - binding identifierpublic BindingCodecContext create(BindingRuntimeContext context)
BindingTreeCodecFactory
create
in interface BindingTreeCodecFactory
context
- - Binding Runtime Context for which Binding codecs should be
instantiatedpublic BindingCodecContext create(org.opendaylight.yangtools.yang.model.api.SchemaContext context, Class<?>... bindingClasses)
BindingTreeCodecFactory
create
in interface BindingTreeCodecFactory
context
- - schema context for which Binding codecs should be
instantiatedbindingClasses
- - Binding Runtime Context will be constructed using bindings
which contains specified classes, in order to support
deserialization in multi-classloader environmentCopyright © 2019 OpenDaylight. All rights reserved.