Refactor NetconfDeviceSchemas
[netconf.git] / plugins / netconf-client-mdsal / src / main / java / org / opendaylight / netconf / client / mdsal / api / NetconfDeviceSchemas.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.netconf.client.mdsal.api;
9
10 import static java.util.Objects.requireNonNull;
11
12 import java.util.List;
13 import java.util.Set;
14 import org.eclipse.jdt.annotation.NonNullByDefault;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
17 import org.opendaylight.yangtools.yang.model.api.source.SourceRepresentation;
18 import org.opendaylight.yangtools.yang.model.api.stmt.FeatureSet;
19
20 /**
21  * The specification of the {@link SourceRepresentation}s and how they need to be assembled to form the device's
22  * {@link EffectiveModelContext}.
23  *
24  * @param requiredSources the set of sources that are required to form the accurate model of the device
25  * @param librarySources additional sources that should be presented to YANG parser, typically to resolve submodules
26  *                       when the originator of this object is Just Not Sure(tm)
27  * @param providedSources {@link ProvidedSources} grouped by their representation
28  */
29 // FIXME: this structure will need to be updated for NMDA to support per-datastore model contexts
30 @NonNullByDefault
31 public record NetconfDeviceSchemas(
32         // FIXME: NETCONF-840: use SourceIdentifier
33         Set<QName> requiredSources,
34         FeatureSet features,
35         // FIXME: NETCONF-840: use SourceIdentifier
36         Set<QName> librarySources,
37         List<ProvidedSources<?>> providedSources) {
38     public NetconfDeviceSchemas {
39         requiredSources = Set.copyOf(requiredSources);
40         requireNonNull(features);
41         librarySources = Set.copyOf(librarySources);
42         providedSources = List.copyOf(providedSources);
43     }
44 }