import org.opendaylight.yangtools.yang.model.api.SchemaPath;
/**
- *
* Navigable tree representing hierarchy of Binding to Normalized Node codecs
*
* This navigable tree is associated to conrete set of YANG models, represented by SchemaContext and
*
* TODO: Add more detailed documentation
**/
-public interface BindingCodecTree extends org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTree {
+public interface BindingCodecTree {
- @Override
@Nullable
<T extends DataObject> BindingCodecTreeNode<T> getSubtreeCodec(InstanceIdentifier<T> path);
- @Override
@Nullable
BindingCodecTreeNode<?> getSubtreeCodec(YangInstanceIdentifier path);
- @Override
@Nullable
BindingCodecTreeNode<?> getSubtreeCodec(SchemaPath path);
import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-public interface BindingCodecTreeFactory extends
- org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeFactory {
+public interface BindingCodecTreeFactory {
/**
- *
* Creates Binding Codec Tree for specified Binding runtime context.
*
* @param context
* instantiated.
* @return Binding Codec Tree for specified Binding runtime context.
*/
- @Override
BindingCodecTree create(BindingRuntimeContext context);
/**
- *
* Creates Binding Codec Tree for specified Binding runtime context.
*
* @param context
* deserialization in multi-classloader environment.
* @return Binding Codec Tree for specified Binding runtime context.
*/
- @Override
@Beta
BindingCodecTree create(SchemaContext context, Class<?>... bindingClasses);
/**
* Subtree codec specific to model subtree between Java Binding and
* NormalizedNode.
- *
*/
@Beta
-public interface BindingCodecTreeNode<T extends DataObject> extends BindingNormalizedNodeCodec<T>,
- org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode<T> {
+public interface BindingCodecTreeNode<T extends DataObject> extends BindingNormalizedNodeCodec<T> {
/**
- *
* Returns binding class of interface which represents API of current
* schema node.
*
*
* @return interface which defines API of binding representation of data.
*/
- @Override
@Nonnull
Class<T> getBindingClass();
/**
- *
* Returns child context as if it was walked by
* {@link BindingStreamEventWriter}. This means that to enter case, one must
* issue getChild(ChoiceClass).getChild(CaseClass).
* @throws IllegalArgumentException
* If supplied child class is not valid in specified context.
*/
- @Override
@Nonnull
<E extends DataObject> BindingCodecTreeNode<E> streamChild(@Nonnull Class<E> childClass);
/**
- *
* Returns child context as if it was walked by
* {@link BindingStreamEventWriter}. This means that to enter case, one must
* issue getChild(ChoiceClass).getChild(CaseClass).
* @return Context of child or Optional absent is supplied class is not
* applicable in context.
*/
- @Override
<E extends DataObject> Optional<? extends BindingCodecTreeNode<E>> possibleStreamChild(@Nonnull Class<E> childClass);
/**
* @throws IllegalArgumentException
* If supplied argument does not represent valid child.
*/
- @Override
@Nonnull
BindingCodecTreeNode<?> yangPathArgumentChild(@Nonnull YangInstanceIdentifier.PathArgument child);
* @throws IllegalArgumentException
* If supplied argument does not represent valid child.
*/
- @Override
@Nonnull
BindingCodecTreeNode<?> bindingPathArgumentChild(@Nonnull InstanceIdentifier.PathArgument arg,
@Nullable List<YangInstanceIdentifier.PathArgument> builder);
/**
- *
* Returns codec which uses caches serialization / deserialization results
*
* Caching may introduce performance penalty to serialization / deserialization
* @param cacheSpecifier Set of objects, for which cache may be in place
* @return Codec whihc uses cache for serialization / deserialization.
*/
- @Override
@Nonnull
BindingNormalizedNodeCachingCodec<T> createCachingCodec(@Nonnull
ImmutableCollection<Class<? extends DataObject>> cacheSpecifier);
- @Override
@Beta
void writeAsNormalizedNode(T data, NormalizedNodeStreamWriter writer);
* representation for current node (e.g. case).
* @throws IllegalArgumentException If supplied {@code arg} is not valid.
*/
- @Override
@Beta
@Nullable YangInstanceIdentifier.PathArgument serializePathArgument(@Nullable InstanceIdentifier.PathArgument arg);
* representation for current node (e.g. choice or case).
* @throws IllegalArgumentException If supplied {@code arg} is not valid.
*/
- @Override
@Beta
@Nullable InstanceIdentifier.PathArgument deserializePathArgument(@Nullable YangInstanceIdentifier.PathArgument arg);
- @Override
Object getSchema();
}
* @param <T> Binding representtion of data
*/
@Beta
-public interface BindingNormalizedNodeCachingCodec<T extends DataObject> extends
- org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCachingCodec<T>,
- BindingNormalizedNodeCodec<T>, AutoCloseable {
+public interface BindingNormalizedNodeCachingCodec<T extends DataObject> extends BindingNormalizedNodeCodec<T>,
+ AutoCloseable {
/**
* Invoking close will invalidate this codec and any of its child
* codecs and will invalidate cache.
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
/**
- *
* Codec providing serialization and deserializiation between Binding
* and NormalizedNode representation of data.
*
- *
* @param <T> Binding representation of data
*/
@Beta
-public interface BindingNormalizedNodeCodec<T extends DataObject> extends
- org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCodec<T> {
+public interface BindingNormalizedNodeCodec<T extends DataObject> {
/**
* Converts from Normalized Node to Binding representation of data.
* @param data Normalized Node representation of data
* @return Binding representation of data
*/
- @Override
@Nonnull T deserialize(@Nonnull NormalizedNode<?,?> data);
/**
* @param data Binding representation of data
* @return Normalized Node representation of data
*/
- @Override
@Nonnull NormalizedNode<?,?> serialize(@Nonnull T data);
}
* Serialization service, which provides two-way serialization between Java
* Binding Data representation and NormalizedNode representation.
*/
-public interface BindingNormalizedNodeSerializer extends
- org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer {
+public interface BindingNormalizedNodeSerializer {
/**
* Translates supplied Binding Instance Identifier into NormalizedNode
* @throws IllegalArgumentException
* If supplied Instance Identifier is not valid.
*/
- @Override
YangInstanceIdentifier toYangInstanceIdentifier(@Nonnull InstanceIdentifier<?> binding);
/**
* @return Binding Instance Identifier, or null if the instance identifier
* is not representable.
*/
- @Override
@Nullable
InstanceIdentifier<?> fromYangInstanceIdentifier(@Nonnull YangInstanceIdentifier dom);
* @throws IllegalArgumentException
* If supplied Instance Identifier is not valid.
*/
- @Override
<T extends DataObject> Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> toNormalizedNode(
InstanceIdentifier<T> path, T data);
* @param data NormalizedNode representing data
* @return DOM Instance Identifier
*/
- @Override
@Nullable
Entry<InstanceIdentifier<?>, DataObject> fromNormalizedNode(@Nonnull YangInstanceIdentifier path,
NormalizedNode<?, ?> data);
* @param data NormalizedNode representing data
* @return Binding representation of Notification
*/
- @Override
@Nullable Notification fromNormalizedNodeNotification(@Nonnull SchemaPath path,@Nonnull ContainerNode data);
/**
* @param data NormalizedNode representing data
* @return Binding representation of RPC data
*/
- @Override
@Nullable DataObject fromNormalizedNodeRpcData(@Nonnull SchemaPath path,@Nonnull ContainerNode data);
/**
* @param data NormalizedNode representing notification data
* @return NormalizedNode representation of notification
*/
- @Override
@Nonnull ContainerNode toNormalizedNodeNotification(@Nonnull Notification data);
/**
* @param data NormalizedNode representing rpc data
* @return NormalizedNode representation of rpc data
*/
- @Override
@Nonnull ContainerNode toNormalizedNodeRpcData(@Nonnull DataContainer data);
}
import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
/**
- *
* Factory for {@link BindingStreamEventWriter}, which provides stream writers
- * which translates data and delegates calls to
- * {@link NormalizedNodeStreamWriter}.
- *
+ * which translates data and delegates calls to {@link NormalizedNodeStreamWriter}.
*/
-public interface BindingNormalizedNodeWriterFactory extends
- org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeWriterFactory {
-
+public interface BindingNormalizedNodeWriterFactory {
/**
- *
* Creates a {@link BindingStreamEventWriter} for data tree path which will
* translate to NormalizedNode model and invoke proper events on supplied
* {@link NormalizedNodeStreamWriter}.
* which will write to supplied {@link NormalizedNodeStreamWriter}.
* @throws IllegalArgumentException If supplied Instance Identifier is not valid.
*/
- @Override
- @Nonnull Entry<YangInstanceIdentifier, BindingStreamEventWriter> newWriterAndIdentifier(@Nonnull InstanceIdentifier<?> path,
- @Nonnull NormalizedNodeStreamWriter domWriter);
+ @Nonnull Entry<YangInstanceIdentifier, BindingStreamEventWriter> newWriterAndIdentifier(
+ @Nonnull InstanceIdentifier<?> path, @Nonnull NormalizedNodeStreamWriter domWriter);
/**
- *
* Creates a {@link BindingStreamEventWriter} for data tree path which will
* translate to NormalizedNode model and invoke proper events on supplied
* {@link NormalizedNodeStreamWriter}.
* which will write to supplied {@link NormalizedNodeStreamWriter}.
* @throws IllegalArgumentException If supplied Instance Identifier is not valid.
*/
- @Override
@Nonnull
BindingStreamEventWriter newWriter(@Nonnull InstanceIdentifier<?> path,
@Nonnull NormalizedNodeStreamWriter domWriter);
/**
- *
- * Creates a {@link BindingStreamEventWriter} for rpc data which will
+ * Creates a {@link BindingStreamEventWriter} for RPC data which will
* translate to NormalizedNode model and invoke proper events on supplied
* {@link NormalizedNodeStreamWriter}.
*
* @return {@link BindingStreamEventWriter} which will write to supplied
* {@link NormalizedNodeStreamWriter}.
*/
- @Override
@Nonnull
BindingStreamEventWriter newRpcWriter(@Nonnull Class<? extends DataContainer> rpcInputOrOutput,
@Nonnull NormalizedNodeStreamWriter domWriter);
/**
- *
* Creates a {@link BindingStreamEventWriter} for notification which will
* translate to NormalizedNode model and invoke proper events on supplied
* {@link NormalizedNodeStreamWriter}.
* @return {@link BindingStreamEventWriter} which will write to supplied
* {@link NormalizedNodeStreamWriter}.
*/
- @Override
@Nonnull
BindingStreamEventWriter newNotificationWriter(@Nonnull Class<? extends Notification> notification,
@Nonnull NormalizedNodeStreamWriter domWriter);