summaryrefslogtreecommitdiffstats
path: root/mso/src/main/java/org/openecomp
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2017-02-14 19:49:32 -0500
committerPamela Dragosh <pdragosh@research.att.com>2017-02-14 19:52:21 -0500
commita6557b0429dbe94a3806be237d9ba5aa7c4b183c (patch)
treee84136dc5aeb5b1c4ec1065e99c45a5084f295c6 /mso/src/main/java/org/openecomp
parenta91087731b18dab019621d99827cf1f4bcb95d10 (diff)
Initial OpenECOMP policy/drools-applications commt
Change-Id: I21c0edbf9b7f18dccd6bd4fe2a3287f3a68e6de0 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'mso/src/main/java/org/openecomp')
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOAsyncRequestStatus.java63
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOCloudConfiguration.java44
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOInstanceReferences.java44
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOManager.java102
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOModelInfo.java56
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOPolicyException.java43
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORelatedInstance.java49
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORelatedInstanceListElement.java42
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORequest.java60
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORequestDetails.java57
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORequestError.java59
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORequestInfo.java66
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORequestParameters.java47
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORequestReferences.java38
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSORequestStatus.java51
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOResponse.java48
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOServiceException.java48
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/MSOSubscriberInfo.java47
-rw-r--r--mso/src/main/java/org/openecomp/policy/mso/util/Serialization.java32
19 files changed, 996 insertions, 0 deletions
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOAsyncRequestStatus.java b/mso/src/main/java/org/openecomp/policy/mso/MSOAsyncRequestStatus.java
new file mode 100644
index 000000000..d3c24b403
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOAsyncRequestStatus.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOCloudConfiguration.java b/mso/src/main/java/org/openecomp/policy/mso/MSOCloudConfiguration.java
new file mode 100644
index 000000000..847619eaa
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOCloudConfiguration.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOInstanceReferences.java b/mso/src/main/java/org/openecomp/policy/mso/MSOInstanceReferences.java
new file mode 100644
index 000000000..3c3c4961d
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOInstanceReferences.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOManager.java b/mso/src/main/java/org/openecomp/policy/mso/MSOManager.java
new file mode 100644
index 000000000..75369e6e4
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOManager.java
@@ -0,0 +1,102 @@
+/*-
+ * ============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.openecomp.policy.mso;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.openecomp.policy.mso.util.Serialization;
+import org.openecomp.policy.rest.RESTManager;
+import org.openecomp.policy.rest.RESTManager.Pair;
+
+import com.google.gson.JsonSyntaxException;
+
+public final class MSOManager {
+
+ public static MSOResponse createModuleInstance(String url, String urlBase, String username, String password, MSORequest request) {
+
+ //
+ // Call REST
+ //
+ Map<String, String> headers = new HashMap<String, String>();
+ //headers.put("X-FromAppId", "POLICY");
+ //headers.put("X-TransactionId", requestID.toString());
+ headers.put("Accept", "application/json");
+
+ //
+ // 201 - CREATED - you are done just return
+ //
+
+ Pair<Integer, String> httpDetails = RESTManager.post(url, username, password, headers, "application/json", Serialization.gsonPretty.toJson(request));
+
+ if (httpDetails == null) {
+ return null;
+ }
+
+ if (httpDetails.a == 202) {
+ try {
+ MSOResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, MSOResponse.class);
+
+ String body = Serialization.gsonPretty.toJson(response);
+ System.out.println("***** Response to post:");
+ System.out.println(body);
+
+ String requestId = response.requestReferences.requestId;
+ int attemptsLeft = 7;
+
+ //String getUrl = "/orchestrationRequests/v2/"+requestId;
+ String urlGet = urlBase + "/orchestrationRequests/v2/"+requestId;
+ MSOResponse responseGet = null;
+
+ while(attemptsLeft-- > 0){
+
+ Pair<Integer, String> httpDetailsGet = RESTManager.get(urlGet, username, password, headers);
+ responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, MSOResponse.class);
+ body = Serialization.gsonPretty.toJson(responseGet);
+ System.out.println("***** Response to get:");
+ System.out.println(body);
+
+ if(httpDetailsGet.a == 200){
+ if(responseGet.request.requestStatus.requestState.equalsIgnoreCase("COMPLETE") ||
+ responseGet.request.requestStatus.requestState.equalsIgnoreCase("FAILED")){
+ System.out.println("***** ######## VF Module Creation "+responseGet.request.requestStatus.requestState);
+ return responseGet;
+ }
+ }
+ Thread.sleep(20000);
+ }
+
+ System.out.println("***** ######## VF Module Creation takes too long... can't wait longer. Status: ("+responseGet.request.requestStatus.requestState+")");
+ return responseGet;
+ } catch (JsonSyntaxException e) {
+ System.err.println("Failed to deserialize into MSOResponse" + e.getLocalizedMessage());
+ } catch (InterruptedException e) {
+ System.err.println("Interrupted exception: " + e.getLocalizedMessage());
+ }
+ }
+
+
+
+
+ return null;
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOModelInfo.java b/mso/src/main/java/org/openecomp/policy/mso/MSOModelInfo.java
new file mode 100644
index 000000000..a908056da
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOModelInfo.java
@@ -0,0 +1,56 @@
+/*-
+ * ============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.openecomp.policy.mso;
+
+import java.io.Serializable;
+
+
+import com.google.gson.annotations.SerializedName;
+
+public class MSOModelInfo implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("modelType")
+ public String modelType;
+
+ @SerializedName("modelInvariantId")
+ public String modelInvariantId;
+
+ @SerializedName("modelNameVersionId")
+ public String modelNameVersionId;
+
+ @SerializedName("modelName")
+ public String modelName;
+
+ @SerializedName("modelVersion")
+ public String modelVersion;
+
+ @SerializedName("modelCustomizationName")
+ public String modelCustomizationName;
+
+ public MSOModelInfo() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOPolicyException.java b/mso/src/main/java/org/openecomp/policy/mso/MSOPolicyException.java
new file mode 100644
index 000000000..4dc6ad8b2
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOPolicyException.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSORelatedInstance.java b/mso/src/main/java/org/openecomp/policy/mso/MSORelatedInstance.java
new file mode 100644
index 000000000..09cbba65d
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORelatedInstance.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSORelatedInstanceListElement.java b/mso/src/main/java/org/openecomp/policy/mso/MSORelatedInstanceListElement.java
new file mode 100644
index 000000000..31a9158a5
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORelatedInstanceListElement.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSORequest.java b/mso/src/main/java/org/openecomp/policy/mso/MSORequest.java
new file mode 100644
index 000000000..331fcb5b3
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORequest.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSORequestDetails.java b/mso/src/main/java/org/openecomp/policy/mso/MSORequestDetails.java
new file mode 100644
index 000000000..182675f91
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORequestDetails.java
@@ -0,0 +1,57 @@
+/*-
+ * ============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.openecomp.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/mso/src/main/java/org/openecomp/policy/mso/MSORequestError.java b/mso/src/main/java/org/openecomp/policy/mso/MSORequestError.java
new file mode 100644
index 000000000..42c4182a0
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORequestError.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSORequestInfo.java b/mso/src/main/java/org/openecomp/policy/mso/MSORequestInfo.java
new file mode 100644
index 000000000..4c033a465
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORequestInfo.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSORequestParameters.java b/mso/src/main/java/org/openecomp/policy/mso/MSORequestParameters.java
new file mode 100644
index 000000000..d40cdc9a4
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORequestParameters.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSORequestReferences.java b/mso/src/main/java/org/openecomp/policy/mso/MSORequestReferences.java
new file mode 100644
index 000000000..dea094567
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORequestReferences.java
@@ -0,0 +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.openecomp.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;
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSORequestStatus.java b/mso/src/main/java/org/openecomp/policy/mso/MSORequestStatus.java
new file mode 100644
index 000000000..df2ce898d
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSORequestStatus.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOResponse.java b/mso/src/main/java/org/openecomp/policy/mso/MSOResponse.java
new file mode 100644
index 000000000..51a8c5d42
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOResponse.java
@@ -0,0 +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.openecomp.policy.mso;
+
+import java.io.Serializable;
+
+import com.google.gson.annotations.SerializedName;
+
+public class MSOResponse implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3283942659786236032L;
+
+ @SerializedName("requestReferences")
+ public MSORequestReferences requestReferences;
+
+ @SerializedName("requestError")
+ public MSORequestError requestError;
+
+ @SerializedName("request")
+ public MSORequest request;
+
+
+
+ public MSOResponse() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOServiceException.java b/mso/src/main/java/org/openecomp/policy/mso/MSOServiceException.java
new file mode 100644
index 000000000..b03da3f2b
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOServiceException.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/MSOSubscriberInfo.java b/mso/src/main/java/org/openecomp/policy/mso/MSOSubscriberInfo.java
new file mode 100644
index 000000000..a14ffee33
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/MSOSubscriberInfo.java
@@ -0,0 +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.openecomp.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() {
+ }
+
+}
diff --git a/mso/src/main/java/org/openecomp/policy/mso/util/Serialization.java b/mso/src/main/java/org/openecomp/policy/mso/util/Serialization.java
new file mode 100644
index 000000000..fa82dde59
--- /dev/null
+++ b/mso/src/main/java/org/openecomp/policy/mso/util/Serialization.java
@@ -0,0 +1,32 @@
+/*-
+ * ============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.openecomp.policy.mso.util;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+public final class Serialization {
+
+ final static public Gson gsonPretty = new GsonBuilder().disableHtmlEscaping()
+ .setPrettyPrinting()
+ .create();
+
+}