Promote rfc6536-model-api
[yangtools.git] / model / rfc6536-model-api / src / main / java / org / opendaylight / yangtools / rfc6536 / model / api / NACMConstants.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies, 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.rfc6536.model.api;
9
10 import com.google.common.collect.ImmutableList;
11 import java.util.Collection;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.yang.common.QNameModule;
14 import org.opendaylight.yangtools.yang.common.Revision;
15 import org.opendaylight.yangtools.yang.common.UnresolvedQName.Unqualified;
16 import org.opendaylight.yangtools.yang.common.XMLNamespace;
17 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
18
19 /**
20  * Constants associated with RFC6536.
21  */
22 @NonNullByDefault
23 public final class NACMConstants {
24     private static final Unqualified MODULE_NAME = Unqualified.of("ietf-netconf-acm").intern();
25     private static final XMLNamespace MODULE_NAMESPACE =
26         XMLNamespace.of("urn:ietf:params:xml:ns:yang:ietf-netconf-acm").intern();
27     private static final Revision RFC6536_REVISION = Revision.of("2012-02-22");
28     private static final Revision RFC8341_REVISION = Revision.of("2018-02-14");
29
30     /**
31      * Runtime RFC6536 identity.
32      */
33     public static final QNameModule RFC6536_MODULE = QNameModule.create(MODULE_NAMESPACE, RFC6536_REVISION).intern();
34
35     /**
36      * Runtime RFC8341 identity.
37      */
38     public static final QNameModule RFC8341_MODULE = QNameModule.create(MODULE_NAMESPACE, RFC8341_REVISION).intern();
39
40     /**
41      * RFC6536 model source name.
42      */
43     public static final SourceIdentifier RFC6536_SOURCE = new SourceIdentifier(MODULE_NAME, RFC6536_REVISION);
44
45     /**
46      * RFC8341 model source name.
47      */
48     public static final SourceIdentifier RFC8341_SOURCE = new SourceIdentifier(MODULE_NAME, RFC8341_REVISION);
49
50     /**
51      * Normative prefix to use when importing {@link #RFC6536_SOURCE}.
52      */
53     public static final String MODULE_PREFIX = "nacm";
54
55     private NACMConstants() {
56         // Hidden on purpose
57     }
58
59     /**
60      * Return identifiers of all sources known to define NACM extension.
61      *
62      * @return Collection of identifiers.
63      */
64     public static Collection<SourceIdentifier> knownModelSources() {
65         return ImmutableList.of(RFC6536_SOURCE, RFC8341_SOURCE);
66     }
67 }