3ee560f4f427a70f8d9d483f10fc48358eb688b7
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / client / sdnc / beans / SDNCRequest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.client.sdnc.beans;
22
23 import java.io.Serializable;
24 import java.time.Duration;
25 import java.util.UUID;
26
27 import org.onap.so.client.sdnc.endpoint.SDNCTopology;
28 import org.apache.commons.lang3.builder.HashCodeBuilder;
29 import org.apache.commons.lang3.builder.EqualsBuilder;
30
31 public class SDNCRequest implements Serializable{
32         
33         /**
34          * 
35          */
36         private static final long serialVersionUID = 4679678988657593282L;
37         private String timeOut = "PT1H";
38         private SDNCTopology topology;
39         private String CorrelationValue = UUID.randomUUID().toString();
40         private String CorrelationName = "SDNCCallback";
41         private Object SDNCPayload;
42         
43
44         public String getTimeOut() {
45                 return timeOut;
46         }
47         
48         public void setTimeOut(String timeOut) {
49                 this.timeOut = timeOut;
50         }
51
52         public SDNCTopology getTopology() {
53                 return topology;
54         }
55
56         public void setTopology(SDNCTopology topology) {
57                 this.topology = topology;
58         }
59
60         public String getCorrelationValue() {
61                 return CorrelationValue;
62         }
63         public void setCorrelationValue(String correlationValue) {
64                 CorrelationValue = correlationValue;
65         }
66         public String getCorrelationName() {
67                 return CorrelationName;
68         }
69         public void setCorrelationName(String correlationName) {
70                 CorrelationName = correlationName;
71         }
72         public Object getSDNCPayload() {
73                 return SDNCPayload;
74         }
75         public void setSDNCPayload(Object sDNCPayload) {
76                 SDNCPayload = sDNCPayload;
77         }
78         
79         @Override
80         public boolean equals(final Object other) {
81                 if (!(other instanceof SDNCRequest)) {
82                         return false;
83                 }
84                 SDNCRequest castOther = (SDNCRequest) other;
85                 return new EqualsBuilder().append(CorrelationValue, castOther.CorrelationValue)
86                                 .append(CorrelationName, castOther.CorrelationName).isEquals();
87         }
88
89         @Override
90         public int hashCode() {
91                 return new HashCodeBuilder().append(CorrelationValue).append(CorrelationName).toHashCode();
92         }
93
94 }