From 949db5ca3ba536951d5a0777d8fe64b920eb279d Mon Sep 17 00:00:00 2001 From: c00149107 Date: Mon, 23 Oct 2017 14:52:52 +0800 Subject: Fix Issues about voLTE Create Fix Issues about voLTE Create Change-Id: I811dc05c8f9a7caecddb279e025772d5d02c2548 Issue-ID:SO-254 Signed-off-by: c00149107 --- .../mso/apihandlerinfra/E2EServiceInstances.java | 32 +++--- .../e2eserviceinstancebeans/E2EParameters.java | 98 +++++++++--------- .../E2ERequestParameters.java | 65 ------------ .../LocationConstraint.java | 72 ++++++++++++++ .../e2eserviceinstancebeans/NsParameters.java | 68 +++++++++++++ .../e2eserviceinstancebeans/ResourceRequest.java | 110 +++++++++++++++++++++ .../e2eserviceinstancebeans/VimLocation.java | 50 ++++++++++ 7 files changed, 369 insertions(+), 126 deletions(-) delete mode 100644 mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2ERequestParameters.java create mode 100644 mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/LocationConstraint.java create mode 100644 mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java create mode 100644 mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/ResourceRequest.java create mode 100644 mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/VimLocation.java (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java index f33774faef..921cbd0142 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java @@ -251,7 +251,7 @@ public class E2EServiceInstances { try { msoRequest.createRequestRecord(Status.PENDING, action); - createOperationStatusRecord(action, requestId); + //createOperationStatusRecord(action, requestId); } catch (Exception e) { msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "", MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e); @@ -265,12 +265,9 @@ public class E2EServiceInstances { return response; } - String modelInfo = e2eSir.getService().getParameters().getNodeTemplateName(); - String[] arrayOfInfo = modelInfo.split(":"); - String serviceInstanceType = arrayOfInfo[0]; + String serviceInstanceType = e2eSir.getService().getParameters().getServiceType(); String serviceId = ""; - RequestClient requestClient = null; HttpResponse response = null; @@ -468,11 +465,12 @@ public class E2EServiceInstances { // modelNameVersionId modelInfo.setModelNameVersionId(e2eSir.getService().getTemplateId()); - String modelInfoValue = e2eSir.getService().getParameters().getNodeTemplateName(); - String[] arrayOfInfo = modelInfoValue.split(":"); - String modelName = arrayOfInfo[0]; - String modelVersion = arrayOfInfo[1]; - +// String modelInfoValue = e2eSir.getService().getParameters().getNodeTemplateName(); +// String[] arrayOfInfo = modelInfoValue.split(":"); +// String modelName = arrayOfInfo[0]; +// String modelVersion = arrayOfInfo[1]; + String modelName = "voLTE"; + String modelVersion = "1.0"; // modelName modelInfo.setModelName(modelName); @@ -517,19 +515,19 @@ public class E2EServiceInstances { // Userparams List userParams; - userParams = e2eSir.getService().getParameters().getRequestParameters().getUserParams(); + //userParams = e2eSir.getService().getParameters().getRequestParameters().getUserParams(); List> userParamList = new ArrayList<>(); Map userParamMap = new HashMap<>(); //complete json request updated in the camunda userParamMap.put("UUIRequest", requestJSON); userParamMap.put("ServiceInstanceName", e2eSir.getService().getName()); - Map userParamMap3 = null; - for (E2EUserParam userp : userParams) { - userParamMap.put(userp.getName(), userp.getValue()); - userParamList.add(userParamMap); - } - +// Map userParamMap3 = null; +// for (E2EUserParam userp : userParams) { +// userParamMap.put(userp.getName(), userp.getValue()); +// +// } + userParamList.add(userParamMap); requestParameters.setUserParams(userParamList); // setting requestParameters to requestDetails diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EParameters.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EParameters.java index 0e2067e448..bcad1f33cc 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EParameters.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EParameters.java @@ -21,6 +21,7 @@ package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.codehaus.jackson.annotate.JsonIgnore; @@ -30,52 +31,55 @@ import org.codehaus.jackson.annotate.JsonProperty; @JsonIgnoreProperties({ "additionalProperties" }) public class E2EParameters { - @JsonProperty("domainHost") - private String domainHost; - - @JsonProperty("nodeTemplateName") - private String nodeTemplateName; - - @JsonProperty("nodeType") - private String nodeType; - @JsonProperty("globalSubscriberId") private String globalSubscriberId; @JsonProperty("subscriberName") private String subscriberName; + + @JsonProperty("serviceType") + private String serviceType; + + @JsonProperty("templateName") + private String templateName; + - @JsonProperty("requestParameters") - private E2ERequestParameters requestParameters; + @JsonProperty("resources") + private List resources; @JsonIgnore private Map additionalProperties = new HashMap<>(); - public String getDomainHost() { - return domainHost; - } - - public void setDomainHost(String domainHost) { - this.domainHost = domainHost; - } - - public String getNodeTemplateName() { - return nodeTemplateName; - } - - public void setNodeTemplateName(String nodeTemplateName) { - this.nodeTemplateName = nodeTemplateName; - } - - public String getNodeType() { - return nodeType; - } - - public void setNodeType(String nodeType) { - this.nodeType = nodeType; - } - - public String getGlobalSubscriberId() { + + /** + * @return Returns the serviceType. + */ + public String getServiceType() { + return serviceType; + } + + /** + * @param serviceType The serviceType to set. + */ + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + /** + * @return Returns the templateName. + */ + public String getTemplateName() { + return templateName; + } + + /** + * @param templateName The templateName to set. + */ + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getGlobalSubscriberId() { return globalSubscriberId; } @@ -91,14 +95,6 @@ public class E2EParameters { this.subscriberName = subscriberName; } - public E2ERequestParameters getRequestParameters() { - return requestParameters; - } - - public void setRequestParameters(E2ERequestParameters requestParameters) { - this.requestParameters = requestParameters; - } - public Map getAdditionalProperties() { return additionalProperties; } @@ -106,5 +102,19 @@ public class E2EParameters { public void setAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; } + + /** + * @return Returns the resources. + */ + public List getResources() { + return resources; + } + + /** + * @param resources The resources to set. + */ + public void setResources(List resources) { + this.resources = resources; + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2ERequestParameters.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2ERequestParameters.java deleted file mode 100644 index ae8fe808f2..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2ERequestParameters.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.mso.apihandlerinfra.e2eserviceinstancebeans; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.codehaus.jackson.annotate.JsonIgnore; -import org.codehaus.jackson.annotate.JsonProperty; - -public class E2ERequestParameters { - - @JsonProperty("subscriptionServiceType") - private String subscriptionServiceType; - - @JsonProperty("userParams") - private List userParams = null; - - @JsonIgnore - private Map additionalProperties = new HashMap<>(); - - public String getSubscriptionServiceType() { - return subscriptionServiceType; - } - - public void setSubscriptionServiceType(String subscriptionServiceType) { - this.subscriptionServiceType = subscriptionServiceType; - } - - public List getUserParams() { - return userParams; - } - - public void setUserParams(List userParams) { - this.userParams = userParams; - } - - public Map getAdditionalProperties() { - return additionalProperties; - } - - public void setAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - } - -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/LocationConstraint.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/LocationConstraint.java new file mode 100644 index 0000000000..c4c0c534ac --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/LocationConstraint.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.mso.apihandlerinfra.e2eserviceinstancebeans; + +/** + *
+ *

+ *

+ * + * @author + * @version ONAP Amsterdam Release 2017-9-6 + */ +public class LocationConstraint { + + /** + * vnf profile id + */ + private String vnfProfileId; + + /** + * location constraints: vimId + */ + private VimLocation locationConstraints; + + /** + * @return Returns the vnfProfileId. + */ + public String getVnfProfileId() { + return vnfProfileId; + } + + /** + * @param vnfProfileId The vnfProfileId to set. + */ + public void setVnfProfileId(String vnfProfileId) { + this.vnfProfileId = vnfProfileId; + } + + + /** + * @return Returns the locationConstraints. + */ + public VimLocation getLocationConstraints() { + return locationConstraints; + } + + + /** + * @param locationConstraints The locationConstraints to set. + */ + public void setLocationConstraints(VimLocation locationConstraints) { + this.locationConstraints = locationConstraints; + } + +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java new file mode 100644 index 0000000000..6121e47f83 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java @@ -0,0 +1,68 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.mso.apihandlerinfra.e2eserviceinstancebeans; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + *
+ *

+ *

+ * + * @author + * @version ONAP Amsterdam Release 2017-9-6 + */ +public class NsParameters { + + private List locationConstraints; + + private Map additionalParamForNs = new HashMap(); + /** + * @return Returns the locationConstraints. + */ + public List getLocationConstraints() { + return locationConstraints; + } + + /** + * @param locationConstraints The locationConstraints to set. + */ + public void setLocationConstraints(List locationConstraints) { + this.locationConstraints = locationConstraints; + } + + + /** + * @return Returns the additionalParamForNs. + */ + public Map getAdditionalParamForNs() { + return additionalParamForNs; + } + + + /** + * @param additionalParamForNs The additionalParamForNs to set. + */ + public void setAdditionalParamForNs(Map additionalParamForNs) { + this.additionalParamForNs = additionalParamForNs; + } +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/ResourceRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/ResourceRequest.java new file mode 100644 index 0000000000..5db3c3f73d --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/ResourceRequest.java @@ -0,0 +1,110 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.mso.apihandlerinfra.e2eserviceinstancebeans; + +import java.util.HashMap; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonIgnore; +import org.codehaus.jackson.annotate.JsonProperty; + +public class ResourceRequest { + + @JsonProperty("resourceName") + private String resourceName; + + @JsonProperty("resourceDefId") + private String resourceDefId; + + @JsonProperty("resourceId") + private String resourceId; + + @JsonProperty("nsParameters") + private NsParameters nsParameters = null; + + @JsonIgnore + private Map additionalProperties = new HashMap<>(); + + /** + * @return Returns the resourceName. + */ + public String getResourceName() { + return resourceName; + } + + /** + * @param resourceName The resourceName to set. + */ + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + /** + * @return Returns the resourceDefId. + */ + public String getResourceDefId() { + return resourceDefId; + } + + /** + * @param resourceDefId The resourceDefId to set. + */ + public void setResourceDefId(String resourceDefId) { + this.resourceDefId = resourceDefId; + } + + /** + * @return Returns the resourceId. + */ + public String getResourceId() { + return resourceId; + } + + /** + * @param resourceId The resourceId to set. + */ + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + /** + * @return Returns the nsParameters. + */ + public NsParameters getNsParameters() { + return nsParameters; + } + + /** + * @param nsParameters The nsParameters to set. + */ + public void setNsParameters(NsParameters nsParameters) { + this.nsParameters = nsParameters; + } + + public Map getAdditionalProperties() { + return additionalProperties; + } + + public void setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/VimLocation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/VimLocation.java new file mode 100644 index 0000000000..3a72f03157 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/VimLocation.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.mso.apihandlerinfra.e2eserviceinstancebeans; + +/** + * + *
+ *

+ *

+ * + * @author + * @version ONAP Amsterdam Release 2017-10-18 + */ +public class VimLocation { + private String vimId; + + + /** + * @return Returns the vimId. + */ + public String getVimId() { + return vimId; + } + + + /** + * @param vimId The vimId to set. + */ + public void setVimId(String vimId) { + this.vimId = vimId; + } + +} -- cgit 1.2.3-korg