import org.opendaylight.restconf.common.errors.RestconfFuture;
import org.opendaylight.restconf.nb.rfc8040.URLConstants;
import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.RestconfState;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.restconf.state.Streams;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.restconf.state.streams.Stream;
import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotificationInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotificationOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateDataChangeEventSubscriptionInput;
// }
private static final Logger LOG = LoggerFactory.getLogger(ListenersBroker.class);
+ private static final YangInstanceIdentifier RESTCONF_STATE_STREAMS = YangInstanceIdentifier.of(
+ NodeIdentifier.create(RestconfState.QNAME),
+ NodeIdentifier.create(Streams.QNAME),
+ NodeIdentifier.create(Stream.QNAME));
private static final QName DATASTORE_QNAME =
QName.create(CreateDataChangeEventSubscriptionInput1.QNAME, "datastore").intern();
// Now issue a delete operation while the name is still protected by being associated in the map.
final var tx = dataBroker.newWriteOnlyTransaction();
- tx.delete(LogicalDatastoreType.OPERATIONAL, RestconfStateStreams.restconfStateStreamPath(streamName));
+ tx.delete(LogicalDatastoreType.OPERATIONAL, restconfStateStreamPath(streamName));
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
public void onSuccess(final CommitInfo result) {
}, MoreExecutors.directExecutor());
}
+ private static @NonNull YangInstanceIdentifier restconfStateStreamPath(final String streamName) {
+ return RESTCONF_STATE_STREAMS
+ .node(NodeIdentifierWithPredicates.of(Stream.QNAME, RestconfStateStreams.NAME_QNAME, streamName));
+ }
+
/**
* Creates string representation of stream name from URI. Removes slash from URI in start and end positions,
* and optionally {@link URLConstants#BASE_PATH} prefix.
import java.net.URI;
import java.util.Set;
import java.util.stream.Collectors;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.RestconfState;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.restconf.state.Streams;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.restconf.state.streams.Stream;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.restconf.state.streams.stream.Access;
import org.opendaylight.yangtools.yang.common.QName;
* Utilities for creating the content of {@code /ietf-restconf-monitoring:restconf-state/streams}.
*/
public final class RestconfStateStreams {
- private static final YangInstanceIdentifier RESTCONF_STATE_STREAMS = YangInstanceIdentifier.of(
- NodeIdentifier.create(RestconfState.QNAME), NodeIdentifier.create(Streams.QNAME),
- NodeIdentifier.create(Stream.QNAME));
-
@VisibleForTesting
static final QName DESCRIPTION_QNAME = qnameOf("description");
@VisibleForTesting
static final QName ENCODING_QNAME = qnameOf("encoding");
@VisibleForTesting
static final QName LOCATION_QNAME = qnameOf("location");
- @VisibleForTesting
static final QName NAME_QNAME = qnameOf("name");
private RestconfStateStreams() {
// Hidden on purpose
}
- public static @NonNull YangInstanceIdentifier restconfStateStreamPath(final String streamName) {
- return restconfStateStreamPath(NodeIdentifierWithPredicates.of(Stream.QNAME, NAME_QNAME, streamName));
- }
-
- public static @NonNull YangInstanceIdentifier restconfStateStreamPath(final NodeIdentifierWithPredicates arg) {
- return RESTCONF_STATE_STREAMS.node(arg);
- }
-
/**
- * Map data of yang notification to normalized node according to ietf-restconf-monitoring.
+ * Map data of YANG notification stream to a {@link MapEntryNode} according to {@code ietf-restconf-monitoring}.
*
* @param streamName stream name
* @param qnames Notification QNames to listen on