use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.
the class StandardConnectionDAO method getFlowFileListingRequest.
@Override
public ListFlowFileStatus getFlowFileListingRequest(String connectionId, String listingRequestId) {
final Connection connection = locateConnection(connectionId);
final FlowFileQueue queue = connection.getFlowFileQueue();
final ListFlowFileStatus listRequest = queue.getListFlowFileStatus(listingRequestId);
if (listRequest == null) {
throw new ResourceNotFoundException(String.format("Unable to find listing request with id '%s'.", listingRequestId));
}
return listRequest;
}
use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.
the class StandardConnectionDAO method getFlowFileDropRequest.
@Override
public DropFlowFileStatus getFlowFileDropRequest(String connectionId, String dropRequestId) {
final Connection connection = locateConnection(connectionId);
final FlowFileQueue queue = connection.getFlowFileQueue();
final DropFlowFileStatus dropRequest = queue.getDropFlowFileStatus(dropRequestId);
if (dropRequest == null) {
throw new ResourceNotFoundException(String.format("Unable to find drop request with id '%s'.", dropRequestId));
}
return dropRequest;
}
use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.
the class StandardConnectionDAO method deleteFlowFileListingRequest.
@Override
public ListFlowFileStatus deleteFlowFileListingRequest(String connectionId, String listingRequestId) {
final Connection connection = locateConnection(connectionId);
final FlowFileQueue queue = connection.getFlowFileQueue();
final ListFlowFileStatus listFlowFileStatus = queue.cancelListFlowFileRequest(listingRequestId);
if (listFlowFileStatus == null) {
throw new ResourceNotFoundException(String.format("Unable to find listing request with id '%s'.", listingRequestId));
}
return listFlowFileStatus;
}
use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.
the class StandardControllerServiceDAO method createControllerService.
@Override
public ControllerServiceNode createControllerService(final ControllerServiceDTO controllerServiceDTO) {
// ensure the type is specified
if (controllerServiceDTO.getType() == null) {
throw new IllegalArgumentException("The controller service type must be specified.");
}
try {
// create the controller service
final ControllerServiceNode controllerService = serviceProvider.createControllerService(controllerServiceDTO.getType(), controllerServiceDTO.getId(), BundleUtils.getBundle(controllerServiceDTO.getType(), controllerServiceDTO.getBundle()), Collections.emptySet(), true);
// ensure we can perform the update
verifyUpdate(controllerService, controllerServiceDTO);
// perform the update
configureControllerService(controllerService, controllerServiceDTO);
final String groupId = controllerServiceDTO.getParentGroupId();
if (groupId == null) {
flowController.addRootControllerService(controllerService);
} else {
final ProcessGroup group;
if (groupId.equals(ROOT_GROUP_ID_ALIAS)) {
group = flowController.getGroup(flowController.getRootGroupId());
} else {
group = flowController.getGroup(flowController.getRootGroupId()).findProcessGroup(groupId);
}
if (group == null) {
throw new ResourceNotFoundException(String.format("Unable to locate group with id '%s'.", groupId));
}
group.addControllerService(controllerService);
}
return controllerService;
} catch (final ControllerServiceInstantiationException csie) {
throw new NiFiCoreException(csie.getMessage(), csie);
}
}
use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.
the class StandardFunnelDAO method locateFunnel.
private Funnel locateFunnel(final String funnelId) {
final ProcessGroup rootGroup = flowController.getGroup(flowController.getRootGroupId());
final Funnel funnel = rootGroup.findFunnel(funnelId);
if (funnel == null) {
throw new ResourceNotFoundException(String.format("Unable to find funnel with id '%s'.", funnelId));
} else {
return funnel;
}
}
Aggregations