From cbf73dae518c62d5ebd077816e457d5e8db15a85 Mon Sep 17 00:00:00 2001 From: Bartosz Gardziejewski Date: Tue, 24 Sep 2019 07:54:09 +0200 Subject: adding orchestration type to service models view Issue-ID: VID-602 Signed-off-by: Bartosz Gardziejewski Change-Id: I289b55129cbfe8fbf6dd28f0e8f41715ff4ed107 --- .../main/java/org/onap/vid/aai/model/ModelVer.java | 9 + .../main/java/org/onap/vid/asdc/beans/Service.java | 183 ++------------------- .../java/org/onap/vid/properties/Features.java | 1 + .../java/org/onap/vid/services/AaiServiceImpl.java | 4 +- 4 files changed, 30 insertions(+), 167 deletions(-) (limited to 'vid-app-common/src/main/java') diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java index f2f6ca50a..099f2449b 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java @@ -32,6 +32,7 @@ public class ModelVer { private String distributionStatus; private String resourceVersion; private String modelDescription; + private String orchestrationType; @@ -89,4 +90,12 @@ public class ModelVer { this.modelDescription = modelDescription; } + public String getOrchestrationType() { + return orchestrationType; + } + + @JsonAlias("orchestration-type") + public void setOrchestrationType(String orchestrationType) { + this.orchestrationType = orchestrationType; + } } diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java index ca151a731..0d37fb39e 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java @@ -23,88 +23,59 @@ package org.onap.vid.asdc.beans; import java.util.Collection; import java.util.UUID; -/** - * The Class Service. - */ public class Service { - /** - * The Enum DistributionStatus. - */ public enum DistributionStatus { - /** The distribution not approved. */ DISTRIBUTION_NOT_APPROVED, - /** The distribution approved. */ DISTRIBUTION_APPROVED, - /** The distributed. */ DISTRIBUTED, - /** The distribution rejected. */ DISTRIBUTION_REJECTED, - /** The destributed for tenant isolation. */ DISTRIBUTION_COMPLETE_OK } - /** - * The Enum LifecycleState. - */ public enum LifecycleState { - /** The not certified checkout. */ NOT_CERTIFIED_CHECKOUT, - /** The not certified checkin. */ NOT_CERTIFIED_CHECKIN, - /** The ready for certification. */ READY_FOR_CERTIFICATION, - /** The certification in progress. */ CERTIFICATION_IN_PROGRESS, - /** The certified. */ CERTIFIED } - /** The uuid. */ private String uuid; - /** The invariant UUID. */ private String invariantUUID; - /** The name. */ private String name; - /** The version. */ private String version; - /** The tosca model URL. */ private String toscaModelURL; - /** The category. */ private String category; - /** The lifecycle state. */ private Service.LifecycleState lifecycleState; - /** The last updater user uid. */ private String lastUpdaterUserId; - /** The last updater full name. */ private String lastUpdaterFullName; - /** The distribution status. */ private String distributionStatus; - /** The artifacts. */ private Collection artifacts; - /** The resources. */ private Collection resources; + + private String orchestrationType; public static class ServiceBuilder { @@ -118,6 +89,7 @@ public class Service { private String distributionStatus; private Collection artifacts; private Collection resources; + private String orchestrationType; public ServiceBuilder setUuid(String uuid) { this.uuid = uuid; @@ -169,253 +141,131 @@ public class Service { return this; } + public ServiceBuilder setOrchestrationType(String orchestrationType) { + this.orchestrationType = orchestrationType; + return this; + } + public Service build() { return new Service(this); } } - /** - * Gets the uuid. - * - * @return the uuid - */ public String getUuid() { return uuid; } - /** - * Gets the invariant UUID. - * - * @return the invariant UUID - */ public String getInvariantUUID() { return invariantUUID; } - /** - * Gets the name. - * - * @return the name - */ public String getName() { return name; } - /** - * Gets the version. - * - * @return the version - */ public String getVersion() { return version; } - /** - * Gets the tosca model URL. - * - * @return the tosca model URL - */ public String getToscaModelURL() { return toscaModelURL; } - /** - * Gets the category. - * - * @return the category - */ public String getCategory() { return category; } - /** - * Gets the lifecycle state. - * - * @return the lifecycle state - */ public Service.LifecycleState getLifecycleState() { return lifecycleState; } - /** - * Gets the last updater user uid. - * - * @return the last updater user uid - */ public String getLastUpdaterUserId() { return lastUpdaterUserId; } - /** - * Gets the last updater full name. - * - * @return the last updater full name - */ public String getLastUpdaterFullName() { return lastUpdaterFullName; } - /** - * Gets the distribution status. - * - * @return the distribution status - */ public String getDistributionStatus() { return distributionStatus; } - /** - * Gets the artifacts. - * - * @return the artifacts - */ public Collection getArtifacts() { return artifacts; } - /** - * Gets the resources. - * - * @return the resources - */ public Collection getResources() { return resources; } - /** - * Sets the uuid. - * - * @param uuid the new uuid - */ + public String getOrchestrationType() { + return orchestrationType; + } + public void setUuid(String uuid) { this.uuid = uuid; } - /** - * Sets the invariant UUID. - * - * @param invariantUUID the new invariant UUID - */ public void setInvariantUUID(String invariantUUID) { this.invariantUUID = invariantUUID; } - /** - * Sets the name. - * - * @param name the new name - */ public void setName(String name) { this.name = name; } - /** - * Sets the version. - * - * @param version the new version - */ public void setVersion(String version) { this.version = version; } - /** - * Sets the tosca model URL. - * - * @param toscaModelURL the new tosca model URL - */ public void setToscaModelURL(String toscaModelURL) { this.toscaModelURL = toscaModelURL; } - /** - * Sets the category. - * - * @param category the new category - */ public void setCategory(String category) { this.category = category; } - /** - * Sets the lifecycle state. - * - * @param lifecycleState the new lifecycle state - */ public void setLifecycleState(Service.LifecycleState lifecycleState) { this.lifecycleState = lifecycleState; } - /** - * Sets the last updater user uid. - * - * @param lastUpdaterUserId the new last updater user uid - */ public void set(String lastUpdaterUserId) { this.lastUpdaterUserId = lastUpdaterUserId; } - /** - * Sets the last updater full name. - * - * @param lastUpdaterFullName the new last updater full name - */ public void setLastUpdaterFullName(String lastUpdaterFullName) { this.lastUpdaterFullName = lastUpdaterFullName; } - /** - * Sets the distribution status. - * - * @param distributionStatus the new distribution status - */ public void setDistributionStatus(String distributionStatus) { this.distributionStatus = distributionStatus; } - /** - * Sets the artifacts. - * - * @param artifacts the new artifacts - */ public void setArtifacts(Collection artifacts) { this.artifacts = artifacts; } - /** - * Sets the resources. - * - * @param resources the new resources - */ public void setResources(Collection resources) { this.resources = resources; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ + public void setOrchestrationType(String orchestrationType) { + this.orchestrationType = orchestrationType; + } + @Override public String toString() { return uuid; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { return UUID.fromString(getUuid()).hashCode(); } - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object o) { if (o == this) @@ -442,5 +292,6 @@ public class Service { this.distributionStatus = serviceBuilder.distributionStatus; this.artifacts = serviceBuilder.artifacts; this.resources = serviceBuilder.resources; + this.orchestrationType = serviceBuilder.orchestrationType; } } diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java index 7384c97e2..a3343d36b 100644 --- a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java +++ b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java @@ -74,6 +74,7 @@ public enum Features implements Feature { FLAG_PNP_INSTANTIATION, FLAG_HANDLE_SO_WORKFLOWS, FLAG_CREATE_ERROR_REPORTS, + FLAG_SHOW_ORCHESTRATION_TYPE, FLAG_DISABLE_HOMING, FLAG_FLASH_REDUCED_RESPONSE_CHANGEMG, FLAG_FLASH_MORE_ACTIONS_BUTTON_IN_OLD_VIEW_EDIT, diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java index b6404fa68..984812103 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java @@ -137,7 +137,9 @@ public class AaiServiceImpl implements AaiService { .setToscaModelURL(null) .setLifecycleState(null) .setArtifacts(null) - .setResources(null).build(); + .setResources(null) + .setOrchestrationType(modelVer.getOrchestrationType()) + .build(); -- cgit 1.2.3-korg