Second part of onap rename
[appc.git] / appc-dispatcher / appc-request-handler / appc-request-handler-core / src / main / java / org / onap / appc / workingstatemanager / WorkingStateManager.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.onap.appc.workingstatemanager;
26
27 import org.onap.appc.requesthandler.exceptions.VNFNotFoundException;
28 import org.onap.appc.workingstatemanager.objects.VNFWorkingState;
29
30
31 public interface WorkingStateManager {
32
33     /**
34      * Return true if vnf state exists in working state map and state is STABLE else return false. If vnf does not exists in working state map throws vnf not found  exception.
35      * @param vnfId vnf Id to be verified for stable state
36      * @return True if vnf Exists and state is STABLE else False.
37      */
38     public boolean isVNFStable(String vnfId);
39
40     /**
41      * Updates working state for given vnf Id. Returns true if update was allowed and succeeded. Update will success only if the existing vnf state is 'STABLE' or
42      * if the registered ownerId is equal to the given ownerId or if the forceFlag is true.
43      * Note on case of simultaneously updates the latest updates will be failed, and another attempts will be done after refetching the updated data from persistent store.
44      * @param vnfId vnf Id to be updated
45      * @param workingState new working state
46      * @param ownerId
47      * @param forceFlag - force to update also on case given onwerId is different then the registered one
48      */
49     public boolean setWorkingState(String vnfId, VNFWorkingState workingState, String ownerId, boolean forceFlag);
50
51 }