diff options
author | Hockla, Ali (ah999m) <ah999m@att.com> | 2017-09-05 14:01:04 -0500 |
---|---|---|
committer | Ali Hockla <ah999m@att.com> | 2017-09-08 13:11:17 +0000 |
commit | 9641684f3084e3e6a0ce8b8594258c25c1092c2d (patch) | |
tree | 4ec335b3dfffc96931d9c5f4767db52b9857e3fd /controlloop/common/model-impl | |
parent | 66e82ed4ee7bfb98758d62647ef2e771f869b280 (diff) |
Added changes for vDNS Use Case - MSO Interface
Rebased and fixed merge conflicts
Issue-ID: POLICY-102
Change-Id: Icc36a2cf6391aa9137593bc04f0d4543798b7ccd
Signed-off-by: Ali Hockla <ah999m@att.com>
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
Signed-off-by: HOCKLA <ah999m@att.com>
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
Diffstat (limited to 'controlloop/common/model-impl')
24 files changed, 964 insertions, 832 deletions
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQF199/AAINQF199Manager.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQF199/AAINQF199Manager.java index fd999fb5f..9cb0a220a 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQF199/AAINQF199Manager.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQF199/AAINQF199Manager.java @@ -38,7 +38,7 @@ public final class AAINQF199Manager { public static AAINQF199Response postQuery(String url, String username, String password, AAINQF199Request request, UUID requestID) { - Map<String, String> headers = new HashMap<String, String>(); + Map<String, String> headers = new HashMap<>(); headers.put("X-FromAppId", "POLICY"); headers.put("X-TransactionId", requestID.toString()); headers.put("Accept", "application/json"); @@ -47,8 +47,10 @@ public final class AAINQF199Manager { Pair<Integer, String> httpDetails = RESTManager.post(url, username, password, headers, "application/json", Serialization.gsonPretty.toJson(request)); + logger.debug("Performing AAI POST to " + url + "\nSending: \n" + Serialization.gsonPretty.toJson(request) + "END"); + if (httpDetails == null) { - logger.debug("AAI POST Null Response to {}", url); + logger.debug("AAI POST - Null Response from {}", url); return null; } @@ -69,7 +71,7 @@ public final class AAINQF199Manager { public static AAIGETResponse getQuery(String urlGet, String username, String password, UUID requestID, String vnfId) { - Map<String, String> headers = new HashMap<String, String>(); + Map<String, String> headers = new HashMap<>(); headers.put("X-FromAppId", "POLICY"); headers.put("X-TransactionId", requestID.toString()); headers.put("Accept", "application/json"); @@ -101,7 +103,9 @@ public final class AAINQF199Manager { } try { Thread.sleep(1000); - } catch (InterruptedException e) {} + } catch (InterruptedException e) { + logger.error(e.getMessage()); + } } diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQF199/AAINQF199Response.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQF199/AAINQF199Response.java index 68a011b98..bcecc04b9 100644 --- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQF199/AAINQF199Response.java +++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AAINQF199/AAINQF199Response.java @@ -34,9 +34,10 @@ public class AAINQF199Response implements Serializable { private static final long serialVersionUID = 8411407444051746101L; @SerializedName("inventory-response-item") - public List<AAINQF199InventoryResponseItem> inventoryResponseItems = new LinkedList<AAINQF199InventoryResponseItem>(); + public List<AAINQF199InventoryResponseItem> inventoryResponseItems = new LinkedList<>(); public AAINQF199Response() { + } - + } diff --git a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java index c8bd1a80c..f0e4627a3 100644 --- a/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java +++ b/controlloop/common/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java @@ -24,7 +24,7 @@ public enum ControlLoopTargetType { VM("VM"), VF("VF"), VFC("VFC"), - ENODEB("eNodeB") + VNF("VNF") ; private String type; @@ -47,9 +47,10 @@ public enum ControlLoopTargetType { if (VFC.toString().equals(type)) { return VFC; } - if (ENODEB.toString().equals(type)) { - return ENODEB; + if (VNF.toString().equals(type)) { + return VNF; } + return null; } } diff --git a/controlloop/common/model-impl/mso/pom.xml b/controlloop/common/model-impl/mso/pom.xml index 8e584a8ea..5d386688d 100644 --- a/controlloop/common/model-impl/mso/pom.xml +++ b/controlloop/common/model-impl/mso/pom.xml @@ -43,6 +43,12 @@ <scope>provided</scope> </dependency> <dependency> + <groupId>org.drools</groupId> + <artifactId>drools-core</artifactId> + <version>6.5.0.Final</version> + <scope>provided</scope> + </dependency> + <dependency> <groupId>org.onap.policy.drools-applications</groupId> <artifactId>rest</artifactId> <version>${project.version}</version> diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestDetails.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestDetails.java deleted file mode 100644 index 180285765..000000000 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestDetails.java +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; -import java.util.LinkedList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - -public class MSORequestDetails implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("modelInfo") - public MSOModelInfo modelInfo; - - @SerializedName("cloudConfiguration") - public MSOCloudConfiguration cloudConfiguration; - - @SerializedName("requestInfo") - public MSORequestInfo requestInfo; - - @SerializedName("subscriberInfo") - public MSOSubscriberInfo subscriberInfo; - - @SerializedName("relatedInstanceList") - public List<MSORelatedInstanceListElement> relatedInstanceList= new LinkedList<MSORelatedInstanceListElement>(); - - @SerializedName("requestParameters") - public MSORequestParameters requestParameters; - - public MSORequestDetails() { - } - -} diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOAsyncRequestStatus.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOAsyncRequestStatus.java index 7e7451a60..600816304 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOAsyncRequestStatus.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOAsyncRequestStatus.java @@ -1,63 +1,63 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; -import java.time.LocalDateTime; - -import com.google.gson.annotations.SerializedName; - -public class MSOAsyncRequestStatus implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("correlator") - public String correlator; - - @SerializedName("requestId") - public String requestId; - - @SerializedName("instanceReferences") - public MSOInstanceReferences instanceReferences; - - @SerializedName("startTime") - public LocalDateTime startTime; - - @SerializedName("finishTime") - public LocalDateTime finishTime; - - @SerializedName("requestScope") - public String requestScope; - - @SerializedName("requestType") - public String requestType; - - @SerializedName("requestStatus") - public MSORequestStatus requestStatus; - - - public MSOAsyncRequestStatus() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+import com.google.gson.annotations.SerializedName;
+
+public class SOAsyncRequestStatus implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("correlator")
+ public String correlator;
+
+ @SerializedName("requestId")
+ public String requestId;
+
+ @SerializedName("instanceReferences")
+ public SOInstanceReferences instanceReferences;
+
+ @SerializedName("startTime")
+ public LocalDateTime startTime;
+
+ @SerializedName("finishTime")
+ public LocalDateTime finishTime;
+
+ @SerializedName("requestScope")
+ public String requestScope;
+
+ @SerializedName("requestType")
+ public String requestType;
+
+ @SerializedName("requestStatus")
+ public SORequestStatus requestStatus;
+
+
+ public SOAsyncRequestStatus() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOCloudConfiguration.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOCloudConfiguration.java index 965ada24d..7e4951166 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOCloudConfiguration.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOCloudConfiguration.java @@ -1,44 +1,44 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - - -import com.google.gson.annotations.SerializedName; - -public class MSOCloudConfiguration implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("lcpCloudRegionId") - public String lcpCloudRegionId; - - @SerializedName("tenantId") - public String tenantId; - - public MSOCloudConfiguration() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class SOCloudConfiguration implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("lcpCloudRegionId")
+ public String lcpCloudRegionId;
+
+ @SerializedName("tenantId")
+ public String tenantId;
+
+ public SOCloudConfiguration() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOInstanceReferences.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOInstanceReferences.java index f751c3a43..894b17ade 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOInstanceReferences.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOInstanceReferences.java @@ -1,44 +1,44 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - - -import com.google.gson.annotations.SerializedName; - -public class MSOInstanceReferences implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("requestId") - public String requestId; - - @SerializedName("instanceId") - public String instanceId; - - public MSOInstanceReferences() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class SOInstanceReferences implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("requestId")
+ public String requestId;
+
+ @SerializedName("instanceId")
+ public String instanceId;
+
+ public SOInstanceReferences() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOManager.java index c23935586..ea9146d24 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOManager.java @@ -20,22 +20,29 @@ package org.onap.policy.mso; +import java.util.Base64; import java.util.HashMap; import java.util.Map; import org.onap.policy.mso.util.Serialization; import org.onap.policy.rest.RESTManager; import org.onap.policy.rest.RESTManager.Pair; +import org.drools.core.WorkingMemory; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; -public final class MSOManager { +public final class SOManager { - private static final Logger logger = LoggerFactory.getLogger(MSOManager.class); - - public static MSOResponse createModuleInstance(String url, String urlBase, String username, String password, MSORequest request) { + private static final Logger logger = LoggerFactory.getLogger(SOManager.class); + private static ExecutorService executors = Executors.newCachedThreadPool(); + + public static SOResponse createModuleInstance(String url, String urlBase, String username, String password, SORequest request) { // // Call REST @@ -57,7 +64,7 @@ public final class MSOManager { if (httpDetails.a == 202) { try { - MSOResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, MSOResponse.class); + SOResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, SOResponse.class); String body = Serialization.gsonPretty.toJson(response); logger.debug("***** Response to post:"); @@ -68,12 +75,12 @@ public final class MSOManager { //String getUrl = "/orchestrationRequests/v2/"+requestId; String urlGet = urlBase + "/orchestrationRequests/v2/"+requestId; - MSOResponse responseGet = null; + SOResponse responseGet = null; while(attemptsLeft-- > 0){ Pair<Integer, String> httpDetailsGet = RESTManager.get(urlGet, username, password, headers); - responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, MSOResponse.class); + responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, SOResponse.class); body = Serialization.gsonPretty.toJson(responseGet); logger.debug("***** Response to get:"); logger.debug(body); @@ -97,7 +104,7 @@ public final class MSOManager { return responseGet; } catch (JsonSyntaxException e) { - logger.error("Failed to deserialize into MSOResponse: ", e); + logger.error("Failed to deserialize into SOResponse: ", e); } catch (InterruptedException e) { logger.error("Interrupted exception: ", e); } @@ -109,4 +116,53 @@ public final class MSOManager { return null; } + /** + * + * @param wm + * @param url + * @param urlBase + * @param username + * @param password + * @param request + * + * This method makes an asynchronous Rest call to MSO and inserts the response into the Drools working memory + */ + public void asyncMSORestCall(WorkingMemory wm, String serviceInstanceId, String vnfInstanceId, SORequest request) { + executors.submit(new Runnable() + { + @Override + public void run() + { + String serverRoot = ""; // TODO + String username = ""; // TODO + String password = ""; // TODO + String url = serverRoot + "/serviceInstances/v5/" + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/vfModules"; + + String auth = username + ":" + password; + + Map<String, String> headers = new HashMap<String, String>(); + byte[] encodedBytes = Base64.getEncoder().encode(auth.getBytes()); + headers.put("Accept", "application/json"); + headers.put("Authorization", "Basic " + new String(encodedBytes)); + + Gson gsonPretty = new GsonBuilder().disableHtmlEscaping() + .setPrettyPrinting() + .create(); + + String msoJson = gsonPretty.toJson(request); + + SOResponse mso = new SOResponse(); + Pair<Integer, String> httpResponse = RESTManager.post(url, "policy", "policy", headers, "application/json", msoJson); + if (httpResponse != null) { + Gson gson = new Gson(); + mso = gson.fromJson(httpResponse.b, SOResponse.class); + mso.httpResponseCode = httpResponse.a; + } + +// logger.info("MSOResponse inserted " + mso.toString()); + wm.insert(mso); + } + }); + } + } diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOModelInfo.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOModelInfo.java index 9efea94b1..cba763daf 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOModelInfo.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOModelInfo.java @@ -25,7 +25,7 @@ import java.io.Serializable; import com.google.gson.annotations.SerializedName; -public class MSOModelInfo implements Serializable { +public class SOModelInfo implements Serializable { /** * @@ -50,7 +50,10 @@ public class MSOModelInfo implements Serializable { @SerializedName("modelCustomizationName") public String modelCustomizationName; - public MSOModelInfo() { + @SerializedName("modelCustomizationId") + public String modelCustomizationId; + + public SOModelInfo() { } } diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOPolicyException.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOPolicyException.java index 97e85132a..a2c9f81aa 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOPolicyException.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOPolicyException.java @@ -1,43 +1,43 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class MSOPolicyException implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("messageId") - public String messageId; - - @SerializedName("text") - public String text; - - public MSOPolicyException() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+import com.google.gson.annotations.SerializedName;
+
+public class SOPolicyException implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("messageId")
+ public String messageId;
+
+ @SerializedName("text")
+ public String text;
+
+ public SOPolicyException() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORelatedInstance.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORelatedInstance.java index 0eec72f70..d9d634a57 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORelatedInstance.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORelatedInstance.java @@ -1,49 +1,49 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - - - -import com.google.gson.annotations.SerializedName; - -public class MSORelatedInstance implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("instanceId") - public String instanceId; - - @SerializedName("instanceName") - public String instanceName; - - @SerializedName("modelInfo") - public MSOModelInfo modelInfo; - - - public MSORelatedInstance() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class SORelatedInstance implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("instanceId")
+ public String instanceId;
+
+ @SerializedName("instanceName")
+ public String instanceName;
+
+ @SerializedName("modelInfo")
+ public SOModelInfo modelInfo;
+
+
+ public SORelatedInstance() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORelatedInstanceListElement.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORelatedInstanceListElement.java index dfeed32f2..f32f7ccb1 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORelatedInstanceListElement.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORelatedInstanceListElement.java @@ -1,42 +1,42 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - - -import com.google.gson.annotations.SerializedName; - -public class MSORelatedInstanceListElement implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("relatedInstance") - public MSORelatedInstance relatedInstance; - - - public MSORelatedInstanceListElement() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class SORelatedInstanceListElement implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("relatedInstance")
+ public SORelatedInstance relatedInstance;
+
+
+ public SORelatedInstanceListElement() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequest.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequest.java index fa4e7892b..83a761377 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequest.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequest.java @@ -1,60 +1,60 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; -import java.time.LocalDateTime; - -import com.google.gson.annotations.SerializedName; - -public class MSORequest implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("requestId") - public String requestId; - - @SerializedName("startTime") - //public LocalDateTime startTime; - public String startTime; - - @SerializedName("finishTime") - public LocalDateTime finishTime; - - @SerializedName("requestScope") - public String requestScope; - - @SerializedName("requestType") - public String requestType; - - @SerializedName("requestDetails") - public MSORequestDetails requestDetails; - - @SerializedName("requestStatus") - public MSORequestStatus requestStatus; - - public MSORequest() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+import com.google.gson.annotations.SerializedName;
+
+public class SORequest implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("requestId")
+ public String requestId;
+
+ @SerializedName("startTime")
+ //public LocalDateTime startTime;
+ public String startTime;
+
+ @SerializedName("finishTime")
+ public LocalDateTime finishTime;
+
+ @SerializedName("requestScope")
+ public String requestScope;
+
+ @SerializedName("requestType")
+ public String requestType;
+
+ @SerializedName("requestDetails")
+ public SORequestDetails requestDetails;
+
+ @SerializedName("requestStatus")
+ public SORequestStatus requestStatus;
+
+ public SORequest() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestDetails.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestDetails.java new file mode 100644 index 000000000..4b4b8217e --- /dev/null +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestDetails.java @@ -0,0 +1,124 @@ +/*- + * ============LICENSE_START======================================================= + * mso + * ================================================================================ + * Copyright (C) 2017 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.policy.mso; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +public class SORequestDetails implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3283942659786236032L; + + @SerializedName("modelInfo") + public SOModelInfo modelInfo; + + @SerializedName("cloudConfiguration") + public SOCloudConfiguration cloudConfiguration; + + @SerializedName("requestInfo") + public SORequestInfo requestInfo; + + @SerializedName("subscriberInfo") + public SOSubscriberInfo subscriberInfo; + + @SerializedName("relatedInstanceList") + public List<SORelatedInstanceListElement> relatedInstanceList= new LinkedList<SORelatedInstanceListElement>(); + + @SerializedName("requestParameters") + public SORequestParameters requestParameters; + + public SORequestDetails() { + + } + + public SORequestDetails(SORequestDetails soRequestDetails) { + this.modelInfo = soRequestDetails.modelInfo; + this.cloudConfiguration = soRequestDetails.cloudConfiguration; + this.requestInfo = soRequestDetails.requestInfo; + this.relatedInstanceList = soRequestDetails.relatedInstanceList; + this.requestParameters = soRequestDetails.requestParameters; + } + + @Override + public String toString() { + return "SORequestDetails [modelInfo=" + modelInfo + + ", cloudConfiguration=" + cloudConfiguration + + ", requestInfo=" + requestInfo + ", relatedInstanceList=" + + relatedInstanceList + ", requestParameters=" + + requestParameters + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((cloudConfiguration == null) ? 0 : cloudConfiguration.hashCode()); + result = prime * result + ((modelInfo == null) ? 0 : modelInfo.hashCode()); + result = prime * result + ((relatedInstanceList == null) ? 0 : relatedInstanceList.hashCode()); + result = prime * result + ((requestInfo == null) ? 0 : requestInfo.hashCode()); + result = prime * result + ((requestParameters == null) ? 0 : requestParameters.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + SORequestDetails other = (SORequestDetails) obj; + if (cloudConfiguration == null) { + if (other.cloudConfiguration != null) + return false; + } else if (!cloudConfiguration.equals(other.cloudConfiguration)) + return false; + if (modelInfo == null) { + if (other.modelInfo != null) + return false; + } else if (!modelInfo.equals(other.modelInfo)) + return false; + if (relatedInstanceList == null) { + if (other.relatedInstanceList != null) + return false; + } else if (!relatedInstanceList.equals(other.relatedInstanceList)) + return false; + if (requestInfo == null) { + if (other.requestInfo != null) + return false; + } else if (!requestInfo.equals(other.requestInfo)) + return false; + if (requestParameters == null) { + if (other.requestParameters != null) + return false; + } else if (!requestParameters.equals(other.requestParameters)) + return false; + return true; + } + +} diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestError.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestError.java index 849103e6d..76b62bfa0 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestError.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestError.java @@ -1,59 +1,59 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class MSORequestError implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - - @SerializedName("policyException") - public MSOPolicyException policyException; - - - @SerializedName("serviceException") - public MSOServiceException serviceException; - - /* - @SerializedName("messageId") - public String messageId; - - @SerializedName("text") - public String text; - - @SerializedName("url") - public String url; - - @SerializedName("variables") - public String variables; - */ - - public MSORequestError() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+import com.google.gson.annotations.SerializedName;
+
+public class SORequestError implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+
+ @SerializedName("policyException")
+ public SOPolicyException policyException;
+
+
+ @SerializedName("serviceException")
+ public SOServiceException serviceException;
+
+ /*
+ @SerializedName("messageId")
+ public String messageId;
+
+ @SerializedName("text")
+ public String text;
+
+ @SerializedName("url")
+ public String url;
+
+ @SerializedName("variables")
+ public String variables;
+ */
+
+ public SORequestError() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestInfo.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestInfo.java index 5c771b6e3..9e5b93ccb 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestInfo.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestInfo.java @@ -1,66 +1,66 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - - -import com.google.gson.annotations.SerializedName; - -public class MSORequestInfo implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("instanceName") - public String instanceName; - - @SerializedName("source") - public String source; - - @SerializedName("productFamilyId") - public String productFamilyId; - - @SerializedName("suppressRollback") - public boolean suppressRollback; - - @SerializedName("billingAccountNumber") - public String billingAccountNumber; - - @SerializedName("callbackUrl") - public String callbackUrl; - - @SerializedName("correlator") - public String correlator; - - @SerializedName("orderNumber") - public String orderNumber; - - @SerializedName("orderVersion") - public Integer orderVersion; - - - public MSORequestInfo() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class SORequestInfo implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("instanceName")
+ public String instanceName;
+
+ @SerializedName("source")
+ public String source;
+
+ @SerializedName("productFamilyId")
+ public String productFamilyId;
+
+ @SerializedName("suppressRollback")
+ public boolean suppressRollback;
+
+ @SerializedName("billingAccountNumber")
+ public String billingAccountNumber;
+
+ @SerializedName("callbackUrl")
+ public String callbackUrl;
+
+ @SerializedName("correlator")
+ public String correlator;
+
+ @SerializedName("orderNumber")
+ public String orderNumber;
+
+ @SerializedName("orderVersion")
+ public Integer orderVersion;
+
+
+ public SORequestInfo() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestParameters.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestParameters.java index 043a8e848..6e45afe83 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestParameters.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestParameters.java @@ -1,47 +1,47 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - - -import com.google.gson.annotations.SerializedName; - -public class MSORequestParameters implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("subscriptionServiceType") - public String subscriptionServiceType; - - @SerializedName("userParams") - public List<Map<String, String>> userParams = new LinkedList<Map<String, String>>(); - - public MSORequestParameters() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class SORequestParameters implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("subscriptionServiceType")
+ public String subscriptionServiceType;
+
+ @SerializedName("userParams")
+ public List<Map<String, String>> userParams = new LinkedList<Map<String, String>>();
+
+ public SORequestParameters() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestReferences.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestReferences.java index c641db4bb..ea8ebc64a 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestReferences.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestReferences.java @@ -1,38 +1,38 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - - -import com.google.gson.annotations.SerializedName; - -public class MSORequestReferences implements Serializable { - - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("instanceId") - public String instanceId; - - @SerializedName("requestId") - public String requestId; - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class SORequestReferences implements Serializable {
+
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("instanceId")
+ public String instanceId;
+
+ @SerializedName("requestId")
+ public String requestId;
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestStatus.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestStatus.java index 598e9cbdc..d5174328e 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSORequestStatus.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SORequestStatus.java @@ -1,51 +1,51 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - -import com.google.gson.annotations.SerializedName; - -public class MSORequestStatus implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("percentProgress") - public int percentProgress; - - @SerializedName("requestState") - public String requestState; - - @SerializedName("timestamp") - //public LocalDateTime timestamp; - public String timestamp; - - @SerializedName("wasRolledBack") - public boolean wasRolledBack; - - - public MSORequestStatus() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+import com.google.gson.annotations.SerializedName;
+
+public class SORequestStatus implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("percentProgress")
+ public int percentProgress;
+
+ @SerializedName("requestState")
+ public String requestState;
+
+ @SerializedName("timestamp")
+ //public LocalDateTime timestamp;
+ public String timestamp;
+
+ @SerializedName("wasRolledBack")
+ public boolean wasRolledBack;
+
+
+ public SORequestStatus() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOResponse.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOResponse.java index 2106959fb..ddf937593 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOResponse.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOResponse.java @@ -24,7 +24,7 @@ import java.io.Serializable; import com.google.gson.annotations.SerializedName; -public class MSOResponse implements Serializable { +public class SOResponse implements Serializable { /** * @@ -32,17 +32,18 @@ public class MSOResponse implements Serializable { private static final long serialVersionUID = -3283942659786236032L; @SerializedName("requestReferences") - public MSORequestReferences requestReferences; + public SORequestReferences requestReferences; @SerializedName("requestError") - public MSORequestError requestError; + public SORequestError requestError; @SerializedName("request") - public MSORequest request; - + public SORequest request; + + public int httpResponseCode; - public MSOResponse() { + public SOResponse() { } } diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOServiceException.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOServiceException.java index 3322bf8f3..4a806ced4 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOServiceException.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOServiceException.java @@ -1,48 +1,48 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; -import java.util.LinkedList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - -public class MSOServiceException implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("messageId") - public String messageId; - - @SerializedName("text") - public String text; - - @SerializedName("variables") - public List<String> variables = new LinkedList<String>(); - - public MSOServiceException() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+public class SOServiceException implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("messageId")
+ public String messageId;
+
+ @SerializedName("text")
+ public String text;
+
+ @SerializedName("variables")
+ public List<String> variables = new LinkedList<String>();
+
+ public SOServiceException() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOSubscriberInfo.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOSubscriberInfo.java index 957c4c70c..97d620f5c 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOSubscriberInfo.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/SOSubscriberInfo.java @@ -1,47 +1,47 @@ -/*- - * ============LICENSE_START======================================================= - * mso - * ================================================================================ - * Copyright (C) 2017 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.policy.mso; - -import java.io.Serializable; - - -import com.google.gson.annotations.SerializedName; - -public class MSOSubscriberInfo implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3283942659786236032L; - - @SerializedName("globalSubscriberId") - public String globalSubscriberId; - - @SerializedName("subscriberCommonSiteId") - public String subscriberCommonSiteId; - - @SerializedName("subscriberName") - public String subscriberName; - - public MSOSubscriberInfo() { - } - -} +/*-
+ * ============LICENSE_START=======================================================
+ * mso
+ * ================================================================================
+ * Copyright (C) 2017 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.policy.mso;
+
+import java.io.Serializable;
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class SOSubscriberInfo implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("globalSubscriberId")
+ public String globalSubscriberId;
+
+ @SerializedName("subscriberCommonSiteId")
+ public String subscriberCommonSiteId;
+
+ @SerializedName("subscriberName")
+ public String subscriberName;
+
+ public SOSubscriberInfo() {
+ }
+
+}
diff --git a/controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java b/controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java index 2c8253f0b..bfbbf0b57 100644 --- a/controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java +++ b/controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java @@ -24,14 +24,14 @@ import java.util.HashMap; import java.util.Map; import org.junit.Test; -import org.onap.policy.mso.MSOCloudConfiguration; -import org.onap.policy.mso.MSOModelInfo; -import org.onap.policy.mso.MSORelatedInstance; -import org.onap.policy.mso.MSORelatedInstanceListElement; -import org.onap.policy.mso.MSORequest; -import org.onap.policy.mso.MSORequestDetails; -import org.onap.policy.mso.MSORequestInfo; -import org.onap.policy.mso.MSORequestParameters; +import org.onap.policy.mso.SOCloudConfiguration; +import org.onap.policy.mso.SOModelInfo; +import org.onap.policy.mso.SORelatedInstance; +import org.onap.policy.mso.SORelatedInstanceListElement; +import org.onap.policy.mso.SORequest; +import org.onap.policy.mso.SORequestDetails; +import org.onap.policy.mso.SORequestInfo; +import org.onap.policy.mso.SORequestParameters; import org.onap.policy.mso.util.Serialization; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,12 +41,12 @@ public class TestDemo { @Test public void test() { - MSORequest request = new MSORequest(); - request.requestDetails = new MSORequestDetails(); - request.requestDetails.modelInfo = new MSOModelInfo(); - request.requestDetails.cloudConfiguration = new MSOCloudConfiguration(); - request.requestDetails.requestInfo = new MSORequestInfo(); - request.requestDetails.requestParameters = new MSORequestParameters(); + SORequest request = new SORequest(); + request.requestDetails = new SORequestDetails(); + request.requestDetails.modelInfo = new SOModelInfo(); + request.requestDetails.cloudConfiguration = new SOCloudConfiguration(); + request.requestDetails.requestInfo = new SORequestInfo(); + request.requestDetails.requestParameters = new SORequestParameters(); request.requestDetails.modelInfo.modelType = "vfModule"; request.requestDetails.modelInfo.modelInvariantId = "ff5256d2-5a33-55df-13ab-12abad84e7ff"; @@ -57,24 +57,24 @@ public class TestDemo { request.requestDetails.cloudConfiguration.lcpCloudRegionId = "mdt1"; request.requestDetails.cloudConfiguration.tenantId = "88a6ca3ee0394ade9403f075db23167e"; - request.requestDetails.requestInfo.instanceName = "MSOTEST103a-vSAMP12_base_module-0"; + request.requestDetails.requestInfo.instanceName = "SOTEST103a-vSAMP12_base_module-0"; request.requestDetails.requestInfo.source = "VID"; request.requestDetails.requestInfo.suppressRollback = true; - MSORelatedInstanceListElement relatedInstanceListElement1 = new MSORelatedInstanceListElement(); - MSORelatedInstanceListElement relatedInstanceListElement2 = new MSORelatedInstanceListElement(); - MSORelatedInstanceListElement relatedInstanceListElement3 = new MSORelatedInstanceListElement(); - relatedInstanceListElement1.relatedInstance = new MSORelatedInstance(); - relatedInstanceListElement2.relatedInstance = new MSORelatedInstance(); - relatedInstanceListElement3.relatedInstance = new MSORelatedInstance(); + SORelatedInstanceListElement relatedInstanceListElement1 = new SORelatedInstanceListElement(); + SORelatedInstanceListElement relatedInstanceListElement2 = new SORelatedInstanceListElement(); + SORelatedInstanceListElement relatedInstanceListElement3 = new SORelatedInstanceListElement(); + relatedInstanceListElement1.relatedInstance = new SORelatedInstance(); + relatedInstanceListElement2.relatedInstance = new SORelatedInstance(); + relatedInstanceListElement3.relatedInstance = new SORelatedInstance(); relatedInstanceListElement1.relatedInstance.instanceId = "17ef4658-bd1f-4ef0-9ca0-ea76e2bf122c"; - relatedInstanceListElement1.relatedInstance.instanceName = "MSOTESTVOL103a-vSAMP12_base_module-0_vol"; - relatedInstanceListElement1.relatedInstance.modelInfo = new MSOModelInfo(); + relatedInstanceListElement1.relatedInstance.instanceName = "SOTESTVOL103a-vSAMP12_base_module-0_vol"; + relatedInstanceListElement1.relatedInstance.modelInfo = new SOModelInfo(); relatedInstanceListElement1.relatedInstance.modelInfo.modelType = "volumeGroup"; relatedInstanceListElement2.relatedInstance.instanceId = "serviceInstanceId"; - relatedInstanceListElement2.relatedInstance.modelInfo = new MSOModelInfo(); + relatedInstanceListElement2.relatedInstance.modelInfo = new SOModelInfo(); relatedInstanceListElement2.relatedInstance.modelInfo.modelType = "service"; relatedInstanceListElement2.relatedInstance.modelInfo.modelInvariantId = "ff3514e3-5a33-55df-13ab-12abad84e7ff"; relatedInstanceListElement2.relatedInstance.modelInfo.modelNameVersionId = "fe6985cd-ea33-3346-ac12-ab121484a3fe"; @@ -82,7 +82,7 @@ public class TestDemo { relatedInstanceListElement2.relatedInstance.modelInfo.modelVersion = "1.0"; relatedInstanceListElement3.relatedInstance.instanceId = "vnfInstanceId"; - relatedInstanceListElement3.relatedInstance.modelInfo = new MSOModelInfo(); + relatedInstanceListElement3.relatedInstance.modelInfo = new SOModelInfo(); relatedInstanceListElement3.relatedInstance.modelInfo.modelType = "vnf"; relatedInstanceListElement3.relatedInstance.modelInfo.modelInvariantId = "ff5256d1-5a33-55df-13ab-12abad84e7ff"; relatedInstanceListElement3.relatedInstance.modelInfo.modelNameVersionId = "fe6478e4-ea33-3346-ac12-ab121484a3fe"; @@ -94,23 +94,17 @@ public class TestDemo { request.requestDetails.relatedInstanceList.add(relatedInstanceListElement2); request.requestDetails.relatedInstanceList.add(relatedInstanceListElement3); - Map<String, String> userParam1 = new HashMap<String, String>(); + Map<String, String> userParam1 = new HashMap<>(); userParam1.put("name1", "value1"); - Map<String, String> userParam2 = new HashMap<String, String>(); + Map<String, String> userParam2 = new HashMap<>(); userParam2.put("name2", "value2"); request.requestDetails.requestParameters.userParams.add(userParam1); request.requestDetails.requestParameters.userParams.add(userParam2); - String body = Serialization.gsonPretty.toJson(request); - logger.debug(body); - - //MSOResponse response = MSOManager.createModuleInstance("http://localhost:7780/", "my_username", "my_passwd", request); - - //body = Serialization.gsonPretty.toJson(response); - //logger.debug(body); - + logger.debug(Serialization.gsonPretty.toJson(request)); + } @Test @@ -118,13 +112,13 @@ public class TestDemo { logger.debug("** HACK **"); - MSORequest request = new MSORequest(); + SORequest request = new SORequest(); // - request.requestDetails = new MSORequestDetails(); - request.requestDetails.modelInfo = new MSOModelInfo(); - request.requestDetails.cloudConfiguration = new MSOCloudConfiguration(); - request.requestDetails.requestInfo = new MSORequestInfo(); - request.requestDetails.requestParameters = new MSORequestParameters(); + request.requestDetails = new SORequestDetails(); + request.requestDetails.modelInfo = new SOModelInfo(); + request.requestDetails.cloudConfiguration = new SOCloudConfiguration(); + request.requestDetails.requestInfo = new SORequestInfo(); + request.requestDetails.requestParameters = new SORequestParameters(); request.requestDetails.requestParameters.userParams = null; request.requestDetails.modelInfo.modelType = "vfModule"; @@ -140,14 +134,14 @@ public class TestDemo { request.requestDetails.requestInfo.source = "POLICY"; request.requestDetails.requestInfo.suppressRollback = false; - MSORelatedInstanceListElement relatedInstanceListElement1 = new MSORelatedInstanceListElement(); - MSORelatedInstanceListElement relatedInstanceListElement2 = new MSORelatedInstanceListElement(); - relatedInstanceListElement1.relatedInstance = new MSORelatedInstance(); - relatedInstanceListElement2.relatedInstance = new MSORelatedInstance(); + SORelatedInstanceListElement relatedInstanceListElement1 = new SORelatedInstanceListElement(); + SORelatedInstanceListElement relatedInstanceListElement2 = new SORelatedInstanceListElement(); + relatedInstanceListElement1.relatedInstance = new SORelatedInstance(); + relatedInstanceListElement2.relatedInstance = new SORelatedInstance(); String serviceInstanceId = "98af39ce-6408-466b-921f-c2c7a8f59ed6"; relatedInstanceListElement1.relatedInstance.instanceId = serviceInstanceId; - relatedInstanceListElement1.relatedInstance.modelInfo = new MSOModelInfo(); + relatedInstanceListElement1.relatedInstance.modelInfo = new SOModelInfo(); relatedInstanceListElement1.relatedInstance.modelInfo.modelType = "service"; relatedInstanceListElement1.relatedInstance.modelInfo.modelInvariantId = "24329a0c-1d57-4210-b1af-a65df64e9d59"; relatedInstanceListElement1.relatedInstance.modelInfo.modelNameVersionId = "ac642881-8e7e-4217-bd64-16ad41c42e30"; @@ -156,7 +150,7 @@ public class TestDemo { String vnfInstanceId = "8eb411b8-a936-412f-b01f-9a9a435c0e93"; relatedInstanceListElement2.relatedInstance.instanceId = vnfInstanceId; - relatedInstanceListElement2.relatedInstance.modelInfo = new MSOModelInfo(); + relatedInstanceListElement2.relatedInstance.modelInfo = new SOModelInfo(); relatedInstanceListElement2.relatedInstance.modelInfo.modelType = "vnf"; relatedInstanceListElement2.relatedInstance.modelInfo.modelInvariantId = "09fd971e-db5f-475d-997c-cf6704b6b8fe"; relatedInstanceListElement2.relatedInstance.modelInfo.modelNameVersionId = "152ed917-6dcc-46ee-bf8a-a775c5aa5a74"; @@ -167,8 +161,7 @@ public class TestDemo { request.requestDetails.relatedInstanceList.add(relatedInstanceListElement1); request.requestDetails.relatedInstanceList.add(relatedInstanceListElement2); - String body = Serialization.gsonPretty.toJson(request); - logger.debug(body); + logger.debug(Serialization.gsonPretty.toJson(request)); } } |