5526a7fe483c22a3b042f6c7447787afae3064fc
[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  * 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.mdsal;
26
27 import org.openecomp.appc.mdsal.exception.MDSALStoreException;
28 import org.openecomp.appc.mdsal.objects.BundleInfo;
29
30 import java.util.Date;
31
32 /**
33  * Provides APIs for interacting with MD-SAL store
34  */
35 public interface MDSALStore {
36
37     /**
38      * Checks the presence of any yang module in the MD-SAL store,
39      * <i>Due to limitation of SchemaContext interface of ODL that it does not
40      * contain the information about dynamically loaded yang modules, it
41      * checks the presence of OSGI bundle</i>
42      * @param moduleName Name of the Module
43      * @param revision revision of the Module
44      * @return returns true- module is present, false - module is absent
45      */
46     boolean isModulePresent(String moduleName, Date revision);
47
48     /**
49      * This method will be used to store yang module to MD-SAL store
50      * @param yang - yang module that need to be stored. In String format
51      * @param bundleInfo - Bundle Information that contains name , description,  version , location. These parameters used to create bundle which will push yang to MD-SAL store.
52      * @throws MDSALStoreException
53      */
54     void storeYangModule(String yang, BundleInfo bundleInfo) throws MDSALStoreException;
55
56     /**
57      * This method is used to store configuration JSON to MD-SAL store. It invokes store configuration Operation with required parameters
58      * @param moduleName - Yang module name where JSON need to be posted
59      * @param requestId - Request ID which is used as unique key for configuration JSON
60      * @param configJSON - String value of configuration JSON that needs to be stored in MD-SAl store
61      * @throws MDSALStoreException
62      */
63     void storeJson(String moduleName , String requestId , String configJSON ) throws MDSALStoreException;
64
65 }