Standalone yang library data writer
[netconf.git] / apps / yanglib-mdsal-writer / src / main / java / org / opendaylight / netconf / yanglib / writer / YangLibrarySchemaSourceUrlProvider.java
1 /*
2  * Copyright (c) 2023 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.yanglib.writer;
9
10 import java.util.Optional;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
14 import org.opendaylight.yangtools.yang.common.Revision;
15
16 /**
17  * The service providing URLs to yang schema sources.
18  */
19 // TODO: current interface is a part of integration with YangLibrarySupport and expected
20 //  to be removed once the similar interface is implemented there.
21 //  Addresses https://jira.opendaylight.org/browse/MDSAL-833
22 public interface YangLibrarySchemaSourceUrlProvider {
23
24     /**
25      * Provides yang schema source URL where it can be downloaded from.
26      *
27      * @param moduleSetName the module set name the requested resource belongs to
28      * @param moduleName referenced module or submodule name
29      * @param revision optional revision
30      *
31      * @return optional of URL to requested resource
32      */
33     Optional<Uri> getSchemaSourceUrl(@NonNull String moduleSetName, @NonNull String moduleName,
34         @Nullable Revision revision);
35 }
36