use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class RequestScopeValidation method validate.
@Override
public ValidationInformation validate(ValidationInformation info) throws ValidationException {
ModelInfo modelInfo = info.getSir().getRequestDetails().getModelInfo();
RequestInfo requestInfo = info.getSir().getRequestDetails().getRequestInfo();
String requestScope;
if (modelInfo == null) {
throw new ValidationException("model-info");
}
if (requestInfo == null) {
throw new ValidationException("requestInfo");
}
info.setRequestInfo(requestInfo);
if (modelInfo.getModelType() == null) {
throw new ValidationException("modelType");
}
requestScope = info.getSir().getRequestDetails().getModelInfo().getModelType().name();
info.setRequestScope(requestScope);
return info;
}
use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class WorkflowAction method getResourceKey.
private Resource getResourceKey(ServiceInstancesRequest sIRequest, WorkflowType resourceType) {
String resourceId = "";
ModelInfo modelInfo = sIRequest.getRequestDetails().getModelInfo();
if (modelInfo != null) {
if (modelInfo.getModelType().equals(ModelType.service)) {
resourceId = modelInfo.getModelVersionId();
} else {
resourceId = modelInfo.getModelCustomizationId();
}
}
return new Resource(resourceType, resourceId, true, null);
}
use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class UserParamsServiceTraversal method setResourceListForNetworks.
private void setResourceListForNetworks(DelegateExecution execution, String serviceModelVersionId, String requestAction, List<Resource> resourceList, Resource serviceResource, Service validate) {
for (Networks network : validate.getResources().getNetworks()) {
Resource networkResource = new Resource(WorkflowType.NETWORK, network.getModelInfo().getModelCustomizationId(), false, serviceResource);
networkResource.setProcessingPriority(network.getProcessingPriority());
ModelInfo modelInfo = network.getModelInfo();
if (modelInfo != null) {
networkResource.setModelCustomizationId(modelInfo.getModelCustomizationUuid());
networkResource.setModelVersionId(modelInfo.getModelVersionId());
}
resourceList.add(networkResource);
}
if (requestAction.equals(CREATE_INSTANCE)) {
String networkColCustId = queryCatalogDbForNetworkCollection(execution, serviceModelVersionId);
if (networkColCustId != null) {
resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, networkColCustId, false, serviceResource));
}
}
}
use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class UserParamsServiceTraversal method getResourceList.
private List<Resource> getResourceList(DelegateExecution execution, String serviceModelVersionId, String requestAction, Service validate) {
List<Resource> resourceList = new ArrayList<>();
Resource serviceResource = new Resource(WorkflowType.SERVICE, validate.getModelInfo().getModelVersionId(), false, null);
ModelInfo modelInfo = validate.getModelInfo();
if (modelInfo != null) {
serviceResource.setModelVersionId(modelInfo.getModelVersionId());
serviceResource.setModelInvariantId(modelInfo.getModelInvariantUuid());
}
resourceList.add(serviceResource);
if (validate.getResources().getVnfs() != null) {
setResourceListForVnfs(execution, resourceList, serviceResource, validate);
}
if (validate.getResources().getPnfs() != null) {
setResourceListForPnfs(resourceList, serviceResource, validate);
}
if (validate.getResources().getNetworks() != null) {
setResourceListForNetworks(execution, serviceModelVersionId, requestAction, resourceList, serviceResource, validate);
}
return resourceList;
}
use of org.onap.so.serviceinstancebeans.ModelInfo in project so by onap.
the class BpmnRequestBuilder method mapVnfModelInformation.
protected ModelInfo mapVnfModelInformation(GenericVnf vnf) {
ModelInfo modelInfo = new ModelInfo();
modelInfo.setModelCustomizationId(vnf.getModelCustomizationId());
modelInfo.setModelCustomizationUuid(vnf.getModelCustomizationId());
modelInfo.setModelType(ModelType.vnf);
return modelInfo;
}
Aggregations