Merge of new rebased code
[appc.git] / appc-dg / appc-dg-shared / appc-dg-mdsal-store / src / main / java / org / openecomp / appc / mdsal / MDSALStore.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : APP-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
6  *                                              reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.openecomp.appc.mdsal;
23
24 import org.openecomp.appc.mdsal.exception.MDSALStoreException;
25 import org.openecomp.appc.mdsal.objects.BundleInfo;
26
27 import java.util.Date;
28
29 /**
30  * Provides APIs for interacting with MD-SAL store
31  */
32 public interface MDSALStore {
33
34     /**
35      * Checks the presence of any yang module in the MD-SAL store,
36      * <i>Due to limitation of SchemaContext interface of ODL that it does not
37      * contain the information about dynamically loaded yang modules, it
38      * checks the presence of OSGI bundle</i>
39      * @param moduleName Name of the Module
40      * @param revision revision of the Module
41      * @return returns true- module is present, false - module is absent
42      */
43     boolean isModulePresent(String moduleName, Date revision);
44
45     /**
46      * This method will be used to store yang module to MD-SAL store
47      * @param yang - yang module that need to be stored. In String format
48      * @param bundleInfo - Bundle Information that contains name , description,  version , location. These parameters used to create bundle which will push yang to MD-SAL store.
49      * @throws MDSALStoreException
50      */
51     void storeYangModule(String yang, BundleInfo bundleInfo) throws MDSALStoreException;
52
53     /**
54      * This method is used to store configuration JSON to MD-SAL store. It invokes store configuration Operation with required parameters
55      * @param moduleName - Yang module name where JSON need to be posted
56      * @param requestId - Request ID which is used as unique key for configuration JSON
57      * @param configJSON - String value of configuration JSON that needs to be stored in MD-SAl store
58      * @throws MDSALStoreException
59      */
60     void storeJson(String moduleName , String requestId , String configJSON ) throws MDSALStoreException;
61
62 }