aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-06-11 14:22:02 +0300
committerMichael Lando <ml636r@att.com>2017-06-11 17:48:32 +0300
commitb3d4898d9e8452ea0b8d848c048e712d43b8d9a3 (patch)
tree0609319203be13f6c29ccbe24cb39c9d64f90095 /openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
parentaf9929df75604ce407d0ca542b200630164e0ae6 (diff)
[SDC-29] rebase continue work to align source
Change-Id: I218f1c5ee23fb2c8314f1c70921d3ad8682c10f4 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/MibDao.java2
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/MibDaoZusammenImpl.java32
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java6
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java3
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImpl.java2
5 files changed, 41 insertions, 4 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/MibDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/MibDao.java
index cf980a52ff..1efd21ccbf 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/MibDao.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/MibDao.java
@@ -38,4 +38,6 @@ public interface MibDao extends VersionableDao {
Collection<MibEntity> list(MibEntity entity);
void deleteAll(MibEntity entity);
+
+ Collection<MibEntity> listArtifacts(MibEntity entity);
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/MibDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/MibDaoZusammenImpl.java
index 10cdfbd9da..d56db41cee 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/MibDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/MibDaoZusammenImpl.java
@@ -135,6 +135,38 @@ public class MibDaoZusammenImpl implements MibDao {
VspZusammenUtil.aggregateElements(componentElement, mibsElement), "Delete mibs");
}
+ @Override
+ public Collection<MibEntity> listArtifacts(MibEntity mib) {
+ SessionContext context = ZusammenUtil.createSessionContext();
+ Id itemId = new Id(mib.getVspId());
+ ElementContext elementContext = new ElementContext(itemId,
+ VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
+ VspZusammenUtil.getVersionTag(mib.getVersion()));
+
+ final Optional<Element> elementByName =
+ zusammenAdaptor.getElementByName(context, elementContext, new Id(mib.getComponentId()
+ ), StructureElement.Mibs.name());
+
+ if(!elementByName.isPresent())
+ return null;
+ else {
+ final Id elementId = elementByName.get().getElementId();
+ return zusammenAdaptor.listElementData(context, elementContext, elementId).stream()
+ .map(element ->
+ buildMibEntity(element,mib)
+ ).collect(Collectors.toList());
+ }
+ }
+
+ private MibEntity buildMibEntity (Element element, MibEntity mib) {
+ MibEntity createdMib = new MibEntity(mib.getVspId(), mib.getVersion(), mib.getComponentId(),
+ null);
+ createdMib.setArtifactName((String) element.getInfo().getProperties().get(ARTIFACT_NAME));
+ createdMib.setArtifact(ByteBuffer.wrap(FileUtils.toByteArray(element.getData())));
+ createdMib.setType( ArtifactType.valueOf(element.getInfo().getName()));
+ return createdMib;
+ }
+
private ZusammenElement buildComponentElement(MibEntity mibEntity) {
ZusammenElement componentElement = new ZusammenElement();
componentElement.setElementId(new Id(mibEntity.getComponentId()));
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java
index 83a78bc705..2b6d52a38a 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java
@@ -5,6 +5,7 @@ import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
import com.amdocs.zusammen.datatypes.Id;
import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
import com.amdocs.zusammen.datatypes.item.ElementContext;
import com.amdocs.zusammen.utils.fileutils.FileUtils;
import org.openecomp.core.zusammen.api.ZusammenAdaptor;
@@ -13,7 +14,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadData;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
import java.io.ByteArrayInputStream;
import java.nio.ByteBuffer;
@@ -89,11 +89,11 @@ public class OrchestrationTemplateDaoZusammenImpl implements OrchestrationTempla
VspZusammenUtil.buildStructuralElement(StructureElement.OrchestrationTemplate, null);
ZusammenElement orchestrationTemplateValidationDataElement =
VspZusammenUtil
- .buildStructuralElement(StructureElement.OrchestrationTemplateValidationData, null);
+ .buildStructuralElement(StructureElement.OrchestrationTemplateValidationData, Action.UPDATE);
orchestrationTemplateValidationDataElement.setData(new ByteArrayInputStream(uploadData
.getValidationData().getBytes()));
ZusammenElement orchestrationTemplateContent =
- VspZusammenUtil.buildStructuralElement(StructureElement.OrchestrationTemplateContent, null);
+ VspZusammenUtil.buildStructuralElement(StructureElement.OrchestrationTemplateContent, Action.UPDATE);
orchestrationTemplateContent
.setData(new ByteArrayInputStream(uploadData.getContentData().array()));
orchestrationTemplateElement.addSubElement(orchestrationTemplateValidationDataElement);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java
index ffc9cb2901..b0cff4371e 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java
@@ -197,6 +197,9 @@ public class ProcessDaoZusammenImpl implements ProcessDao {
processEntity
.setArtifactName((String) elementInfo.getInfo().getProperties().get(ARTIFACT_NAME));
processEntity.setDescription((String) elementInfo.getInfo().getProperties().get(DESCRIPTION));
+ processEntity.setType( elementInfo.getInfo().getProperties().get(PROCESS_TYPE) != null ?
+ ProcessType.valueOf((String) elementInfo.getInfo().getProperties().get(PROCESS_TYPE)) :
+ null);
return processEntity;
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImpl.java
index d15014286f..7efb70494d 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImpl.java
@@ -214,7 +214,7 @@ public class TxtInformationArtifactGeneratorImpl implements InformationArtifactG
.getNetworkDescription(), TAB + TAB + TAB + TAB));
networkOpt.ifPresent(network -> addEntryWithIndent(VNICS_NETWORK, network.toString(),
TAB + TAB + TAB + TAB));
- addEntryWithIndent(VNICS_PROTOCOLS, nicQuestionnaire.getProtocols().toString(),
+ addEntryWithIndent(VNICS_PROTOCOLS, nicQuestionnaire.getProtocols() == null ? "" : nicQuestionnaire.getProtocols().toString(),
TAB + TAB + TAB + TAB);
Optional<IpConfiguration> ipconfigOpt = Optional.of(nicQuestionnaire).map