2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.restconf.nb.rfc8040;
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;
25 * Common constants defined and relating to RFC8040.
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();
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));
44 // FIXME: move this method somewhere else
45 public static @NonNull YangInstanceIdentifier restconfStateStreamPath(final NodeIdentifierWithPredicates arg) {
46 return RESTCONF_STATE_STREAMS.node(arg);
50 * Constants for ietf-yang-library model.
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();
57 public static final QName MODULE_SET_ID_LEAF_QNAME = QName.create(MODULE_QNAME, "module-set-id").intern();
59 public static final QName MODULE_QNAME_LIST = Module.QNAME;
61 private IetfYangLibrary() {