Rework BaseScheams
[netconf.git] / plugins / netconf-client-mdsal / src / main / java / org / opendaylight / netconf / client / mdsal / api / BaseNetconfSchema.java
1 /*
2  * Copyright (c) 2024 PANTHEON.tech, 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.netconf.client.mdsal.api;
9
10 import com.google.common.collect.ImmutableMap;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.yangtools.concepts.Immutable;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.data.api.schema.MountPointContext;
15 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
16 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
17
18 /**
19  * A {@link MountPointContext} corresponding to a NETCONF baseline advertized by a device. This baseline is sufficient
20  * to invoke basic NETCONF operations and perform schema discovery.
21  */
22 @NonNullByDefault
23 public interface BaseNetconfSchema extends Immutable {
24     /**
25      * Return the {@link MountPointContext}.
26      *
27      * @return the mount point context
28      */
29     MountPointContext mountPointContext();
30
31     /**
32      * Return the {@link MountPointContext}. This is a convenience equivalent to
33      * {@code mountPointContext().modelContext()}.
34      *
35      * @return the mount point context
36      */
37     default EffectiveModelContext modelContext() {
38         return mountPointContext().modelContext();
39     }
40
41     /**
42      * Return the set of RPCs available in {@link #modelContext()}.
43      *
44      * @return the set of available RPCs
45      */
46     ImmutableMap<QName, ? extends RpcDefinition> mappedRpcs();
47 }