2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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.yangtools.openconfig.model.api;
10 import com.google.common.collect.ImmutableList;
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;
19 * Constants associated with OpenDaylight extension in yang-ext.yang.
21 * @author Robert Varga
23 public final class OpenConfigConstants {
24 private static final String MODULE_NAME = "yang-ext";
25 private static final URI MODULE_NAMESPACE = URI.create("http://openconfig.net/yang/openconfig-ext");
27 // Initial revision, defining semantic-version
28 private static final Revision SEMVER_REVISION = Revision.of("2015-10-09");
30 // Revised extension, adds openconfig-encrypted-value
31 private static final Revision ENCRYPTED_VALUE_REVISION = Revision.of("2017-01-29");
33 // Revised extension, renames openconfig-encrypted-value to openconfig-hashed-value
34 private static final Revision HASHED_VALUE_REVISION = Revision.of("2017-04-11");
37 * Runtime identity of initial model.
39 public static final QNameModule SEMVER_MODULE = QNameModule.create(MODULE_NAMESPACE, SEMVER_REVISION).intern();
42 * Runtime identity of model which exposed encrypted-value.
44 public static final QNameModule ENCRYPTED_VALUE_MODULE = QNameModule.create(MODULE_NAMESPACE,
45 ENCRYPTED_VALUE_REVISION).intern();
48 * Runtime identity of model which exposed encrypted-value.
50 public static final QNameModule HASHED_VALUE_MODULE = QNameModule.create(MODULE_NAMESPACE, HASHED_VALUE_REVISION)
54 * Original model source name.
56 public static final SourceIdentifier SEMVER_SOURCE = RevisionSourceIdentifier.create(MODULE_NAME,
60 * Original model source name.
62 public static final SourceIdentifier ENCRYPTED_VALUE_SOURCE = RevisionSourceIdentifier.create(MODULE_NAME,
63 ENCRYPTED_VALUE_REVISION);
66 * Original model source name.
68 public static final SourceIdentifier HASHED_VALUE_SOURCE = RevisionSourceIdentifier.create(MODULE_NAME,
69 HASHED_VALUE_REVISION);
72 * Normative prefix to use when importing {@link #SEMVER_SOURCE} and later.
74 public static final String MODULE_PREFIX = "oc-ext";
76 private OpenConfigConstants() {
77 throw new UnsupportedOperationException();
81 * Return identifiers of all sources known to define the metadata extension.
83 * @return Collection of identifiers.
85 public static Collection<SourceIdentifier> knownModelSources() {
86 return ImmutableList.of(HASHED_VALUE_SOURCE, ENCRYPTED_VALUE_SOURCE, SEMVER_SOURCE);