use of org.onap.so.client.oof.beans.LicenseDemand in project so by onap.
the class OofHomingV2 method buildLicenseDemand.
/**
* Builds a single license demand object
*/
private LicenseDemand buildLicenseDemand(String id, ModelInfoMetadata metadata) {
logger.debug("Building demand for service or resource: " + id);
LicenseDemand demand = new LicenseDemand();
if (isNotBlank(id) && isNotBlank(metadata.getModelInstanceName())) {
demand.setServiceResourceId(id);
demand.setResourceModuleName(metadata.getModelInstanceName());
demand.setResourceModelInfo(buildModelInfo(metadata));
} else {
throw new BpmnError(UNPROCESSABLE, RESOURCE_MISSING_DATA + "modelInstanceName");
}
return demand;
}
use of org.onap.so.client.oof.beans.LicenseDemand in project so by onap.
the class OofHomingV2 method buildLicenseInfo.
/**
* Builds the license demand list for the homing/licensing request
*/
private LicenseInfo buildLicenseInfo(ServiceInstance serviceInstance) {
logger.trace("Building license information");
LicenseInfo licenseInfo = new LicenseInfo();
List<GenericVnf> vnfList = serviceInstance.getVnfs();
if (!vnfList.isEmpty()) {
logger.debug("Adding vnfs to license demands list");
for (GenericVnf vnf : vnfList) {
LicenseDemand demand = buildLicenseDemand(vnf.getVnfId(), vnf.getModelInfoGenericVnf());
licenseInfo.getLicenseDemands().add(demand);
}
}
return licenseInfo;
}
Aggregations