http://www.eclipse.org/legal/epl-v10.html";
revision "2014-01-14" {
- description
- "Initial revision";
+ description "Initial revision";
}
-
- typedef q-name {
- type string;
- reference
- "http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#QName";
- }
+ typedef q-name {
+ type string;
+ reference "http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#QName";
+ }
rpc create-data-change-event-subscription {
input {
type instance-identifier;
description "Subtree path. ";
}
- }
- output {
+ }
+ output {
leaf stream-name {
type string;
description "Notification stream name.";
}
- }
+ }
}
notification data-changed-notification {
rpc begin-transaction {
output {
- anyxml data-modification-transaction{
+ anyxml data-modification-transaction {
description "DataModificationTransaction xml";
}
}
}
-
-}
\ No newline at end of file
+}
import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfInvokeOperationsService;
import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotificationInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateDataChangeEventSubscriptionInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotification;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateDataChangeEventSubscription;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
public class RestconfInvokeOperationsServiceImpl implements RestconfInvokeOperationsService {
private static final Logger LOG = LoggerFactory.getLogger(RestconfInvokeOperationsServiceImpl.class);
- // FIXME: at some point we do not want to have this here, as this is only used for dispatch
- private static final QNameModule SAL_REMOTE_NAMESPACE = CreateDataChangeEventSubscriptionInput.QNAME.getModule();
- private static final QNameModule DEVICE_NOTIFICATION_NAMESPACE = SubscribeDeviceNotificationInput.QNAME.getModule();
-
private final DOMRpcService rpcService;
private final DOMMountPointService mountPointService;
private final SubscribeToStreamUtil streamUtils;
final ListenableFuture<? extends DOMRpcResult> future;
if (mountPoint == null) {
- // FIXME: this really should be a normal RPC invocation service which has its own interface with JAX-RS,
- // except ... we check 'identifier' for .contains() instead of exact RPC name!
- if (SAL_REMOTE_NAMESPACE.equals(rpcName.getModule())) {
- if (identifier.contains("create-data-change-event-subscription")) {
- future = Futures.immediateFuture(
- CreateStreamUtil.createDataChangeNotifiStream(payload, schemaContext));
- } else {
- future = Futures.immediateFailedFuture(new RestconfDocumentedException("Unsupported operation",
- ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED));
- }
- } else if (DEVICE_NOTIFICATION_NAMESPACE.equals(rpcName.getModule())) {
- // FIXME: this should be a match on RPC QName
+ if (CreateDataChangeEventSubscription.QNAME.equals(rpcName)) {
+ future = Futures.immediateFuture(CreateStreamUtil.createDataChangeNotifiStream(payload, schemaContext));
+ } else if (SubscribeDeviceNotification.QNAME.equals(rpcName)) {
final String baseUrl = streamUtils.prepareUriByStreamName(uriInfo, "").toString();
future = Futures.immediateFuture(CreateStreamUtil.createDeviceNotificationListener(baseUrl, payload,
streamUtils, mountPointService));