Add support for RFC6536 extensions
[yangtools.git] / yang / 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.net.URI;
12 import java.util.Collection;
13 import org.opendaylight.yangtools.yang.common.QNameModule;
14 import org.opendaylight.yangtools.yang.common.Revision;
15 import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
16 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
17
18 /**
19  * Constants associated with RFC6536.
20  *
21  * @author Robert Varga
22  */
23 public final class NACMConstants {
24     private static final String MODULE_NAME = "ietf-netconf-acm";
25     private static final URI MODULE_NAMESPACE = URI.create("urn:ietf:params:xml:ns:yang:ietf-netconf-acm");
26     private static final Revision RFC6536_REVISION = Revision.of("2012-02-22");
27
28     /**
29      * Runtime RFC6536 identity.
30      */
31     public static final QNameModule RFC6536_MODULE = QNameModule.create(MODULE_NAMESPACE, RFC6536_REVISION).intern();
32
33     /**
34      * RFC6536 model source name.
35      */
36     public static final SourceIdentifier RFC6536_SOURCE = RevisionSourceIdentifier.create(MODULE_NAME,
37         RFC6536_REVISION);
38
39     /**
40      * Normative prefix to use when importing {@link #RFC6536_SOURCE}.
41      */
42     public static final String MODULE_PREFIX = "nacm";
43
44     private NACMConstants() {
45         throw new UnsupportedOperationException();
46     }
47
48     /**
49      * Return identifiers of all sources known to define NACM extension.
50      *
51      * @return Collection of identifiers.
52      */
53     public static Collection<SourceIdentifier> knownModelSources() {
54         return ImmutableList.of(RFC6536_SOURCE);
55     }
56 }