diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2020-01-16 14:54:41 +0200 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2020-01-19 12:23:47 +0200 |
commit | 284de1d0f9e93bf661bbca4074b6531d6d5385c1 (patch) | |
tree | eebeaced5cfdac5d3a17ced8b2f3f03f40c36ae8 /vid-app-common/src/main/java | |
parent | adef7f90d338e0e93e3a3d0a6f714f0270a9b7f1 (diff) |
originalName stored and sent to frontend in a template
Issue-ID: VID-724
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Change-Id: Ie18e16fed62f9a92a4b4d5c72596c36303de1f48
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java')
8 files changed, 53 insertions, 32 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/BaseResource.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/BaseResource.java index 1079fbe92..7617d7778 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/BaseResource.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/BaseResource.java @@ -20,20 +20,22 @@ package org.onap.vid.model.serviceInstantiation; +import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; + import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.onap.vid.job.JobAdapter; import org.onap.vid.job.JobType; import org.onap.vid.model.Action; import org.onap.vid.mso.model.ModelInfo; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; - public abstract class BaseResource implements JobAdapter.AsyncJobRequest { protected String instanceId; @@ -60,6 +62,9 @@ public abstract class BaseResource implements JobAdapter.AsyncJobRequest { protected Integer position; + @JsonInclude(NON_NULL) + protected String originalName; //not used at backend, but stored for fronted + private static final Map<String, Action> actionStingToEnumMap = ImmutableMap.<String, Action>builder() .put("Delete", Action.Delete) @@ -85,7 +90,8 @@ public abstract class BaseResource implements JobAdapter.AsyncJobRequest { @JsonProperty("trackById") String trackById, @JsonProperty("isFailed") Boolean isFailed, @JsonProperty("statusMessage") String statusMessage, - @JsonProperty("position") Integer position) { + @JsonProperty("position") Integer position, + @JsonProperty("originalName") String originalName) { this.modelInfo = modelInfo; this.modelInfo.setModelType(getModelType()); this.rollbackOnFailure = rollbackOnFailure; @@ -99,6 +105,7 @@ public abstract class BaseResource implements JobAdapter.AsyncJobRequest { this.isFailed = isFailed!= null ? isFailed: false; this.statusMessage = statusMessage; this.position = position; + this.originalName = originalName; } private Action actionStringToEnum(String actionAsString) { @@ -177,6 +184,10 @@ public abstract class BaseResource implements JobAdapter.AsyncJobRequest { this.position = position; } + public String getOriginalName() { + return originalName; + } + @JsonIgnore public abstract Collection<? extends BaseResource> getChildren(); diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/InstanceGroup.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/InstanceGroup.java index f23c2e73e..642e28b36 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/InstanceGroup.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/InstanceGroup.java @@ -21,13 +21,12 @@ package org.onap.vid.model.serviceInstantiation; import com.fasterxml.jackson.annotation.JsonProperty; -import org.onap.vid.job.JobAdapter; -import org.onap.vid.job.JobType; -import org.onap.vid.mso.model.ModelInfo; - import java.util.Collection; import java.util.Collections; import java.util.Map; +import org.onap.vid.job.JobAdapter; +import org.onap.vid.job.JobType; +import org.onap.vid.mso.model.ModelInfo; public class InstanceGroup extends BaseResource implements JobAdapter.AsyncJobRequest { @@ -42,10 +41,11 @@ public class InstanceGroup extends BaseResource implements JobAdapter.AsyncJobRe @JsonProperty("trackById") String trackById, @JsonProperty("isFailed") Boolean isFailed, @JsonProperty("statusMessage") String statusMessage, - @JsonProperty("position") Integer position) { + @JsonProperty("position") Integer position, + @JsonProperty("originalName") String originalName) { super(modelInfo, instanceName, action, null, null, null, null, rollbackOnFailure, instanceId, trackById, isFailed, statusMessage, - position); + position, originalName); this.vnfGroupMembers = vnfGroupMembers; } diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/InstanceGroupMember.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/InstanceGroupMember.java index e9f34ccfb..758ee0694 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/InstanceGroupMember.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/InstanceGroupMember.java @@ -34,9 +34,10 @@ public class InstanceGroupMember extends BaseResource implements JobAdapter.Asyn @JsonProperty("trackById") String trackById, @JsonProperty("isFailed") Boolean isFailed, @JsonProperty("statusMessage") String statusMessage, - @JsonProperty("position") Integer position) { + @JsonProperty("position") Integer position, + @JsonProperty("originalName") String originalName) { super(new ModelInfo(), null, action, null, null, null, null, false, instanceId, trackById, isFailed, statusMessage, - position); + position, originalName); } @Override diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Network.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Network.java index b9a0aeb85..cec61f6b7 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Network.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Network.java @@ -21,14 +21,13 @@ package org.onap.vid.model.serviceInstantiation; import com.fasterxml.jackson.annotation.JsonProperty; -import org.onap.vid.job.JobAdapter; -import org.onap.vid.job.JobType; -import org.onap.vid.mso.model.ModelInfo; - import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; +import org.onap.vid.job.JobAdapter; +import org.onap.vid.job.JobType; +import org.onap.vid.mso.model.ModelInfo; public class Network extends BaseResource implements JobAdapter.AsyncJobRequest { @@ -53,10 +52,11 @@ public class Network extends BaseResource implements JobAdapter.AsyncJobRequest @JsonProperty("trackById") String trackById, @JsonProperty("isFailed") Boolean isFailed, @JsonProperty("statusMessage") String statusMessage, - @JsonProperty("position") Integer position) { + @JsonProperty("position") Integer position, + @JsonProperty("originalName") String originalName) { super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId, trackById, isFailed, statusMessage, - position); + position, originalName); this.productFamilyId = productFamilyId; this.platformName = platformName; this.lineOfBusiness = lineOfBusiness; diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiation.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiation.java index e7e5783c4..7c04a91dc 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiation.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiation.java @@ -104,9 +104,10 @@ public class ServiceInstantiation extends BaseResource implements JobAdapter.Asy @JsonProperty("trackById") String trackById, @JsonProperty("isFailed") Boolean isFailed, @JsonProperty("statusMessage") String statusMessage, - @JsonProperty("vidNotions") VidNotions vidNotions) { + @JsonProperty("vidNotions") VidNotions vidNotions, + @JsonProperty("originalName") String originalName) { super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId, trackById, isFailed, statusMessage, - null); + null, originalName); this.owningEntityId = owningEntityId; this.owningEntityName = owningEntityName; this.projectName = projectName; diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiationTemplate.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiationTemplate.java index 4872ce2c8..9499beb50 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiationTemplate.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiationTemplate.java @@ -52,7 +52,8 @@ public class ServiceInstantiationTemplate extends ServiceInstantiation implement baseService.isRollbackOnFailure(), baseService.isALaCarte(), baseService.getTestApi(), baseService.getInstanceId(), Objects.toString(baseService.getAction(), null), baseService.getTrackById(), baseService.getIsFailed(), baseService.getStatusMessage(), - baseService.getVidNotions() + baseService.getVidNotions(), + baseService.getOriginalName() ); this.existingVNFCounterMap = vnfCounterMap; diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java index d04e679e6..0b9a2a7b7 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java @@ -68,9 +68,10 @@ public class VfModule extends BaseResource implements JobAdapter.AsyncJobRequest @JsonProperty("statusMessage") String statusMessage, @Nullable @JsonProperty("retainAssignments") Boolean retainAssignments, @Nullable @JsonProperty("retainVolumeGroups") Boolean retainVolumeGroups, - @JsonProperty("position") Integer position) { + @JsonProperty("position") Integer position, + @JsonProperty("originalName") String originalName) { super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId, trackById, isFailed, statusMessage, - position); + position, originalName); this.volumeGroupInstanceName = volumeGroupInstanceName; this.usePreload = usePreload; this.supplementaryParams = supplementaryParams; @@ -135,6 +136,8 @@ public class VfModule extends BaseResource implements JobAdapter.AsyncJobRequest this.getStatusMessage(), this.isRetainAssignments(), this.isRetainVolumeGroups(), - this.getPosition()); + this.getPosition(), + this.getOriginalName() + ); } }
\ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Vnf.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Vnf.java index fc71f279f..2ed219637 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Vnf.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Vnf.java @@ -21,15 +21,18 @@ package org.onap.vid.model.serviceInstantiation; +import static java.util.stream.Collectors.toList; + import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; import org.onap.vid.job.JobAdapter; import org.onap.vid.job.JobType; import org.onap.vid.mso.model.ModelInfo; -import java.util.*; - -import static java.util.stream.Collectors.toList; - /** * The Class VNF. */ @@ -59,10 +62,11 @@ public class Vnf extends BaseResource implements JobAdapter.AsyncJobRequest { @JsonProperty("trackById") String trackById, @JsonProperty("isFailed") Boolean isFailed, @JsonProperty("statusMessage") String statusMessage, - @JsonProperty("position") Integer position) { + @JsonProperty("position") Integer position, + @JsonProperty("originalName") String originalName) { super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId, trackById, isFailed, statusMessage, - position); + position, originalName); this.productFamilyId = productFamilyId; this.platformName = platformName; this.lineOfBusiness = lineOfBusiness; |