Class ConnectionUtils

java.lang.Object
org.apache.nifi.connectable.ConnectionUtils

public class ConnectionUtils extends Object
  • Constructor Details

    • ConnectionUtils

      public ConnectionUtils()
  • Method Details

    • clone

      public static ConnectionUtils.FlowFileCloneResult clone(FlowFileRecord flowFile, Collection<Connection> destinations, FlowFileRepository flowFileRepository, ContentRepository contentRepository)
      Creates the FlowFileRecords and the RepositoryRecords necessary for transferring the given FlowFile to all of the given destinations. If only a single destination is given, the returned result will contain only the original FlowFile and a RepositoryRecord that represents that FlowFile. If multiple destinations are given, the returned result will contain the original FlowFile, as well as a cloned FlowFile for each of the destinations. If one or more clones are created, and a Content Repository is provided, the Claimant Count will be incremented for each clone (but not the original FlowFile). If the Content Repository is null, the Claimant Counts will not be incremented.
      Parameters:
      flowFile - the FlowFile to clone as necessary
      destinations - the destinations that the FlowFile will be transferred to
      flowFileRepository - the FlowFile Repository to use to generate the FlowFile ID for each clone
      contentRepository - the Content Repository to use to increment the Claimant Count for each clone, or null if the caller will take on the responsibility of incrementing the Claimant Counts
      Returns:
      a FlowFileCloneResult that contains the FlowFiles to enqueue and the RepositoryRecords to create
    • createRepositoryRecord

      private static RepositoryRecord createRepositoryRecord(FlowFileRecord flowFile, FlowFileQueue destinationQueue)