use of com.emc.storageos.db.client.model.uimodels.WFDirectory in project coprhd-controller by CoprHD.
the class WFDirectoryService method queryBulkResourceReps.
@Override
public WFBulkRep queryBulkResourceReps(List<URI> ids) {
List<WFDirectoryRestRep> wfDirectoryRestReps = new ArrayList<>();
List<WFDirectory> wfDirectories = wfDirectoryManager.getWFDirectories(ids);
for (WFDirectory wfd : wfDirectories) {
wfDirectoryRestReps.add(map(wfd));
}
return new WFBulkRep(wfDirectoryRestReps);
}
use of com.emc.storageos.db.client.model.uimodels.WFDirectory in project coprhd-controller by CoprHD.
the class WorkflowDirectoryManagerImpl method checkChildren.
private void checkChildren(URI id) {
WFDirectory wfDirectory = client.wfDirectory().findById(id);
if (null == wfDirectory) {
throw APIException.notFound.unableToFindEntityInURL(id);
}
// Disallow operation if this node has children that contain workflows/ primitives
List<WFDirectory> children = getWFDirectoryChildren(id);
if (CollectionUtils.isNotEmpty(wfDirectory.getWorkflows())) {
throw APIException.methodNotAllowed.notSupportedWithReason("Directory has workflows/primitives. Cannot be deleted");
}
for (final WFDirectory child : children) {
if (CollectionUtils.isNotEmpty(child.getWorkflows())) {
throw APIException.methodNotAllowed.notSupportedWithReason("Directory has children that contain workflows/primitives. Cannot be deleted");
}
// check the children
checkChildren(child.getId());
}
}
Aggregations