669f84029be3b92bc4630317e796da667a393cc4
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / utils / RestconfStreamsConstants.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.restconf.nb.rfc8040.rests.utils;
9
10 import com.google.common.collect.ImmutableSet;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.common.QNameModule;
13 import org.opendaylight.yangtools.yang.common.Revision;
14 import org.opendaylight.yangtools.yang.common.XMLNamespace;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
16
17 /**
18  * Constants for streams.
19  */
20 public final class RestconfStreamsConstants {
21
22     public static final QNameModule SAL_REMOTE_AUGMENT = QNameModule.create(
23         XMLNamespace.of("urn:sal:restconf:event:subscription"), Revision.of("2014-07-08"));
24     public static final QNameModule SUBSCRIBE_TO_NOTIFICATION = QNameModule.create(
25         XMLNamespace.of("subscribe:to:notification"), Revision.of("2016-10-28"));
26
27     public static final QName SAL_REMOTE_NAMESPACE = QName.create(
28             "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote",
29             "2014-01-14",
30             "sal-remote");
31
32     public static final String STREAM_PATH_PARAM_NAME = "path";
33     public static final String DATASTORE_PARAM_NAME = "datastore";
34     public static final String SCOPE_PARAM_NAME = "scope";
35     public static final String OUTPUT_TYPE_PARAM_NAME = "notification-output-type";
36
37     public static final AugmentationIdentifier SAL_REMOTE_AUG_IDENTIFIER = new AugmentationIdentifier(ImmutableSet.of(
38             QName.create(SAL_REMOTE_AUGMENT, SCOPE_PARAM_NAME),
39             QName.create(SAL_REMOTE_AUGMENT, DATASTORE_PARAM_NAME),
40             QName.create(SAL_REMOTE_AUGMENT, OUTPUT_TYPE_PARAM_NAME)));
41
42     public static final QName LOCATION_QNAME = QName.create(SUBSCRIBE_TO_NOTIFICATION, "location");
43     public static final QName NOTIFI_QNAME = QName.create(SUBSCRIBE_TO_NOTIFICATION, "notifi");
44
45     public static final String DS_URI = '/' + DATASTORE_PARAM_NAME + '=';
46     public static final String SCOPE_URI = '/' + SCOPE_PARAM_NAME + '=';
47
48     public static final String DATA_SUBSCRIPTION = "data-change-event-subscription";
49     public static final String CREATE_DATA_SUBSCRIPTION = "create-" + DATA_SUBSCRIPTION;
50     public static final String NOTIFICATION_STREAM = "notification-stream";
51     public static final String CREATE_NOTIFICATION_STREAM = "create-" + NOTIFICATION_STREAM;
52
53     public static final String STREAMS_PATH = "ietf-restconf-monitoring:restconf-state/streams";
54     public static final String STREAM_PATH_PART = "/stream=";
55     public static final String STREAM_PATH = STREAMS_PATH + STREAM_PATH_PART;
56     public static final String STREAM_ACCESS_PATH_PART = "/access=";
57     public static final String STREAM_LOCATION_PATH_PART = "/location";
58
59     public static final String DATA_CHANGE_EVENT_STREAM_PATTERN = '/' + DATA_SUBSCRIPTION + "/*";
60     public static final String YANG_NOTIFICATION_STREAM_PATTERN = '/' + NOTIFICATION_STREAM + "/*";
61
62     private RestconfStreamsConstants() {
63         throw new UnsupportedOperationException("Util class.");
64     }
65 }