import static java.util.Objects.requireNonNull;
import java.util.Optional;
-import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.mdsal.binding.dom.codec.spi.AbstractBindingLazyContainerNode;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-/**
+/*
* FIXME: This is a bit of functionality which should really live in binding-dom-codec, but for to happen we need
- * to extends BindingNormalizedNodeCodecRegistry with the concept of a routing context -- which would be
- * deprecated, as we want to move to actions in the long term.
+ * to extend BindingNormalizedNodeSerializer with the concept of a routing context -- which would be deprecated,
+ * as we want to move to actions in the long term.
+ *
+ * Even then, BindingNormalizedNodeCodecRegistry provides background updates to the context used in
+ * deserialization, which is currently being used.
*/
-class LazySerializedContainerNode extends AbstractBindingLazyContainerNode<DataObject,
- BindingNormalizedNodeCodecRegistry> {
+class LazySerializedContainerNode
+ extends AbstractBindingLazyContainerNode<DataObject, BindingNormalizedNodeSerializer> {
private LazySerializedContainerNode(final QName identifier, final DataObject binding,
- final BindingNormalizedNodeCodecRegistry registry) {
- super(NodeIdentifier.create(identifier), binding, requireNonNull(registry));
+ final BindingNormalizedNodeSerializer codec) {
+ super(NodeIdentifier.create(identifier), binding, requireNonNull(codec));
}
static ContainerNode create(final SchemaPath rpcName, final DataObject data,
- final BindingNormalizedNodeCodecRegistry codec) {
+ final BindingNormalizedNodeSerializer codec) {
return data == null ? null : new LazySerializedContainerNode(rpcName.getLastComponent(), data, codec);
}
static ContainerNode withContextRef(final SchemaPath rpcName, final DataObject data,
- final LeafNode<?> contextRef, final BindingNormalizedNodeCodecRegistry codec) {
- return new WithContextRef(rpcName.getLastComponent(), data, contextRef, codec);
+ final LeafNode<?> contextRef, final BindingNormalizedNodeSerializer serializer) {
+ return new WithContextRef(rpcName.getLastComponent(), data, contextRef, serializer);
}
@Override
- protected final ContainerNode computeContainerNode(final BindingNormalizedNodeCodecRegistry context) {
+ protected final ContainerNode computeContainerNode(final BindingNormalizedNodeSerializer context) {
return context.toNormalizedNodeRpcData(getDataObject());
}
private final LeafNode<?> contextRef;
protected WithContextRef(final QName identifier, final DataObject binding, final LeafNode<?> contextRef,
- final BindingNormalizedNodeCodecRegistry registry) {
- super(identifier, binding, registry);
+ final BindingNormalizedNodeSerializer codec) {
+ super(identifier, binding, codec);
this.contextRef = requireNonNull(contextRef);
}