Search in sources :

Example 56 with ResourceNotFoundException

use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.

the class StandardRemoteProcessGroupDAO method verifyUpdateInputPort.

@Override
public void verifyUpdateInputPort(String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPortDto) {
    final RemoteProcessGroup remoteProcessGroup = locateRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort port = remoteProcessGroup.getInputPort(remoteProcessGroupPortDto.getId());
    if (port == null) {
        throw new ResourceNotFoundException(String.format("Unable to find remote process group input port with id '%s'.", remoteProcessGroupPortDto.getId()));
    }
    verifyUpdatePort(port, remoteProcessGroupPortDto);
}
Also used : RemoteProcessGroup(org.apache.nifi.groups.RemoteProcessGroup) RemoteGroupPort(org.apache.nifi.remote.RemoteGroupPort) ResourceNotFoundException(org.apache.nifi.web.ResourceNotFoundException)

Example 57 with ResourceNotFoundException

use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.

the class StandardRemoteProcessGroupDAO method updateRemoteProcessGroupOutputPort.

@Override
public RemoteGroupPort updateRemoteProcessGroupOutputPort(String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPortDto) {
    final RemoteProcessGroup remoteProcessGroup = locateRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort port = remoteProcessGroup.getOutputPort(remoteProcessGroupPortDto.getId());
    if (port == null) {
        throw new ResourceNotFoundException(String.format("Unable to find remote process group output port with id '%s'.", remoteProcessGroupId));
    }
    // verify the update
    verifyUpdatePort(port, remoteProcessGroupPortDto);
    // perform the update
    updatePort(port, remoteProcessGroupPortDto, remoteProcessGroup);
    remoteProcessGroup.getProcessGroup().onComponentModified();
    return port;
}
Also used : RemoteProcessGroup(org.apache.nifi.groups.RemoteProcessGroup) RemoteGroupPort(org.apache.nifi.remote.RemoteGroupPort) ResourceNotFoundException(org.apache.nifi.web.ResourceNotFoundException)

Example 58 with ResourceNotFoundException

use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.

the class StandardRemoteProcessGroupDAO method verifyUpdateOutputPort.

@Override
public void verifyUpdateOutputPort(String remoteProcessGroupId, RemoteProcessGroupPortDTO remoteProcessGroupPortDto) {
    final RemoteProcessGroup remoteProcessGroup = locateRemoteProcessGroup(remoteProcessGroupId);
    final RemoteGroupPort port = remoteProcessGroup.getOutputPort(remoteProcessGroupPortDto.getId());
    if (port == null) {
        throw new ResourceNotFoundException(String.format("Unable to find remote process group output port with id '%s'.", remoteProcessGroupPortDto.getId()));
    }
    verifyUpdatePort(port, remoteProcessGroupPortDto);
}
Also used : RemoteProcessGroup(org.apache.nifi.groups.RemoteProcessGroup) RemoteGroupPort(org.apache.nifi.remote.RemoteGroupPort) ResourceNotFoundException(org.apache.nifi.web.ResourceNotFoundException)

Example 59 with ResourceNotFoundException

use of org.apache.nifi.web.ResourceNotFoundException in project nifi by apache.

the class StandardTemplateDAO method verifyCanAddTemplate.

@Override
public void verifyCanAddTemplate(String name, String groupId) {
    final ProcessGroup processGroup = flowController.getGroup(groupId);
    if (processGroup == null) {
        throw new ResourceNotFoundException("Could not find Process Group with ID " + groupId);
    }
    verifyAdd(name, processGroup);
}
Also used : ProcessGroup(org.apache.nifi.groups.ProcessGroup) ResourceNotFoundException(org.apache.nifi.web.ResourceNotFoundException)

Aggregations

ResourceNotFoundException (org.apache.nifi.web.ResourceNotFoundException)59 ProcessGroup (org.apache.nifi.groups.ProcessGroup)22 Authorizable (org.apache.nifi.authorization.resource.Authorizable)16 RemoteProcessGroup (org.apache.nifi.groups.RemoteProcessGroup)16 NiFiUser (org.apache.nifi.authorization.user.NiFiUser)12 Connection (org.apache.nifi.connectable.Connection)10 VersionedProcessGroup (org.apache.nifi.registry.flow.VersionedProcessGroup)10 IOException (java.io.IOException)9 RemoteGroupPort (org.apache.nifi.remote.RemoteGroupPort)7 ApiOperation (io.swagger.annotations.ApiOperation)6 ApiResponses (io.swagger.annotations.ApiResponses)6 Consumes (javax.ws.rs.Consumes)5 Path (javax.ws.rs.Path)5 Produces (javax.ws.rs.Produces)5 AuthorizationResult (org.apache.nifi.authorization.AuthorizationResult)5 DataAuthorizable (org.apache.nifi.authorization.resource.DataAuthorizable)5 FlowFileQueue (org.apache.nifi.controller.queue.FlowFileQueue)5 ProcessGroupStatus (org.apache.nifi.controller.status.ProcessGroupStatus)5 RemoteProcessGroupStatus (org.apache.nifi.controller.status.RemoteProcessGroupStatus)5 HashMap (java.util.HashMap)4