Refactoring of web-sockets in RESTCONF RFC-8040
[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 java.net.URI;
12 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
13 import org.opendaylight.restconf.common.util.DataChangeScope;
14 import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants;
15 import org.opendaylight.restconf.nb.rfc8040.utils.parser.builder.ParserBuilderConstants;
16 import org.opendaylight.yangtools.yang.common.QName;
17 import org.opendaylight.yangtools.yang.common.QNameModule;
18 import org.opendaylight.yangtools.yang.common.Revision;
19 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
20
21 /**
22  * Constants for streams.
23  */
24 public final class RestconfStreamsConstants {
25
26     public static final QNameModule SAL_REMOTE_AUGMENT = QNameModule.create(
27             URI.create("urn:sal:restconf:event:subscription"),
28             Revision.of("2014-07-08"));
29     public static final QNameModule SUBSCRIBE_TO_NOTIFICATION = QNameModule.create(
30             URI.create("subscribe:to:notification"),
31             Revision.of("2016-10-28"));
32
33     public static final QName SAL_REMOTE_NAMESPACE = QName.create(
34             "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote",
35             "2014-01-14",
36             "sal-remote");
37
38     public static final String STREAM_PATH_PARAM_NAME = "path";
39     public static final String DATASTORE_PARAM_NAME = "datastore";
40     public static final String SCOPE_PARAM_NAME = "scope";
41     public static final String OUTPUT_TYPE_PARAM_NAME = "notification-output-type";
42     public static final String OUTPUT_CONTAINER_NAME = "output";
43     public static final String OUTPUT_STREAM_NAME = "stream-name";
44
45
46     public static final AugmentationIdentifier SAL_REMOTE_AUG_IDENTIFIER = new AugmentationIdentifier(ImmutableSet.of(
47             QName.create(SAL_REMOTE_AUGMENT, SCOPE_PARAM_NAME),
48             QName.create(SAL_REMOTE_AUGMENT, DATASTORE_PARAM_NAME),
49             QName.create(SAL_REMOTE_AUGMENT, OUTPUT_TYPE_PARAM_NAME)));
50
51     public static final QName LOCATION_QNAME = QName.create(SUBSCRIBE_TO_NOTIFICATION, "location");
52     public static final QName NOTIFI_QNAME = QName.create(SUBSCRIBE_TO_NOTIFICATION, "notifi");
53
54     public static final DataChangeScope DEFAULT_SCOPE = DataChangeScope.BASE;
55     public static final LogicalDatastoreType DEFAULT_DS = LogicalDatastoreType.CONFIGURATION;
56
57     public static final char EQUAL = ParserBuilderConstants.Deserializer.EQUAL;
58     public static final String DS_URI = RestconfConstants.SLASH + DATASTORE_PARAM_NAME + EQUAL;
59     public static final String SCOPE_URI = RestconfConstants.SLASH + SCOPE_PARAM_NAME + EQUAL;
60     public static final String SCHEMA_SUBSCRIBE_URI = "ws";
61     public static final String SCHEMA_SUBSCRIBE_SECURED_URI = "wss";
62     public static final String SCHEMA_UPGRADE_URI = "http";
63     public static final String SCHEMA_UPGRADE_SECURED_URI = "https";
64
65     public static final String DATA_SUBSCRIPTION = "data-change-event-subscription";
66     public static final String CREATE_DATA_SUBSCRIPTION = "create-" + DATA_SUBSCRIPTION;
67     public static final String NOTIFICATION_STREAM = "notification-stream";
68     public static final String CREATE_NOTIFICATION_STREAM = "create-" + NOTIFICATION_STREAM;
69
70     public static final String STREAMS_PATH = "ietf-restconf-monitoring:restconf-state/streams";
71     public static final String STREAM_PATH_PART = "/stream=";
72     public static final String STREAM_PATH = STREAMS_PATH + STREAM_PATH_PART;
73     public static final String STREAM_ACCESS_PATH_PART = "/access=";
74     public static final String STREAM_LOCATION_PATH_PART = "/location";
75
76     private RestconfStreamsConstants() {
77         throw new UnsupportedOperationException("Util class.");
78     }
79 }