916c9e4011f32aa80fad7796f5ed41f709db879d
[so.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2019 Nordix Foundation.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.adapters.vnfmadapter.jobmanagement;
22
23 /**
24  * Represents an operation on a VNFM.
25  */
26 public class VnfmOperation {
27
28     private final String vnfmId;
29     private final String operationId;
30     private boolean waitForNotificationForSuccess = false;
31     private boolean isNotificationProcessed = false;
32
33     public VnfmOperation(final String vnfmId, final String operationId, final boolean waitForNotificationForSuccess) {
34         this.vnfmId = vnfmId;
35         this.operationId = operationId;
36         this.waitForNotificationForSuccess = waitForNotificationForSuccess;
37     }
38
39     /**
40      * Get the ID of the operation on the VNFM.
41      *
42      * @return the ID of the operation on the VNFM
43      */
44     public String getOperationId() {
45         return operationId;
46     }
47
48     /**
49      * Get the ID of the VNFM the operation is carried out by.
50      *
51      * @return the ID of the VNFM
52      */
53     public String getVnfmId() {
54         return vnfmId;
55     }
56
57     /**
58      * Check if a notification should be processed before the operation is considered successfully
59      * completed.
60      *
61      * @return <code>true></code> if a notification must be processed before the operation is considered
62      *         successfully completed, <code>false</code> otherwise
63      */
64     public boolean isWaitForNotificationForSuccess() {
65         return waitForNotificationForSuccess;
66     }
67
68     /**
69      * Set the required notification has been processed for the operation.
70      */
71     public void setNotificationProcessed() {
72         this.isNotificationProcessed = true;
73     }
74
75     /**
76      * Check if the required notification has been processed.
77      *
78      * @return <code>true</code> of the required notification has been processed, <code>false</code>
79      *         otherwise
80      */
81     public boolean isNotificationProcessed() {
82         return isNotificationProcessed;
83     }
84
85 }