X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2FMSOCommonBPMN%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fbpmn%2Fcommon%2Frecipe%2FResourceInput.java;h=42547faa1e9807c9ea15f5b2da80eb1c1f43b882;hb=b6dc38501f3b746426b42d9de4cc883d894149e8;hp=b56a438364ab871308d7087b7e2f3b6fd0e6fe86;hpb=f3b28a0aafd83a57d42afbf23c9f6fbe6f546db3;p=so.git diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java index b56a438364..42547faa1e 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java @@ -1,290 +1,295 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 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.bpmn.common.recipe; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * the inputs for the resource recipe - *
- *

- *

- * - * @author - * @version ONAP Beijing Release 2018-03-08 - */ -@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId", "operationId", "resourceType","resourceCustomizationUuid"}) -@JsonRootName("variables") -public class ResourceInput { - - @JsonProperty("resourceInstanceName") - private String resourceInstanceName; - - @JsonProperty("resourceInstanceDes") - private String resourceInstanceDes; - - @JsonProperty("globalSubscriberId") - private String globalSubscriberId; - - @JsonProperty("serviceType") - private String serviceType; - - @JsonProperty("serviceInstanceId") - private String serviceInstanceId; - - @JsonProperty("operationId") - private String operationId; - - @JsonProperty("resourceType") - private String resourceType; - - //for create resource - @JsonProperty("resourceCustomizationUuid") - private String resourceCustomizationUuid; - - //for delete resource - @JsonProperty("resourceInstancenUuid") - private String resourceInstancenUuid; - - @JsonProperty("resourceParameters") - private String resourceParameters; - - @JsonProperty("operationType") - private String operationType; - - - /** - * @return Returns the resourceInstanceName. - */ - @JsonProperty("resourceInstanceName") - public String getResourceInstanceName() { - return resourceInstanceName; - } - - - /** - * @param resourceInstanceName The resourceInstanceName to set. - */ - @JsonProperty("resourceInstanceName") - public void setResourceInstanceName(String resourceInstanceName) { - this.resourceInstanceName = resourceInstanceName; - } - - - /** - * @return Returns the resourceInstanceDes. - */ - @JsonProperty("resourceInstanceDes") - public String getResourceInstanceDes() { - return resourceInstanceDes; - } - - - /** - * @param resourceInstanceDes The resourceInstanceDes to set. - */ - @JsonProperty("resourceInstanceDes") - public void setResourceInstanceDes(String resourceInstanceDes) { - this.resourceInstanceDes = resourceInstanceDes; - } - - - /** - * @return Returns the globalSubscriberId. - */ - @JsonProperty("globalSubscriberId") - public String getGlobalSubscriberId() { - return globalSubscriberId; - } - - - /** - * @param globalSubscriberId The globalSubscriberId to set. - */ - @JsonProperty("globalSubscriberId") - public void setGlobalSubscriberId(String globalSubscriberId) { - this.globalSubscriberId = globalSubscriberId; - } - - - /** - * @return Returns the serviceType. - */ - @JsonProperty("serviceType") - public String getServiceType() { - return serviceType; - } - - - /** - * @param serviceType The serviceType to set. - */ - @JsonProperty("serviceType") - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - - /** - * @return Returns the serviceId. - */ - @JsonProperty("serviceInstanceId") - public String getServiceInstanceId() { - return serviceInstanceId; - } - - - /** - * @param serviceId The serviceId to set. - */ - @JsonProperty("serviceInstanceId") - public void setServiceInstanceId(String serviceId) { - this.serviceInstanceId = serviceId; - } - - - /** - * @return Returns the operationId. - */ - @JsonProperty("operationId") - public String getOperationId() { - return operationId; - } - - - /** - * @param operationId The operationId to set. - */ - @JsonProperty("operationId") - public void setOperationId(String operationId) { - this.operationId = operationId; - } - - - /** - * @return Returns the resourceType. - */ - @JsonProperty("resourceType") - public String getResourceType() { - return resourceType; - } - - - /** - * @param resourceType The resourceType to set. - */ - @JsonProperty("resourceType") - public void setResourceType(String resourceType) { - this.resourceType = resourceType; - } - - - /** - * @return Returns the resourceCustomizationUuid. - */ - @JsonProperty("resourceCustomizationUuid") - public String getResourceCustomizationUuid() { - return resourceCustomizationUuid; - } - - - /** - * @param resourceCustomizationUuid The resourceCustomizationUuid to set. - */ - @JsonProperty("resourceCustomizationUuid") - public void setResourceCustomizationUuid(String resourceCustomizationUuid) { - this.resourceCustomizationUuid = resourceCustomizationUuid; - } - - - /** - * @return Returns the resourceParameters. - */ - @JsonProperty("resourceParameters") - public String getResourceParameters() { - return resourceParameters; - } - - - /** - * @param resourceParameters The resourceParameters to set. - */ - @JsonProperty("resourceParameters") - public void setResourceParameters(String resourceParameters) { - this.resourceParameters = resourceParameters; - } - - - /** - * @return Returns the operationType. - */ - @JsonProperty("operationType") - public String getOperationType() { - return operationType; - } - - - /** - * @param operationType The operationType to set. - */ - @JsonProperty("operationType") - public void setOperationType(String operationType) { - this.operationType = operationType; - } - - - - /** - * @return Returns the resourceInstancenUuid. - */ - @JsonProperty("resourceInstancenUuid") - public String getResourceInstancenUuid() { - return resourceInstancenUuid; - } - - - - /** - * @param resourceInstancenUuid The resourceInstancenUuid to set. - */ - @JsonProperty("resourceInstancenUuid") - public void setResourceInstancenUuid(String resourceInstancenUuid) { - this.resourceInstancenUuid = resourceInstancenUuid; - } - - @Override - public String toString() { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); - String jsonStr = ""; - try { - jsonStr = mapper.writeValueAsString(this); - } catch(JsonProcessingException e) { - - e.printStackTrace(); - } - return jsonStr; - } -} +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 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.bpmn.common.recipe; + +import org.openecomp.mso.bpmn.core.domain.ModelInfo; +import org.openecomp.mso.logger.MsoLogger; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * the inputs for the resource recipe + *
+ *

