blob: de151d1d12508ce1ca6826e7ba32cd8053b3e840 [file] [log] [blame]
Thomas Vachuskaad37e372017-08-03 12:07:01 -07001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yang;
18
19import com.google.common.annotations.Beta;
20
21import java.io.IOException;
22import java.io.InputStream;
23
24/**
25 * Runtime service for compiling YANG source files and packaging the compiled
26 * artifacts into a ready-to-load application.
27 */
28@Beta
29public interface YangLiveCompilerService {
30
31 /**
32 * Compiles the YANG source file(s) contained in the specified input
33 * stream either as individual YANG source file, or as a JAR/ZIP collection
34 * of YANG source files.
35 *
36 * @param modelId model identifier
37 * @param yangSources input stream containing a single YANG source file
38 * or a JAR/ZIP archive containing collection of YANG
39 * source files
40 * @return input stream containing a packaged ONOS application JAR file
41 * @throws IOException if issues arise when reading the yang sources stream
42 */
43 InputStream compileYangFiles(String modelId, InputStream yangSources) throws IOException;
44
45}