e6f80b1a74dbe1eddb4adc343033e780ab3c057d
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / Draft15.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;
9
10 import org.opendaylight.yangtools.yang.common.QName;
11
12 /**
13  * Base Draft for Restconf project
14  * <ul>
15  * <li>Supported {@link MediaTypes}
16  * <li>Constants for modules
17  * <ul>
18  * <li>{@link RestconfModule}
19  * <li>{@link MonitoringModule}
20  * </ul>
21  * </ul>
22  *
23  * We used old revision {@link Draft15.RestconfModule#REVISION} of restconf yang
24  * because the latest restconf draft has to be supported by Yang 1.1 and we are
25  * not. Then, this is only partial implementation of the latest restconf draft.
26  */
27 public final class Draft15 {
28
29     private Draft15() {
30         throw new UnsupportedOperationException("Util class");
31     }
32
33     /**
34      * Set of application specific media types to identify each of the available
35      * resource types
36      */
37     public static final class MediaTypes {
38
39         private MediaTypes() {
40             throw new UnsupportedOperationException("Util class");
41         }
42
43         public static final String API = "application/yang.api";
44         public static final String DATASTORE = "application/yang.datastore";
45         public static final String DATA = "application/yang.data";
46         public static final String OPERATION = "application/yang.operation";
47         public static final String PATCH = "application/yang.patch";
48         public static final String PATCH_STATUS = "application/yang.patch-status";
49         public static final String ERRORS = "application/yang.errors";
50         public static final String YIN = "application/yin";
51         public static final String YANG = "application/yang";
52     }
53
54     /**
55      * Constants for restconf module
56      *
57      */
58     public static final class RestconfModule {
59
60         private RestconfModule() {
61             throw new UnsupportedOperationException("Util class");
62         }
63
64         public static final String REVISION = "2013-10-19";
65
66         public static final String NAME = "ietf-restconf";
67
68         public static final String NAMESPACE = "urn:ietf:params:xml:ns:yang:ietf-restconf";
69
70         public static final String RESTCONF_GROUPING_SCHEMA_NODE = "restconf";
71
72         public static final String RESTCONF_CONTAINER_SCHEMA_NODE = "restconf";
73
74         public static final String MODULES_CONTAINER_SCHEMA_NODE = "modules";
75
76         public static final String MODULE_LIST_SCHEMA_NODE = "module";
77
78         public static final String OPERATIONS_CONTAINER_SCHEMA_NODE = "operations";
79
80         public static final String ERRORS_GROUPING_SCHEMA_NODE = "errors";
81
82         public static final String ERRORS_CONTAINER_SCHEMA_NODE = "errors";
83
84         public static final String ERROR_LIST_SCHEMA_NODE = "error";
85
86         public static final QName IETF_RESTCONF_QNAME = QName.create(Draft15.RestconfModule.NAMESPACE, Draft15.RestconfModule.REVISION,
87                 Draft15.RestconfModule.NAME);
88
89         public static final QName ERRORS_CONTAINER_QNAME = QName.create(IETF_RESTCONF_QNAME, ERRORS_CONTAINER_SCHEMA_NODE);
90
91         public static final QName ERROR_LIST_QNAME = QName.create(IETF_RESTCONF_QNAME, ERROR_LIST_SCHEMA_NODE);
92
93         public static final QName ERROR_TYPE_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-type");
94
95         public static final QName ERROR_TAG_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-tag");
96
97         public static final QName ERROR_APP_TAG_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-app-tag");
98
99         public static final QName ERROR_MESSAGE_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-message");
100
101         public static final QName ERROR_INFO_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-info");
102
103         public static final QName ERROR_PATH_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-path");
104     }
105
106     /**
107      * Constants for restconf module
108      *
109      */
110     public static final class MonitoringModule {
111
112         private MonitoringModule() {
113             throw new UnsupportedOperationException("Util class");
114         }
115
116         public static final String STREAMS_CONTAINER_SCHEMA_NODE = "streams";
117
118         public static final String STREAM_LIST_SCHEMA_NODE = "stream";
119     }
120 }