summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main
diff options
context:
space:
mode:
authoraz2497 <avi.ziv@amdocs.com>2017-08-10 17:49:40 +0300
committeraz2497 <avi.ziv@amdocs.com>2017-08-10 18:47:32 +0300
commit644017cb3edd5b7a077a634ffd5daf2fee6bc088 (patch)
treed371219cede1734d6909568325345ef196be677b /openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main
parent7f7925e39cf2f428061d161bc4ffe67cad80c76e (diff)
[SDC] OnBoard with enabled tests and features
Change-Id: I4c1bbf6e1c854cf97a3561c736f83da44b58b7c0 Signed-off-by: az2497 <avi.ziv@amdocs.com> [SDC] OnBoard with enabled tests and features. Change-Id: Icd52f039aee4dd393a1404d530bb9fdd0b20e604 Signed-off-by: az2497 <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java12
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java58
2 files changed, 33 insertions, 37 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java
index c8612bfeaa..c36d255b31 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java
@@ -113,20 +113,16 @@ public class LimitZusammenDaoImpl implements LimitDao {
limitEntity.setType( elementInfo.getInfo().getProperties().get(LIMT_TYPE) != null ?
LimitType.valueOf((String) elementInfo.getInfo().getProperties().get(LIMT_TYPE)) :
null);
- limitEntity.setTime( elementInfo.getInfo().getProperties().get(TIME) != null ?
- EntitlementTime.valueOf((String) elementInfo.getInfo().getProperties().get(TIME)) :
- null);
- limitEntity.setMetric( elementInfo.getInfo().getProperties().get(METRIC) != null ?
- EntitlementMetric.valueOf((String) elementInfo.getInfo().getProperties().get(METRIC)) :
- null);
+ limitEntity.setTime((String) elementInfo.getInfo().getProperties().get(TIME) );
+ limitEntity.setMetric( (String) elementInfo.getInfo().getProperties().get(METRIC));
limitEntity.setAggregationFunction( elementInfo.getInfo().getProperties().get
(AGGREGATIONFUNCTION) != null ?
AggregationFunction.valueOf((String) elementInfo.getInfo().getProperties()
.get(AGGREGATIONFUNCTION)) : null);
Object unit = elementInfo.getInfo().getProperties().get(UNIT);
- limitEntity.setUnit(unit != null ? VlmZusammenUtil.toInteger(unit) : null);
+ limitEntity.setUnit((String) unit);
Object value = elementInfo.getInfo().getProperties().get(VALUE);
- limitEntity.setValue(value != null ? VlmZusammenUtil.toInteger(value) : null);
+ limitEntity.setValue((String) value);
return limitEntity;
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java
index 5f9dd10816..2f7e0ea50e 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java
@@ -23,7 +23,6 @@ package org.openecomp.sdc.vendorlicense.facade.impl;
import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP;
import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG;
-import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_MISSING_LA;
import org.apache.commons.collections4.CollectionUtils;
import org.openecomp.core.util.UniqueValueUtil;
@@ -519,33 +518,34 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade {
}
}
private void validateCompletedVendorLicenseModel(String vendorLicenseModelId, String user) {
- Version version = VersioningUtil.resolveVersion(null,
- getVersionInfo(vendorLicenseModelId, VersionableEntityAction.Read, user), user);
- Collection<LicenseAgreementEntity> licenseAgreements = licenseAgreementDao
- .list(new LicenseAgreementEntity(vendorLicenseModelId, version, null));
-
- if (CollectionUtils.isNotEmpty(licenseAgreements)) {
- licenseAgreements.forEach(licenseAgreement -> {
- if (CollectionUtils.isEmpty(licenseAgreement.getFeatureGroupIds())) {
- MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
- LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
- LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY);
- throw new CoreException(
- new SubmitUncompletedLicenseModelErrorBuilder(SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG).build());
- }
- });
-
- Collection<FeatureGroupEntity> featureGroupEntities = featureGroupDao.list(
- new FeatureGroupEntity(vendorLicenseModelId, version, null));
- featureGroupEntities.forEach(featureGroupEntity -> {
- if(CollectionUtils.isEmpty(featureGroupEntity.getEntitlementPoolIds())) {
- MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
- LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
- LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY);
- throw new CoreException(
- new SubmitUncompletedLicenseModelErrorBuilder(SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP).build());
- }
- });
- }
+ Collection<String> allFeatureGroupEntities = new HashSet<>();
+ Version version = VersioningUtil.resolveVersion(null,
+ getVersionInfo(vendorLicenseModelId, VersionableEntityAction.Read, user), user);
+ Collection<LicenseAgreementEntity> licenseAgreements = licenseAgreementDao
+ .list(new LicenseAgreementEntity(vendorLicenseModelId, version, null));
+
+ if (CollectionUtils.isNotEmpty(licenseAgreements)) {
+ licenseAgreements.forEach(licenseAgreement -> {
+ if (CollectionUtils.isEmpty(licenseAgreement.getFeatureGroupIds())) {
+ MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+ LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
+ LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY);
+ throw new CoreException(
+ new SubmitUncompletedLicenseModelErrorBuilder(SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG).build());
+ }
+ allFeatureGroupEntities.addAll(licenseAgreement.getFeatureGroupIds());
+ });
+
+ allFeatureGroupEntities.forEach(fg -> {
+ FeatureGroupEntity featureGroupEntity = featureGroupDao.get(new FeatureGroupEntity(vendorLicenseModelId, version, fg));
+ if(CollectionUtils.isEmpty(featureGroupEntity.getEntitlementPoolIds())) {
+ MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+ LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
+ LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY);
+ throw new CoreException(
+ new SubmitUncompletedLicenseModelErrorBuilder(SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP).build());
+ }
+ });
+ }
}
}