Remove Rfc8040.Capabilities
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / Rfc8040.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.nb.rfc8040;
9
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.RestconfState;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.restconf.state.Streams;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.monitoring.rev170126.restconf.state.streams.Stream;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev190104.$YangModuleInfoImpl;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev190104.module.list.Module;
17 import org.opendaylight.yangtools.yang.common.QName;
18 import org.opendaylight.yangtools.yang.common.QNameModule;
19 import org.opendaylight.yangtools.yang.common.Revision;
20 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
21 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
22 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
23
24 /**
25  * Common constants defined and relating to RFC8040.
26  */
27 public final class Rfc8040 {
28     private static final YangInstanceIdentifier RESTCONF_STATE_STREAMS = YangInstanceIdentifier.create(
29         NodeIdentifier.create(RestconfState.QNAME), NodeIdentifier.create(Streams.QNAME),
30         NodeIdentifier.create(Stream.QNAME));
31     private static final QName NAME_QNAME = QName.create(Stream.QNAME, "name").intern();
32
33     private Rfc8040() {
34         // Hidden on purpose
35     }
36
37     @Beta
38     // FIXME: move this method somewhere else
39     public static @NonNull YangInstanceIdentifier restconfStateStreamPath(final String streamName) {
40         return restconfStateStreamPath(NodeIdentifierWithPredicates.of(Stream.QNAME, NAME_QNAME, streamName));
41     }
42
43     @Beta
44     // FIXME: move this method somewhere else
45     public static @NonNull YangInstanceIdentifier restconfStateStreamPath(final NodeIdentifierWithPredicates arg) {
46         return RESTCONF_STATE_STREAMS.node(arg);
47     }
48
49     /**
50      * Constants for ietf-yang-library model.
51      */
52     // FIXME: split this out
53     public static final class IetfYangLibrary {
54         public static final QNameModule MODULE_QNAME = $YangModuleInfoImpl.getInstance().getName().getModule();
55         public static final Revision REVISION = MODULE_QNAME.getRevision().orElseThrow();
56
57         public static final QName MODULE_SET_ID_LEAF_QNAME = QName.create(MODULE_QNAME, "module-set-id").intern();
58
59         public static final QName MODULE_QNAME_LIST = Module.QNAME;
60
61         private IetfYangLibrary() {
62             // Hidden on purpose
63         }
64     }
65 }