Update ASDC References to SDC 1/2
[appc.git] / appc-sdc-listener / appc-yang-generator / src / main / java / org / openecomp / appc / yang / YANGGenerator.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.openecomp.appc.yang;
26
27 import org.openecomp.appc.yang.exception.YANGGenerationException;
28
29 import java.io.OutputStream;
30
31 /**
32  * The Interface YANGGenerator - provides method to generate YANG file from TOSCA.
33  */
34 public interface YANGGenerator {
35
36     /**
37      * Generate YANG from TOSCA.
38      * if any exceptional Type is coming in the input tosca as a part of configuration parameter property, YANGGenerationException will be thrown.
39      * This API is not supporting below mentioned built-in Types:
40      * bits, decimal64, enumeration, identityref, leafref, union
41      *
42      * @param uniqueID - Set as module name in the yang, mandatory, cannot be null or empty
43      * @param tosca - TOSCA String from which the YANG is to be generated, mandatory, cannot be null or empty
44      * @param stream - The outputStream to which the generated yang is written, mandatory, cannot be null
45      * @throws YANGGenerationException - Thrown when any error occurred during method execution, the origin can be found from ex.getCause() or ex.getMessage()
46      */
47
48     void generateYANG(String uniqueID, String tosca, OutputStream stream) throws YANGGenerationException;
49 }