Interface ProvenanceEventRepository


public interface ProvenanceEventRepository
This Repository houses Provenance Events. The repository is responsible for managing the life-cycle of the events, providing access to the events that it has stored, and providing query capabilities against the events.
  • Method Details

    • eventBuilder

      ProvenanceEventBuilder eventBuilder()
      Returns a ProvenanceEventBuilder that is capable of building ProvenanceEventRecords
      Returns:
      builder
    • registerEvent

      void registerEvent(ProvenanceEventRecord event)
      Adds the given event to the repository and returns a new event for which the event id has been populated. Depending on the implementation, the returned event may or may not be the same event given
      Parameters:
      event - to register
    • registerEvents

      void registerEvents(Iterable<ProvenanceEventRecord> events)
      Adds the given events to the repository.

      This interface makes no assumptions about whether or not the registration of the Collection are atomic. This detail is implementation-specific.

      Parameters:
      events - to register
    • getEvents

      List<ProvenanceEventRecord> getEvents(long firstRecordId, int maxRecords) throws IOException
      Returns a List of all ProvenanceEventRecords in the repository starting with the given ID. The first ID in the repository will always be 0 or higher. This method performs no authorization of the events.
      Parameters:
      firstRecordId - id of the first record to retrieve
      maxRecords - maximum number of records to retrieve
      Returns:
      records
      Throws:
      IOException - if error reading from repository
    • getMaxEventId

      Long getMaxEventId()
      Returns:
      the largest ID of any event that is queryable in the repository. If no queryable events exists, returns null
    • getEvent

      ProvenanceEventRecord getEvent(long id) throws IOException
      Retrieves the Provenance Event with the given ID.
      Parameters:
      id - to lookup
      Returns:
      the Provenance Event Record with the given ID, if it exists, or null otherwise
      Throws:
      IOException - if failure while retrieving event
    • close

      void close() throws IOException
      Closes the repository, freeing any resources
      Throws:
      IOException - if failure closing repository