@Beta public final class BindingToNormalizedNodeCodec extends Object implements BindingTreeCodecFactory, BindingNormalizedNodeSerializer, org.opendaylight.yangtools.yang.model.api.SchemaContextListener, AutoCloseable
Constructor and Description |
---|
BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy classLoadingStrategy,
BindingNormalizedNodeCodecRegistry codecRegistry)
Init class without waiting for schema.
|
BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy classLoadingStrategy,
BindingNormalizedNodeCodecRegistry codecRegistry,
boolean waitForSchema)
Init class with waiting for schema.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
BindingTreeCodec |
create(BindingRuntimeContext context)
Creates Binding Codec Tree for specified Binding runtime context.
|
BindingTreeCodec |
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)
Prepare deserialize function of Binding identifier to DOM.
|
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.
|
com.google.common.collect.ImmutableBiMap<Method,org.opendaylight.yangtools.yang.model.api.OperationDefinition> |
getActionMethodToSchema(Class<?> key)
Resolve method with definition of specific action as binding object.
|
org.opendaylight.yangtools.yang.model.api.SchemaPath |
getActionPath(Class<? extends Action<?,?,?,?>> type)
Get Action schema path.
|
BindingNormalizedNodeCodecRegistry |
getCodecFactory()
Get codec factory.
|
BindingNormalizedNodeCodecRegistry |
getCodecRegistry()
Get codec registry.
|
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> |
getDefaultNodeFor(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier parentMapPath)
Get default DOM object on path for list.
|
Set<Class<? extends Notification>> |
getNotificationClasses(Set<org.opendaylight.yangtools.yang.model.api.SchemaPath> interested)
Get specific notification classes as Binding objects.
|
org.opendaylight.yangtools.yang.model.api.RpcDefinition |
getRpcDefinition(Class<? extends Rpc<?,?>> type) |
com.google.common.collect.ImmutableBiMap<Method,org.opendaylight.yangtools.yang.model.api.OperationDefinition> |
getRPCMethodToSchema(Class<?> key)
Resolve method with definition of specific RPC as binding object.
|
com.google.common.collect.ImmutableBiMap<Method,org.opendaylight.yangtools.yang.model.api.SchemaPath> |
getRPCMethodToSchemaPath(Class<?> key)
Deprecated.
|
org.opendaylight.yangtools.yang.model.api.SchemaPath |
getRpcPath(Class<? extends Rpc<?,?>> type)
Get RPC schema path.
|
Map.Entry<InstanceIdentifier<?>,BindingTreeNodeCodec<?>> |
getSubtreeCodec(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier domIdentifier)
Get subtree codec of DOM identifier.
|
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> |
instanceIdentifierToNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier parentPath)
Resolve DOM object on specific DOM identifier.
|
void |
onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext arg0) |
Optional<Map.Entry<InstanceIdentifier<? extends TreeNode>,TreeNode>> |
toBinding(Map.Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,? extends org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>> normalized)
DOM to Binding.
|
Optional<InstanceIdentifier<? extends TreeNode>> |
toBinding(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier normalized)
Returns a Binding-Aware instance identifier from normalized instance-identifier if it is possible to
create representation.
|
DOMDataTreeIdentifier |
toDOMDataTreeIdentifier(DataTreeIdentifier<?> path)
Create new DOM data tree identifier from Binding data tree identifier.
|
Collection<DOMDataTreeIdentifier> |
toDOMDataTreeIdentifiers(Collection<DataTreeIdentifier<?>> subtrees)
Binding subtree identifiers to DOM subtree identifiers.
|
<P extends TreeNode> |
toDOMDataTreeIdentifiers(Set<DataTreeIdentifier<P>> subtrees) |
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier |
toNormalized(InstanceIdentifier<? extends TreeNode> binding)
Translates supplied Binding Instance Identifier into NormalizedNode instance identifier.
|
<T extends TreeNode> |
toNormalizedNode(InstanceIdentifier<T> path,
T data)
Translates supplied Binding Instance Identifier and data into
NormalizedNode representation.
|
Map.Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>> |
toNormalizedNode(Map.Entry<InstanceIdentifier<? extends TreeNode>,TreeNode> binding)
Converts Binding Map.Entry to DOM Map.Entry.
|
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.
|
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier |
toYangInstanceIdentifierBlocking(InstanceIdentifier<? extends TreeNode> binding)
Translates supplied Binding Instance Identifier into NormalizedNode instance identifier with waiting
for schema.
|
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier |
toYangInstanceIdentifierCached(InstanceIdentifier<?> binding)
Get cached DOM identifier of Binding identifier.
|
public BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy classLoadingStrategy, BindingNormalizedNodeCodecRegistry codecRegistry)
classLoadingStrategy
- - class loadercodecRegistry
- - codec registrypublic BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy classLoadingStrategy, BindingNormalizedNodeCodecRegistry codecRegistry, boolean waitForSchema)
classLoadingStrategy
- - class loadercodecRegistry
- - codec registrywaitForSchema
- - boolean of waiting for schemapublic org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier toYangInstanceIdentifierBlocking(InstanceIdentifier<? extends TreeNode> binding)
binding
- - Binding Instance Identifierpublic org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier toNormalized(InstanceIdentifier<? extends TreeNode> binding)
binding
- - Binding Instance IdentifierIllegalArgumentException
- If supplied Instance Identifier is not valid.@Nullable public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier toYangInstanceIdentifier(@Nonnull InstanceIdentifier<?> binding)
BindingNormalizedNodeSerializer
toYangInstanceIdentifier
in interface BindingNormalizedNodeSerializer
binding
- - Binding Instance Identifierpublic org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier toYangInstanceIdentifierCached(InstanceIdentifier<?> binding)
binding
- - binding 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@Nullable public Map.Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>> toNormalizedNode(Map.Entry<InstanceIdentifier<? extends TreeNode>,TreeNode> binding)
binding
- Map Entry with InstanceIdentifier as key and DataObject as value.YangInstanceIdentifier
as key and NormalizedNode
as value.@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@Nullable public InstanceIdentifier<?> fromYangInstanceIdentifier(@Nonnull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier dom)
BindingNormalizedNodeSerializer
fromYangInstanceIdentifier
in interface BindingNormalizedNodeSerializer
dom
- - YANG Instance Identifier@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 datapublic Optional<InstanceIdentifier<? extends TreeNode>> toBinding(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier normalized) throws org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException
Returns Optional.empty for cases where target is mixin node except augmentation.
org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException
public Optional<Map.Entry<InstanceIdentifier<? extends TreeNode>,TreeNode>> toBinding(@Nonnull Map.Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,? extends org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>> normalized) throws org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException
normalized
- - DOM objectorg.opendaylight.yangtools.yang.data.impl.codec.DeserializationException
- If fail to deserializepublic void onGlobalContextUpdated(org.opendaylight.yangtools.yang.model.api.SchemaContext arg0)
onGlobalContextUpdated
in interface org.opendaylight.yangtools.yang.model.api.SchemaContextListener
public <T extends TreeNode> Function<Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>>,Optional<T>> deserializeFunction(InstanceIdentifier<T> path)
path
- - Binding identifierpublic BindingNormalizedNodeCodecRegistry getCodecRegistry()
public void close()
close
in interface AutoCloseable
public BindingNormalizedNodeCodecRegistry getCodecFactory()
@Deprecated public com.google.common.collect.ImmutableBiMap<Method,org.opendaylight.yangtools.yang.model.api.SchemaPath> getRPCMethodToSchemaPath(Class<?> key)
key
- - RPC as binding objectpublic org.opendaylight.yangtools.yang.model.api.SchemaPath getActionPath(Class<? extends Action<?,?,?,?>> type)
type
- - Action implementation class typepublic org.opendaylight.yangtools.yang.model.api.SchemaPath getRpcPath(Class<? extends Rpc<?,?>> type)
type
- - RPC implementation class typepublic org.opendaylight.yangtools.yang.model.api.RpcDefinition getRpcDefinition(Class<? extends Rpc<?,?>> type)
public com.google.common.collect.ImmutableBiMap<Method,org.opendaylight.yangtools.yang.model.api.OperationDefinition> getRPCMethodToSchema(Class<?> key)
key
- - RPC as binding objectpublic com.google.common.collect.ImmutableBiMap<Method,org.opendaylight.yangtools.yang.model.api.OperationDefinition> getActionMethodToSchema(Class<?> key)
key
- - action as binding objectpublic BindingTreeCodec create(BindingRuntimeContext context)
BindingTreeCodecFactory
create
in interface BindingTreeCodecFactory
context
- - Binding Runtime Context for which Binding codecs should be
instantiatedpublic BindingTreeCodec 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 environment@Nonnull public Map.Entry<InstanceIdentifier<?>,BindingTreeNodeCodec<?>> getSubtreeCodec(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier domIdentifier)
domIdentifier
- - DOM identifierpublic Set<Class<? extends Notification>> getNotificationClasses(Set<org.opendaylight.yangtools.yang.model.api.SchemaPath> interested)
interested
- - set of specific notifications pathspublic org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> instanceIdentifierToNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier parentPath)
parentPath
- - DOM identifierpublic org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> getDefaultNodeFor(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier parentMapPath)
parentMapPath
- - pathpublic Collection<DOMDataTreeIdentifier> toDOMDataTreeIdentifiers(Collection<DataTreeIdentifier<?>> subtrees)
subtrees
- - binding subtreepublic <P extends TreeNode> Set<DOMDataTreeIdentifier> toDOMDataTreeIdentifiers(Set<DataTreeIdentifier<P>> subtrees)
public DOMDataTreeIdentifier toDOMDataTreeIdentifier(DataTreeIdentifier<?> path)
path
- - binding data tree identifierCopyright © 2019 OpenDaylight. All rights reserved.