Interface ProvenanceEventBuilder


public interface ProvenanceEventBuilder
  • Method Details

    • setEventType

      Sets the type of ProvenanceEventRecord
      Parameters:
      eventType - of the event
      Returns:
      the builder
    • fromEvent

      Populates the values of the Event being built from the values in the given event
      Parameters:
      event - the event from which to populate the Builders values
      Returns:
      the builder
    • setFlowFileEntryDate

      ProvenanceEventBuilder setFlowFileEntryDate(long entryDate)
      Sets the date and time at which the FlowFile entered the flow
      Parameters:
      entryDate - of the flow file
      Returns:
      the builder
    • setPreviousContentClaim

      ProvenanceEventBuilder setPreviousContentClaim(String container, String section, String identifier, Long offset, long size)
      Sets the Content Claim that the FlowFile was previously associated with before this event occurred.
      Parameters:
      container - for previous content
      section - for previous content
      identifier - for previous content
      offset - for previous content
      size - for previous content
      Returns:
      the builder
    • setCurrentContentClaim

      ProvenanceEventBuilder setCurrentContentClaim(String container, String section, String identifier, Long offset, long size)
      Sets the Content Claim that the FlowFile is associated with as a result of this event
      Parameters:
      container - for resulting content
      section - for resulting content
      identifier - for resulting content
      offset - for resulting content
      size - for resulting content
      Returns:
      the builder
    • setSourceQueueIdentifier

      ProvenanceEventBuilder setSourceQueueIdentifier(String identifier)
      Sets the identifier of the FlowFile Queue from which the FlowFile was pulled
      Parameters:
      identifier - of the source queue
      Returns:
      the builder
    • setAttributes

      ProvenanceEventBuilder setAttributes(Map<String,String> previousAttributes, Map<String,String> updatedAttributes)
      Sets the attributes that existed on the FlowFile before this event occurred and any attributes that were added or updated as a result of this event.
      Parameters:
      previousAttributes - Map of all attributes before the event occurred
      updatedAttributes - Map containing all attributes that were added or updated. If any entry has a value of null, that attribute is considered removed
      Returns:
      the builder
    • setFlowFileUUID

      ProvenanceEventBuilder setFlowFileUUID(String uuid)
      Sets the UUID to associate with the FlowFile
      Parameters:
      uuid - of the flowfile
      Returns:
      the builder
    • setEventTime

      ProvenanceEventBuilder setEventTime(long eventTime)
      Sets the time at which the Provenance Event took place
      Parameters:
      eventTime - time of the event
      Returns:
      the builder
    • setEventDuration

      ProvenanceEventBuilder setEventDuration(long millis)
      Sets the amount of time that was required in order to perform the function referred to by this event
      Parameters:
      millis - of the event
      Returns:
      the builder
    • setLineageStartDate

      ProvenanceEventBuilder setLineageStartDate(long startDate)
      Sets the time at which the FlowFile's lineage began
      Parameters:
      startDate - start date of the event
      Returns:
      the builder
    • setComponentId

      ProvenanceEventBuilder setComponentId(String componentId)
      Sets the unique identifier of the NiFi Component (such as a Processor) that is generating the Event
      Parameters:
      componentId - that produced the event
      Returns:
      the builder
    • setComponentType

      ProvenanceEventBuilder setComponentType(String componentType)
      Sets the type of the Component that is generating the Event. For Processors, this is the Simple Class Name of the Processor.
      Parameters:
      componentType - of the component that made the event
      Returns:
      the builder
    • setSourceSystemFlowFileIdentifier

      ProvenanceEventBuilder setSourceSystemFlowFileIdentifier(String sourceSystemFlowFileIdentifier)
      Sets the identifier that is used by the remote system to refer to the FlowFile for which this Event is being created. This is valid only for Event Types ProvenanceEventType.RECEIVE and ProvenanceEventType.SEND and will be ignored for any other event types.
      Parameters:
      sourceSystemFlowFileIdentifier - identifier the remote system used
      Returns:
      the builder
    • setTransitUri

      ProvenanceEventBuilder setTransitUri(String transitUri)
      Sets the Transit URI that is used for the Event. This is a URI that provides information about the System and Protocol information over which the transfer occurred. The intent of this field is such that both the sender and the receiver can publish the events to an external Enterprise-wide system that is then able to correlate the SEND and RECEIVE events. This is valid only for Event Types ProvenanceEventType.RECEIVE and ProvenanceEventType.SEND and will be ignored for any other event types.
      Parameters:
      transitUri - of the event
      Returns:
      the builder
    • addParentFlowFile

      ProvenanceEventBuilder addParentFlowFile(FlowFile parent)
      Adds the given FlowFile as a parent for Events of type, ProvenanceEventType.FORK, ProvenanceEventType.JOIN, and ProvenanceEventType.CLONE This is valid only for ProvenanceEventType.FORK, ProvenanceEventType.JOIN, and ProvenanceEventType.CLONE events and will be ignored for any other event types.
      Parameters:
      parent - flowfile that this event is derived from
      Returns:
      the builder
    • removeParentFlowFile

      ProvenanceEventBuilder removeParentFlowFile(FlowFile parent)
      Removes the given FlowFile as a parent for Events of type, ProvenanceEventType.FORK, ProvenanceEventType.JOIN, and ProvenanceEventType.CLONE This is valid only for ProvenanceEventType.FORK, ProvenanceEventType.JOIN, and ProvenanceEventType.CLONE events and will be ignored for any other event types.
      Parameters:
      parent - previous parent of this event
      Returns:
      the builder
    • addChildFlowFile

      ProvenanceEventBuilder addChildFlowFile(FlowFile child)
      Adds the given FlowFile as a child for Events of type ProvenanceEventType.FORK, ProvenanceEventType.JOIN, and ProvenanceEventType.CLONE This is valid only for ProvenanceEventType.FORK, ProvenanceEventType.JOIN, and ProvenanceEventType.CLONE events and will be ignored for any other event types.
      Parameters:
      child - the child to add
      Returns:
      the builder
    • addChildFlowFile

      ProvenanceEventBuilder addChildFlowFile(String childId)
      Adds the given FlowFile identifier as a child for Events of type ProvenanceEventType.FORK and ProvenanceEventType.CLONE
      Parameters:
      childId - the ID of the FlowFile that is a child
      Returns:
      the builder
    • removeChildFlowFile

      ProvenanceEventBuilder removeChildFlowFile(FlowFile child)
      Removes the given FlowFile as a child for Events of type ProvenanceEventType.FORK, ProvenanceEventType.JOIN, and ProvenanceEventType.CLONE This is valid only for ProvenanceEventType.FORK, ProvenanceEventType.JOIN, and ProvenanceEventType.CLONE events and will be ignored for any other event types.
      Parameters:
      child - to remove
      Returns:
      the builder
    • setAlternateIdentifierUri

      ProvenanceEventBuilder setAlternateIdentifierUri(String alternateIdentifierUri)
      Associates the given identifier with the FlowFile for which this Event is created. This provides a linkage between the given FlowFile and alternate identifier. This information can be useful if published to an external, enterprise-wide Provenance tracking system that is able to associate the data between different processes or services. This is valid only for ProvenanceEventType.ADDINFO events and will be ignored for any other event types.
      Parameters:
      alternateIdentifierUri - another identifier of the flowfile this event is for
      Returns:
      the builder
    • setDetails

      ProvenanceEventBuilder setDetails(String details)
      Sets the details for this event. This is a free-form String that can contain any information that is relevant to this event.
      Parameters:
      details - a description of the event
      Returns:
      the builder
    • setRelationship

      ProvenanceEventBuilder setRelationship(Relationship relationship)
      Sets the to which the FlowFile was routed for ProvenanceEventType.ROUTE events. This is valid only for ProvenanceEventType.ROUTE events and will be ignored for any other event types.
      Parameters:
      relationship - to which flowfiles in this event were routed
      Returns:
      the builder
    • fromFlowFile

      ProvenanceEventBuilder fromFlowFile(FlowFile flowFile)
      Populates the builder with as much information as it can from the given FlowFile
      Parameters:
      flowFile - to source attributes for this event from
      Returns:
      the builder
    • build

      Builds the Provenance Event. It is possible that calling ProvenanceEventRecord.getEventId() on the ProvenanceEventRecord that is returned will yield -1. This is because the implementation of the Event may depend on the
      invalid reference
      ProvevenanceEventRepository
      to generate the unique identifier.
      Returns:
      the event
    • getChildFlowFileIds

      List<String> getChildFlowFileIds()
      Returns:
      the ids of all FlowFiles that have been added as children via addChildFlowFile(FlowFile)
    • getParentFlowFileIds

      List<String> getParentFlowFileIds()
      Returns:
      the ids of all FlowFiles that have been added as parents via addParentFlowFile(FlowFile)
    • getFlowFileId

      String getFlowFileId()
      Returns:
      the id of the FlowFile for which the event is being built
    • copy

      Returns:
      a new Provenance Event Builder that is identical to this one (a deep copy)