14756f2cfdeb4d93367944a6f9853819fc76d7be
[yangtools.git] / model / rfc6241-model-api / src / main / java / org / opendaylight / yangtools / rfc6241 / model / api / NetconfConstants.java
1 /*
2  * Copyright (c) 2019 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.yangtools.rfc6241.model.api;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableList;
12 import java.util.Collection;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.yangtools.yang.common.QNameModule;
15 import org.opendaylight.yangtools.yang.common.Revision;
16 import org.opendaylight.yangtools.yang.common.XMLNamespace;
17 import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
18 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
19
20 /**
21  * Constants associated with RFC6241.
22  *
23  * @author Robert Varga
24  */
25 @Beta
26 @NonNullByDefault
27 public final class NetconfConstants {
28     private static final String MODULE_NAME = "ietf-netconf";
29     private static final XMLNamespace MODULE_NAMESPACE =
30         XMLNamespace.of("urn:ietf:params:xml:ns:netconf:base:1.0").intern();
31     private static final Revision RFC6241_REVISION = Revision.of("2011-06-01");
32
33     /**
34      * Runtime RFC6241 identity.
35      */
36     public static final QNameModule RFC6241_MODULE = QNameModule.create(MODULE_NAMESPACE, RFC6241_REVISION).intern();
37
38     /**
39      * RFC6241 model source name.
40      */
41     public static final SourceIdentifier RFC6241_SOURCE = RevisionSourceIdentifier.create(MODULE_NAME,
42         RFC6241_REVISION);
43
44     /**
45      * Normative prefix to use when importing {@link #RFC6241_SOURCE}.
46      */
47     public static final String MODULE_PREFIX = "nc";
48
49     private NetconfConstants() {
50         // Hidden on purpose
51     }
52
53     /**
54      * Return identifiers of all sources known to define NACM extension.
55      *
56      * @return Collection of identifiers.
57      */
58     public static Collection<SourceIdentifier> knownModelSources() {
59         return ImmutableList.of(RFC6241_SOURCE);
60     }
61 }