import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
import org.opendaylight.yangtools.yang.binding.Action;
+import org.opendaylight.yangtools.yang.binding.BaseNotification;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
/**
* Serialization service, which provides two-way serialization between Java
* @return DOM Instance Identifier
* @throws IllegalArgumentException If supplied Instance Identifier is not valid.
*/
- YangInstanceIdentifier toYangInstanceIdentifier(@NonNull InstanceIdentifier<?> binding);
+ // FIXME: MDSAL-525: reconcile this with BindingInstanceIdentifierCodec
+ @NonNull YangInstanceIdentifier toYangInstanceIdentifier(@NonNull InstanceIdentifier<?> binding);
/**
* Translates supplied YANG Instance Identifier into Binding instance identifier.
* @param dom YANG Instance Identifier
* @return Binding Instance Identifier, or null if the instance identifier is not representable.
*/
+ // FIXME: MDSAL-525: reconcile this with BindingInstanceIdentifierCodec
<T extends DataObject> @Nullable InstanceIdentifier<T> fromYangInstanceIdentifier(
@NonNull YangInstanceIdentifier dom);
* @return NormalizedNode representation
* @throws IllegalArgumentException If supplied Instance Identifier is not valid.
*/
- <T extends DataObject> Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> toNormalizedNode(
+ <T extends DataObject> @NonNull Entry<YangInstanceIdentifier, NormalizedNode> toNormalizedNode(
InstanceIdentifier<T> path, T data);
/**
* @return DOM Instance Identifier
*/
@Nullable Entry<InstanceIdentifier<?>, DataObject> fromNormalizedNode(@NonNull YangInstanceIdentifier path,
- NormalizedNode<?, ?> data);
+ NormalizedNode data);
/**
* Translates supplied NormalizedNode Notification into Binding data.
* @param data NormalizedNode representing data
* @return Binding representation of Notification
*/
- @Nullable Notification fromNormalizedNodeNotification(@NonNull SchemaPath path, @NonNull ContainerNode data);
+ @NonNull BaseNotification fromNormalizedNodeNotification(@NonNull Absolute path, @NonNull ContainerNode data);
/**
* Translates supplied NormalizedNode Notification into Binding data, optionally taking an instant
* @return Binding representation of Notification
*/
@Beta
- @Nullable Notification fromNormalizedNodeNotification(@NonNull SchemaPath path, @NonNull ContainerNode data,
+ @NonNull BaseNotification fromNormalizedNodeNotification(@NonNull Absolute path, @NonNull ContainerNode data,
@Nullable Instant eventInstant);
/**
* Translates supplied NormalizedNode RPC input or output into Binding data.
*
- * @param path Schema path of RPC data, Schema path consists of rpc QName and input / output QName.
+ * @param containerPath Container path (RPC type + input/output)
* @param data NormalizedNode representing data
* @return Binding representation of RPC data
*/
- @Nullable DataObject fromNormalizedNodeRpcData(@NonNull SchemaPath path, @NonNull ContainerNode data);
+ @Nullable DataObject fromNormalizedNodeRpcData(@NonNull Absolute containerPath, @NonNull ContainerNode data);
/**
* Translates supplied ContainerNode action input.
/**
* Translates supplied Binding Notification or output into NormalizedNode notification.
*
- * @param data NormalizedNode representing notification data
+ * @param data {@link Notification} representing notification data
* @return NormalizedNode representation of notification
*/
- @NonNull ContainerNode toNormalizedNodeNotification(@NonNull Notification data);
+ @NonNull ContainerNode toNormalizedNodeNotification(@NonNull Notification<?> data);
+
+ /**
+ * Translates supplied Binding Notification or output into NormalizedNode notification.
+ *
+ * @param path schema node identifier of the notification
+ * @param data {@link BaseNotification} representing notification data
+ * @return NormalizedNode representation of notification
+ */
+ @NonNull ContainerNode toNormalizedNodeNotification(@NonNull Absolute path, @NonNull BaseNotification data);
/**
* Translates supplied Binding RPC input or output into NormalizedNode data.