2 * Copyright 2016-2017, Nokia Corporation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification;
18 import com.nokia.cbam.lcm.v32.model.OperationStatus;
19 import java.util.Objects;
22 * Represents a notification successfully processed by the {@link LifecycleChangeNotificationManager}
24 class ProcessedNotification {
25 private String operationExecutionId;
26 //do not remove field the {@link LifecycleChangeNotificationManager} uses the equals
27 // method to compare notifications
28 private OperationStatus status;
30 ProcessedNotification(String operationExecutionId, OperationStatus status) {
31 this.operationExecutionId = operationExecutionId;
36 * @return the identifier of the operation
38 public String getOperationExecutionId() {
39 return operationExecutionId;
43 * @param operationExecutionId the identifier of the operation
45 public void setOperationExecutionId(String operationExecutionId) {
46 this.operationExecutionId = operationExecutionId;
50 * @return the status of the operation
52 public OperationStatus getStatus() {
57 * @param status the status of the operation
59 public void setStatus(OperationStatus status) {
64 //generated code. This is the recommended way to formulate equals
65 @SuppressWarnings({"squid:S00122", "squid:S1067"})
66 public boolean equals(Object o) {
67 if (this == o) return true;
68 if (o == null || getClass() != o.getClass()) return false;
69 ProcessedNotification that = (ProcessedNotification) o;
70 return Objects.equals(operationExecutionId, that.operationExecutionId) &&
71 status == that.status;
75 public int hashCode() {
76 return Objects.hash(operationExecutionId, status);
80 public String toString() {
81 return "ProcessedNotification{" +
82 "operationExecutionId=" + operationExecutionId + '"' +
83 ", status=" + status +