Search in sources :

Example 46 with FlowFileQueue

use of org.apache.nifi.controller.queue.FlowFileQueue in project nifi by apache.

the class StandardConnectionDAO method createFlowFileDropRequest.

@Override
public DropFlowFileStatus createFlowFileDropRequest(String id, String dropRequestId) {
    final Connection connection = locateConnection(id);
    final FlowFileQueue queue = connection.getFlowFileQueue();
    final NiFiUser user = NiFiUserUtils.getNiFiUser();
    if (user == null) {
        throw new WebApplicationException(new Throwable("Unable to access details for current user."));
    }
    return queue.dropFlowFiles(dropRequestId, user.getIdentity());
}
Also used : NiFiUser(org.apache.nifi.authorization.user.NiFiUser) WebApplicationException(javax.ws.rs.WebApplicationException) Connection(org.apache.nifi.connectable.Connection) FlowFileQueue(org.apache.nifi.controller.queue.FlowFileQueue)

Aggregations

FlowFileQueue (org.apache.nifi.controller.queue.FlowFileQueue)46 Connection (org.apache.nifi.connectable.Connection)25 ArrayList (java.util.ArrayList)20 HashMap (java.util.HashMap)15 IOException (java.io.IOException)14 Test (org.junit.Test)12 List (java.util.List)10 Map (java.util.Map)10 Connectable (org.apache.nifi.connectable.Connectable)10 FlowFileRecord (org.apache.nifi.controller.repository.FlowFileRecord)10 ContentClaim (org.apache.nifi.controller.repository.claim.ContentClaim)10 ResourceClaim (org.apache.nifi.controller.repository.claim.ResourceClaim)10 HashSet (java.util.HashSet)9 Set (java.util.Set)8 StandardResourceClaimManager (org.apache.nifi.controller.repository.claim.StandardResourceClaimManager)8 OutputStream (java.io.OutputStream)7 ResourceClaimManager (org.apache.nifi.controller.repository.claim.ResourceClaimManager)7 Relationship (org.apache.nifi.processor.Relationship)7 InputStream (java.io.InputStream)6 TimeUnit (java.util.concurrent.TimeUnit)6