+ *

+ * + * @author + * @version ONAP Beijing Release 2018-03-08 + */ +@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId", "operationId", "serviceModelInfo","resourceModelInfo", "resourceInstancenUuid","resourceParameters","operationType"}) +@JsonRootName("variables") +public class ResourceInput { + + private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); + + @JsonProperty("resourceInstanceName") + private String resourceInstanceName; + + @JsonProperty("resourceInstanceDes") + private String resourceInstanceDes; + + @JsonProperty("globalSubscriberId") + private String globalSubscriberId; + + @JsonProperty("serviceType") + private String serviceType; + + @JsonProperty("serviceInstanceId") + private String serviceInstanceId; + + @JsonProperty("operationId") + private String operationId; + + @JsonProperty("serviceModelInfo") + private ModelInfo serviceModelInfo; + + @JsonProperty("resourceModelInfo") + private ModelInfo resourceModelInfo; + + //for delete resource + @JsonProperty("resourceInstancenUuid") + private String resourceInstancenUuid; + + @JsonProperty("resourceParameters") + private String resourceParameters; + + @JsonProperty("operationType") + private String operationType; + + + /** + * @return Returns the resourceInstanceName. + */ + @JsonProperty("resourceInstanceName") + public String getResourceInstanceName() { + return resourceInstanceName; + } + + + /** + * @param resourceInstanceName The resourceInstanceName to set. + */ + @JsonProperty("resourceInstanceName") + public void setResourceInstanceName(String resourceInstanceName) { + this.resourceInstanceName = resourceInstanceName; + } + + + /** + * @return Returns the resourceInstanceDes. + */ + @JsonProperty("resourceInstanceDes") + public String getResourceInstanceDes() { + return resourceInstanceDes; + } + + + /** + * @param resourceInstanceDes The resourceInstanceDes to set. + */ + @JsonProperty("resourceInstanceDes") + public void setResourceInstanceDes(String resourceInstanceDes) { + this.resourceInstanceDes = resourceInstanceDes; + } + + + /** + * @return Returns the globalSubscriberId. + */ + @JsonProperty("globalSubscriberId") + public String getGlobalSubscriberId() { + return globalSubscriberId; + } + + + /** + * @param globalSubscriberId The globalSubscriberId to set. + */ + @JsonProperty("globalSubscriberId") + public void setGlobalSubscriberId(String globalSubscriberId) { + this.globalSubscriberId = globalSubscriberId; + } + + + /** + * @return Returns the serviceType. + */ + @JsonProperty("serviceType") + public String getServiceType() { + return serviceType; + } + + + /** + * @param serviceType The serviceType to set. + */ + @JsonProperty("serviceType") + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + + /** + * @return Returns the serviceId. + */ + @JsonProperty("serviceInstanceId") + public String getServiceInstanceId() { + return serviceInstanceId; + } + + + /** + * @param serviceId The serviceId to set. + */ + @JsonProperty("serviceInstanceId") + public void setServiceInstanceId(String serviceId) { + this.serviceInstanceId = serviceId; + } + + + /** + * @return Returns the operationId. + */ + @JsonProperty("operationId") + public String getOperationId() { + return operationId; + } + + + /** + * @param operationId The operationId to set. + */ + @JsonProperty("operationId") + public void setOperationId(String operationId) { + this.operationId = operationId; + } + + /** + * @return Returns the serviceModelInfo. + */ + @JsonProperty("serviceModelInfo") + public ModelInfo getServiceModelInfo() { + return serviceModelInfo; + } + + + + /** + * @param serviceModelInfo The serviceModelInfo to set. + */ + @JsonProperty("serviceModelInfo") + public void setServiceModelInfo(ModelInfo serviceModelInfo) { + this.serviceModelInfo = serviceModelInfo; + } + + + + /** + * @return Returns the resourceModelInfo. + */ + @JsonProperty("resourceModelInfo") + public ModelInfo getResourceModelInfo() { + return resourceModelInfo; + } + + + + /** + * @param resourceModelInfo The resourceModelInfo to set. + */ + @JsonProperty("resourceModelInfo") + public void setResourceModelInfo(ModelInfo resourceModelInfo) { + this.resourceModelInfo = resourceModelInfo; + } + + + /** + * @return Returns the resourceParameters. + */ + @JsonProperty("resourceParameters") + public String getResourceParameters() { + return resourceParameters; + } + + + /** + * @param resourceParameters The resourceParameters to set. + */ + @JsonProperty("resourceParameters") + public void setResourceParameters(String resourceParameters) { + this.resourceParameters = resourceParameters; + } + + + /** + * @return Returns the operationType. + */ + @JsonProperty("operationType") + public String getOperationType() { + return operationType; + } + + + /** + * @param operationType The operationType to set. + */ + @JsonProperty("operationType") + public void setOperationType(String operationType) { + this.operationType = operationType; + } + + + + /** + * @return Returns the resourceInstancenUuid. + */ + @JsonProperty("resourceInstancenUuid") + public String getResourceInstancenUuid() { + return resourceInstancenUuid; + } + + + + /** + * @param resourceInstancenUuid The resourceInstancenUuid to set. + */ + @JsonProperty("resourceInstancenUuid") + public void setResourceInstancenUuid(String resourceInstancenUuid) { + this.resourceInstancenUuid = resourceInstancenUuid; + } + + @Override + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); + String jsonStr = ""; + try { + jsonStr = mapper.writeValueAsString(this); + } catch(JsonProcessingException e) { + msoLogger.error("JsonProcessingException", e); + } + return jsonStr; + } +}