use of org.onap.so.serviceinstancebeans.LineOfBusiness in project so by onap.
the class PlatformLOBValidation method validate.
@Override
public ValidationInformation validate(ValidationInformation info) throws ValidationException {
int reqVersion = info.getReqVersion();
Platform platform;
LineOfBusiness lineOfBusiness;
String requestScope = info.getRequestScope();
Actions action = info.getAction();
platform = info.getSir().getRequestDetails().getPlatform();
lineOfBusiness = info.getSir().getRequestDetails().getLineOfBusiness();
if (reqVersion >= 5 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.createInstance) {
if (reqVersion > 5 && platform == null) {
throw new ValidationException("platform");
}
if (platform != null && empty(platform.getPlatformName())) {
throw new ValidationException("platformName");
}
if (lineOfBusiness != null && empty(lineOfBusiness.getLineOfBusinessName())) {
throw new ValidationException("lineOfBusinessName");
}
}
info.setPlatform(platform);
info.setLOB(lineOfBusiness);
return info;
}
Aggregations