Containerization feature of SO
[so.git] / mso-api-handlers / mso-requests-db / src / main / java / org / onap / so / db / request / beans / ArchivedInfraRequests.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.db.request.beans;
22
23 import java.util.Objects;
24
25 import javax.persistence.Entity;
26 import javax.persistence.Table;
27
28 import org.apache.commons.lang3.builder.ToStringBuilder;
29
30 @Entity
31 @Table(name = "archived_infra_requests")
32 public class ArchivedInfraRequests extends InfraRequests {
33
34         private static final long serialVersionUID = 7132783898142451603L;
35
36         public ArchivedInfraRequests() {
37         }
38
39         public ArchivedInfraRequests(String requestId, String action) {
40                 setRequestId(requestId);
41                 setAction(action);
42         }
43
44         public ArchivedInfraRequests(String requestId) {
45                 setRequestId(requestId);
46         }
47
48         @Override
49         public boolean equals(final Object other) {
50                 if (this == other) {
51                         return true;
52                 }
53                 if (!(other instanceof ArchivedInfraRequests)) {
54                         return false;
55                 }
56                 ArchivedInfraRequests castOther = (ArchivedInfraRequests) other;
57                 return Objects.equals(getRequestId(), castOther.getRequestId());
58         }
59
60         @Override
61         public int hashCode() {
62                 return Objects.hash(getRequestId());
63         }
64
65         @Override
66         public String toString() {
67                 return new ToStringBuilder(this).append("requestId", getRequestId())
68                                 .append("clientRequestId", getClientRequestId()).append("action", getAction())
69                                 .append("requestStatus", getRequestStatus()).append("statusMessage", getStatusMessage())
70                                 .append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime())
71                                 .append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName())
72                                 .append("vnfType", getVnfType()).append("serviceType", getServiceType())
73                                 .append("aicNodeClli", getAicNodeClli()).append("tenantId", getTenantId())
74                                 .append("provStatus", getProvStatus()).append("vnfParams", getVnfParams())
75                                 .append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody())
76                                 .append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy())
77                                 .append("modifyTime", getModifyTime()).append("requestType", getRequestType())
78                                 .append("volumeGroupId", getVolumeGroupId()).append("volumeGroupName", getVolumeGroupName())
79                                 .append("vfModuleId", getVfModuleId()).append("vfModuleName", getVfModuleName())
80                                 .append("vfModuleModelName", getVfModuleModelName()).append("aaiServiceId", getAaiServiceId())
81                                 .append("aicCloudRegion", getAicCloudRegion()).append("callBackUrl", getCallBackUrl())
82                                 .append("correlator", getCorrelator()).append("serviceInstanceId", getServiceInstanceId())
83                                 .append("serviceInstanceName", getServiceInstanceName()).append("requestScope", getRequestScope())
84                                 .append("requestAction", getRequestAction()).append("networkId", getNetworkId())
85                                 .append("networkName", getNetworkName()).append("networkType", getNetworkType())
86                                 .append("requestorId", getRequestorId()).append("configurationId", getConfigurationId())
87                                 .append("configurationName", getConfigurationName()).append("operationalEnvId", getOperationalEnvId())
88                                 .append("operationalEnvName", getOperationalEnvName()).toString();
89         }
90
91 }