diff options
author | Ittay Stern <ittay.stern@att.com> | 2020-02-12 12:28:59 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-02-20 19:12:02 +0200 |
commit | 3bfa1d957d77f9e40c47e654a629e73bd77fdfcd (patch) | |
tree | 4d44c84a3d85cd7d83068b42f9b4e011af6c8e86 /vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java | |
parent | d6eedb1f342ac32c8339b553848267e443410d57 (diff) |
Topology tree: enrich vfModules data from other versions of same model
Depends on FLAG_EXP_TOPOLOGY_TREE_VFMODULE_NAMES_FROM_OTHER_TOSCA_VERSIONS
Issue-ID: VID-771
Change-Id: Ib25c6cf7269614f2f4d332b3aa84b3307a59ebda
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java index a5988a156..ef62bf9f6 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java @@ -52,6 +52,7 @@ import org.onap.vid.properties.VidProperties; import org.onap.vid.utils.Logging; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpMethod; +import org.springframework.lang.NonNull; import org.togglz.core.manager.FeatureManager; /** @@ -99,11 +100,6 @@ public class VidServiceImpl implements VidService { }); } - /* - * (non-Javadoc) - * - * @see org.onap.vid.controller.VidService#getService(java.lang.String) - */ @Override public ServiceModel getService(String uuid) throws AsdcCatalogException { if (featureManager.isActive(FLAG_SERVICE_MODEL_CACHE)) { @@ -113,6 +109,20 @@ public class VidServiceImpl implements VidService { } } + @NonNull + @Override + public ServiceModel getServiceModelOrThrow(String modelVersionId) { + try { + final ServiceModel serviceModel = getService(modelVersionId); + if (serviceModel == null) { + throw new GenericUncheckedException("Model version '" + modelVersionId + "' not found"); + } + return serviceModel; + } catch (AsdcCatalogException e) { + throw new GenericUncheckedException("Exception while loading model version '" + modelVersionId + "'", e); + } + } + private ServiceModel getServiceFromCache(String uuid) throws AsdcCatalogException { try { return serviceModelCache.get(uuid); |