Add netconf.api.CapabilityURN
[netconf.git] / protocol / netconf-api / src / main / java / org / opendaylight / netconf / api / CapabilityURN.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. 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.netconf.api;
9
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12
13 /**
14  * The contents of
15  * <a href="https://www.iana.org/assignments/netconf-capability-urns/netconf-capability-urns.xhtml">
16  * Network Configuration Protocol (NETCONF) Capability URNs</a> IANA registry as well as any other capabilities we
17  * explicitly recognize.
18  *
19  * <p>
20  * The basic concept of Capabilities is defined in
21  * <a href="https://www.rfc-editor.org/rfc/rfc6241#section-8">RFC6241 section 8</a>. While that section mentions
22  * capabilities are identified by URIs in general, the "identification" part is done through URNs, which are extended
23  * to URIs during negotiation by adding a query part where applicable.
24  */
25 @NonNullByDefault
26 public final class CapabilityURN {
27     /**
28      * The base NETCONF capability, as defined in
29      * <a href="https://www.rfc-editor.org/rfc/rfc4741.html#section-8.1">RFC4741, section 8.1</a>.
30      * @deprecated This capability identifies legacy NETCONF devices and has been superseded by {@link #BASE_1_1}, just
31      *             as RFC6241 obsoletes RFC4741.
32      */
33     @Deprecated
34     public static final String BASE = "urn:ietf:params:netconf:base:1.0";
35     /**
36      * The base NETCONF capability, as defined in
37      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.1">RFC6241, section 8.1</a>.
38      */
39     public static final String BASE_1_1 = "urn:ietf:params:netconf:base:1.1";
40     /**
41      * The Candidate Configuration Capability, as defined in
42      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.3">RFC6241, section 8.3</a>.
43      */
44     public static final String CANDIDATE = "urn:ietf:params:netconf:capability:candidate:1.0";
45     /**
46      * The Candidate Configuration Capability, as defined in
47      * <a href="https://www.rfc-editor.org/rfc/rfc4741.html#section-8.3">RFC4741, section 8.3</a>.
48      * @deprecated This capability is superseded by {@link #CONFIRMED_COMMIT_1_1}.
49      */
50     @Deprecated
51     public static final String CONFIRMED_COMMIT = "urn:ietf:params:netconf:capability:confirmed-commit:1.0";
52     /**
53      * The Rollback-on-Error Capability, as defined in
54      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.4">RFC6241, section 8.4</a>.
55      */
56     public static final String CONFIRMED_COMMIT_1_1 = "urn:ietf:params:netconf:capability:confirmed-commit:1.1";
57     /**
58      * The EXI Capability, as defined in
59      * <a href="https://datatracker.ietf.org/doc/html/draft-varga-netconf-exi-capability-01#section-3">
60      * draft-varga-netconf-exi-capability-01, section 3</a>. Note this is an expired IETF draft capability and subject
61      * to change.
62      */
63     @Beta
64     public static final String EXI = "urn:ietf:params:netconf:capability:exi:1.0";
65     /**
66      * The Interleave Capability, as defined in
67      * <a href="https://www.rfc-editor.org/rfc/rfc5277.html#section-6">RFC5277, section 6</a>.
68      */
69     public static final String INTERLEAVE = "urn:ietf:params:netconf:capability:interleave:1.0";
70     /**
71      * The Validate Capability, as defined in
72      * <a href="https://www.rfc-editor.org/rfc/rfc5277.html#section-3.1">RFC5277, section 3.1</a>.
73      */
74     public static final String NOTIFICATION = "urn:ietf:params:netconf:capability:notification:1.0";
75     /**
76      * The Partial Locking Capability, as defined in
77      * <a href="https://www.rfc-editor.org/rfc/rfc5717.html#section-2">RFC5715, section 2</a>.
78      */
79     public static final String PARTIAL_LOCK = "urn:ietf:params:netconf:capability:partial-lock:1.0";
80     /**
81      * The Rollback-on-Error Capability, as defined in
82      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.5">RFC6241, section 8.5</a>.
83      */
84     public static final String ROLLBACK_ON_ERROR = "urn:ietf:params:netconf:capability:rollback-on-error:1.0";
85     /**
86      * The Distinct Startup Capability, as defined in
87      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.7">RFC6241, section 8.7</a>.
88      */
89     public static final String STARTUP = "urn:ietf:params:netconf:capability:startup:1.0";
90     /**
91      * The Time Capability, as defined in
92      * <a href="https://www.rfc-editor.org/rfc/rfc7758.html#section-4">RFC7758, section 4</a>.
93      */
94     public static final String TIME = "urn:ietf:params:netconf:capability:time:1.0";
95     /**
96      * The URL Capability, as defined in
97      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.8">RFC6241, section 8.8</a>.
98      */
99     public static final String URL = "urn:ietf:params:netconf:capability:url:1.0";
100     /**
101      * The Validate Capability, as defined in
102      * <a href="https://www.rfc-editor.org/rfc/rfc4741.html#section-8.6">RFC4741, section 8.6</a>.
103      * @deprecated This capability is superseded by {@link #VALIDATE_1_1}.
104      */
105     @Deprecated
106     public static final String VALIDATE = "urn:ietf:params:netconf:capability:validate:1.0";
107     /**
108      * The Validate Capability, as defined in
109      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.6">RFC6241, section 8.6</a>.
110      */
111     public static final String VALIDATE_1_1 = "urn:ietf:params:netconf:capability:validate:1.1";
112     /**
113      * The With-defaults Capability, as defined in
114      * <a href="https://www.rfc-editor.org/rfc/rfc6243.html#section-4">RFC6243, section 4</a>.
115      */
116     public static final String WITH_DEFAULTS = "urn:ietf:params:netconf:capability:with-defaults:1.0";
117     /**
118      * The With-defaults Capability, as augmented by
119      * <a href="https://www.rfc-editor.org/rfc/rfc8526#section-3.1.1.2">RFC8526, section 3.1.1.2</a>.
120      */
121     public static final String WITH_OPERATIONAL_DEFAULTS =
122         "urn:ietf:params:netconf:capability:with-operational-defaults:1.0";
123     /**
124      * The Writable-Running Capability, as defined in
125      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.2">RFC6241, section 8.2</a>.
126      */
127     public static final String WRITABLE_RUNNING = "urn:ietf:params:netconf:capability:writable-running:1.0";
128     /**
129      * The XPath Capability, as defined in
130      * <a href="https://www.rfc-editor.org/rfc/rfc6241.html#section-8.9">RFC6241, section 8.9</a>.
131      */
132     public static final String XPATH = "urn:ietf:params:netconf:capability:xpath:1.0";
133     /**
134      * The YANG Module Library Capability, as defined in
135      * <a href="hhttps://www.rfc-editor.org/rfc/rfc7950.html#section-5.6.4">RFC7950, section 5.6.4</a> and further
136      * specified by <a href="https://www.rfc-editor.org/rfc/rfc7895">RFC7895</a>. Note this applies to NETCONF endpoints
137      * which DO NOT support Network Management Datastore Architecture as specified by
138      * <a href="https://www.rfc-editor.org/rfc/rfc8342">RFC8342</a>.
139      */
140     public static final String YANG_LIBRARY = "urn:ietf:params:netconf:capability:yang-library:1.0";
141     /**
142      * The YANG Library Capability, as defined in
143      * <a href="https://www.rfc-editor.org/rfc/rfc8526.html#section-2">RFC8526, section 2</a> and further specified
144      * by <a href="https://www.rfc-editor.org/rfc/rfc8525">RFC8525</a>. Note this applies to NETCONF endpoints
145      * which DO support Network Management Datastore Architecture as specified by
146      * <a href="https://www.rfc-editor.org/rfc/rfc8342">RFC8342</a>.
147      */
148     public static final String YANG_LIBRARY_1_1 = "urn:ietf:params:netconf:capability:yang-library:1.1";
149
150     private CapabilityURN() {
151         // Hidden on purpose
152     }
153 }