2 * Copyright (c) 2020 PANTHEON.tech, 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.restconf.nb.rfc8040.rests.services.impl;
10 import static java.util.Objects.requireNonNull;
12 import java.util.Collection;
13 import java.util.List;
14 import java.util.Map.Entry;
15 import java.util.Optional;
16 import org.eclipse.jdt.annotation.NonNull;
17 import org.opendaylight.yangtools.yang.common.QName;
18 import org.opendaylight.yangtools.yang.common.QNameModule;
19 import org.opendaylight.yangtools.yang.common.XMLNamespace;
20 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
21 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
22 import org.opendaylight.yangtools.yang.model.api.stmt.DataTreeEffectiveStatement;
23 import org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement;
24 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
26 @Deprecated(forRemoval = true, since = "4.0.0")
27 final class OperationsRestconfModule extends AbstractOperationsModule {
28 // There is no need to intern this nor add a revision, as we are providing the corresponding context anyway
29 static final @NonNull QNameModule NAMESPACE =
30 QNameModule.create(XMLNamespace.of("urn:ietf:params:xml:ns:yang:ietf-restconf"));
32 private final OperationsContainerSchemaNode operations;
34 OperationsRestconfModule(final OperationsContainerSchemaNode operations) {
35 this.operations = requireNonNull(operations);
39 public String getName() {
40 return "ietf-restconf";
44 public QNameModule getQNameModule() {
49 public String getPrefix() {
54 public Collection<DataSchemaNode> getChildNodes() {
55 return List.of(operations);
59 public DataSchemaNode dataChildByName(final QName name) {
60 return name.equals(operations.getQName()) ? operations : null;
64 public List<EffectiveStatement<?, ?>> effectiveSubstatements() {
65 return List.of(operations);
69 public ConformanceType conformance() {
70 return ConformanceType.IMPLEMENT;
74 public Optional<DataTreeEffectiveStatement<?>> findDataTreeNode(final QName qname) {
75 return qname.equals(operations.getQName()) ? Optional.of(operations) : Optional.empty();
79 public Optional<SchemaTreeEffectiveStatement<?>> findSchemaTreeNode(final QName qname) {
80 return qname.equals(operations.getQName()) ? Optional.of(operations) : Optional.empty();
84 public Collection<DataTreeEffectiveStatement<?>> dataTreeNodes() {
85 return List.of(operations);
89 public Collection<SchemaTreeEffectiveStatement<?>> schemaTreeNodes() {
90 return List.of(operations);
94 public Optional<ModuleEffectiveStatement> findReachableModule(final String prefix) {
95 return Optional.empty();
99 public Collection<Entry<String, ModuleEffectiveStatement>> reachableModules() {
104 public Optional<String> findNamespacePrefix(final QNameModule namespace) {
105 return Optional.empty();
109 public Collection<Entry<QNameModule, String>> namespacePrefixes() {