Bug 6325 - upgrade draft11 to draft15 - change media types
[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 DATA = "application/yang-data";
44         public static final String PATCH = "application/yang.patch";
45         public static final String PATCH_STATUS = "application/yang.patch-status";
46         public static final String YIN = "application/yin";
47         public static final String YANG = "application/yang";
48     }
49
50     /**
51      * Constants for restconf module
52      *
53      */
54     public static final class RestconfModule {
55
56         private RestconfModule() {
57             throw new UnsupportedOperationException("Util class");
58         }
59
60         public static final String REVISION = "2013-10-19";
61
62         public static final String NAME = "ietf-restconf";
63
64         public static final String NAMESPACE = "urn:ietf:params:xml:ns:yang:ietf-restconf";
65
66         public static final String RESTCONF_GROUPING_SCHEMA_NODE = "restconf";
67
68         public static final String RESTCONF_CONTAINER_SCHEMA_NODE = "restconf";
69
70         public static final String MODULES_CONTAINER_SCHEMA_NODE = "modules";
71
72         public static final String MODULE_LIST_SCHEMA_NODE = "module";
73
74         public static final String OPERATIONS_CONTAINER_SCHEMA_NODE = "operations";
75
76         public static final String ERRORS_GROUPING_SCHEMA_NODE = "errors";
77
78         public static final String ERRORS_CONTAINER_SCHEMA_NODE = "errors";
79
80         public static final String ERROR_LIST_SCHEMA_NODE = "error";
81
82         public static final QName IETF_RESTCONF_QNAME = QName.create(Draft15.RestconfModule.NAMESPACE, Draft15.RestconfModule.REVISION,
83                 Draft15.RestconfModule.NAME);
84
85         public static final QName ERRORS_CONTAINER_QNAME = QName.create(IETF_RESTCONF_QNAME, ERRORS_CONTAINER_SCHEMA_NODE);
86
87         public static final QName ERROR_LIST_QNAME = QName.create(IETF_RESTCONF_QNAME, ERROR_LIST_SCHEMA_NODE);
88
89         public static final QName ERROR_TYPE_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-type");
90
91         public static final QName ERROR_TAG_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-tag");
92
93         public static final QName ERROR_APP_TAG_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-app-tag");
94
95         public static final QName ERROR_MESSAGE_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-message");
96
97         public static final QName ERROR_INFO_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-info");
98
99         public static final QName ERROR_PATH_QNAME = QName.create(IETF_RESTCONF_QNAME, "error-path");
100     }
101
102     /**
103      * Constants for restconf module
104      *
105      */
106     public static final class MonitoringModule {
107
108         private MonitoringModule() {
109             throw new UnsupportedOperationException("Util class");
110         }
111
112         public static final String STREAMS_CONTAINER_SCHEMA_NODE = "streams";
113
114         public static final String STREAM_LIST_SCHEMA_NODE = "stream";
115     }
116 }