diff options
author | Abhai Singh <Abhai.Singh@amdocs.com> | 2017-08-30 13:12:53 +0530 |
---|---|---|
committer | Skip Wonnell <skip@att.com> | 2017-08-30 12:06:10 +0000 |
commit | 51f905f307dde5e1c5135515796c614250e9de4d (patch) | |
tree | 8bc1cf29c12c23d14ce7e45b7d365d2be7724e5a | |
parent | 63a1371d5b0fa6b2a500a38f88e7519d989d5b56 (diff) |
Truncate Service_Description field
Updated ArtifactStorageService to truncate if length exceeds 255
Change-Id: If456802c3370553d9ed3a8942ff16b407f896ed2
Issue-ID:APPC-184
Signed-off-by: Abhai Singh <Abhai.Singh@amdocs.com>
-rw-r--r-- | appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java b/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java index ed5e16525..160ed03d0 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java +++ b/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java @@ -24,6 +24,7 @@ package org.openecomp.appc.sdc.artifacts.helper; +import org.apache.commons.lang.StringUtils; import org.openecomp.appc.exceptions.APPCException; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -221,7 +222,7 @@ public class ArtifactStorageService { arguments.add(artifact.getServiceUUID()); arguments.add(artifact.getDistributionId()); arguments.add(artifact.getServiceName()); - arguments.add(artifact.getServiceDescription()); + arguments.add(truncateServiceDescription(artifact.getServiceDescription())); arguments.add(artifact.getResourceUUID()); arguments.add(artifact.getResourceInstanceName()); arguments.add(artifact.getResourceName()); @@ -237,6 +238,14 @@ public class ArtifactStorageService { return arguments; } + private String truncateServiceDescription(String serviceDescription){ + if (!StringUtils.isBlank(serviceDescription) && serviceDescription.length()>255){ + logger.info("Truncating the SERVICE_DESCRIPTION to 255 characters"); + serviceDescription=serviceDescription.substring(0,255); + } + return serviceDescription; + } + /** * Reads the SDC artifact from APP-C database * @param resourceName - resource Name from ASDC Artifact |