From a10606e383ce6c872cb7c95fe1d5e65565827813 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Fri, 26 Apr 2019 21:10:25 -0400 Subject: Store Cloud Request in Database Store Cloud Request in Database, add to request service Add query Param to Plural to include cloud data Change-Id: If906d28d0dc9c0c804e550e2074af3d75ba46d32 Issue-ID: SO-1807 Signed-off-by: Benjamin, Max (mb388a) --- .../so/serviceinstancebeans/CloudRequestData.java | 59 ++++++++++++++++++++++ .../org/onap/so/serviceinstancebeans/Request.java | 15 +++++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 common/src/main/java/org/onap/so/serviceinstancebeans/CloudRequestData.java (limited to 'common/src') diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/CloudRequestData.java b/common/src/main/java/org/onap/so/serviceinstancebeans/CloudRequestData.java new file mode 100644 index 0000000000..abaef26562 --- /dev/null +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/CloudRequestData.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + + +package org.onap.so.serviceinstancebeans; + +import org.apache.commons.lang3.builder.ToStringBuilder; + +public class CloudRequestData { + + Object cloudRequest; + String cloudIdentifier; + + public CloudRequestData() {} + + public CloudRequestData(Object cloudRequest, String cloudIdentifier) { + this.cloudRequest = cloudRequest; + this.cloudIdentifier = cloudIdentifier; + } + + public Object getCloudRequest() { + return cloudRequest; + } + + public void setCloudRequest(Object cloudRequest) { + this.cloudRequest = cloudRequest; + } + + public String getCloudIdentifier() { + return cloudIdentifier; + } + + public void setCloudIdentifier(String cloudIdentifier) { + this.cloudIdentifier = cloudIdentifier; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("cloudRequest", cloudRequest).append("cloudIdentifier", cloudIdentifier) + .toString(); + } +} diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java index 8635af5b94..fbdb27c0ec 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java @@ -20,7 +20,9 @@ package org.onap.so.serviceinstancebeans; +import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.apache.commons.lang3.builder.ToStringBuilder; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; @@ -38,6 +40,7 @@ public class Request { protected InstanceReferences instanceReferences; protected RequestStatus requestStatus; protected List requestProcessingData; + protected List cloudRequestData = new ArrayList<>(); public String getRequestId() { @@ -112,12 +115,22 @@ public class Request { this.requestProcessingData = requestProcessingData; } + + public List getCloudRequestData() { + return cloudRequestData; + } + + public void setCloudRequestData(List cloudRequestData) { + this.cloudRequestData = cloudRequestData; + } + @Override public String toString() { return new ToStringBuilder(this).append("requestId", requestId).append("startTime", startTime) .append("finishTime", finishTime).append("requestScope", requestScope) .append("requestType", requestType).append("requestDetails", requestDetails) .append("instanceReferences", instanceReferences).append("requestStatus", requestStatus) - .append("requestProcessingData", requestProcessingData).toString(); + .append("requestProcessingData", requestProcessingData).append("cloudRequestData", cloudRequestData) + .toString(); } } -- cgit 1.2.3-korg