Interface SchedulerServiceDatabase

All Known Implementing Classes:
SchedulerServiceDatabaseImpl

public interface SchedulerServiceDatabase
Permanent storage for events. Does not support searching.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Retrieve the number of events.
    void
    deleteEvent(String mediapackageId)
    Removes the extended event from persistent storage.
    com.entwinemedia.fn.data.Opt<ExtendedEventDto>
    getEvent(String mediapackageId)
    Get the event with the given mediapackage id for the current organization.
    com.entwinemedia.fn.data.Opt<ExtendedEventDto>
    getEvent(String mediapackageId, String orgId)
    Get the event with the given mediapackage id and organization.
    Get all events from the scheduler for the current organizations.
    getEvents(String captureAgentId, Date start, Date end, int separationMillis)
    Get the mediapackage IDs of all events scheduled on the given capture agent between the given start/end time.
    Retrieve all events which have a recording state and a recording last heard.
    Get the last modification date by an agent identifier
    Get a Map of last modification dates of all existing capture agents.
    void
    resetRecordingState(String mediapackageId)
    Nulls recording state and recording last heard of of the given media package.
    search(com.entwinemedia.fn.data.Opt<String> captureAgentId, com.entwinemedia.fn.data.Opt<Date> startsFrom, com.entwinemedia.fn.data.Opt<Date> startsTo, com.entwinemedia.fn.data.Opt<Date> endFrom, com.entwinemedia.fn.data.Opt<Date> endTo, com.entwinemedia.fn.data.Opt<Integer> limit)
    Retrieve all events matching given filter ordered by start time ascending.
    void
    storeEvent(String mediapackageId, String organizationId, com.entwinemedia.fn.data.Opt<String> captureAgentId, com.entwinemedia.fn.data.Opt<Date> start, com.entwinemedia.fn.data.Opt<Date> end, com.entwinemedia.fn.data.Opt<String> source, com.entwinemedia.fn.data.Opt<String> recordingState, com.entwinemedia.fn.data.Opt<Long> recordingLastHeard, com.entwinemedia.fn.data.Opt<String> presenters, com.entwinemedia.fn.data.Opt<Date> lastModifiedDate, com.entwinemedia.fn.data.Opt<String> checksum, com.entwinemedia.fn.data.Opt<Map<String,String>> workflowProperties, com.entwinemedia.fn.data.Opt<Map<String,String>> captureAgentProperties)
    Create or update an event identified by mediapackageId and organizationId
    void
    Touches the most recent entry by updating its last modification date.
  • Method Details

    • touchLastEntry

      void touchLastEntry(String agentId) throws SchedulerServiceDatabaseException
      Touches the most recent entry by updating its last modification date.
      Parameters:
      agentId - the capture agent identifier
      Throws:
      SchedulerServiceDatabaseException - if updating of the last modified value fails
    • getLastModified

      Date getLastModified(String agentId) throws org.opencastproject.util.NotFoundException, SchedulerServiceDatabaseException
      Get the last modification date by an agent identifier
      Parameters:
      agentId - the capture agent identifier
      Returns:
      the last modification date
      Throws:
      org.opencastproject.util.NotFoundException - if the agent could not be found
      SchedulerServiceDatabaseException - if exception occurred
    • getLastModifiedDates

      Map<String,Date> getLastModifiedDates() throws SchedulerServiceDatabaseException
      Get a Map of last modification dates of all existing capture agents.
      Returns:
      the last modified map
      Throws:
      SchedulerServiceDatabaseException - if exception occurred
    • storeEvent

      void storeEvent(String mediapackageId, String organizationId, com.entwinemedia.fn.data.Opt<String> captureAgentId, com.entwinemedia.fn.data.Opt<Date> start, com.entwinemedia.fn.data.Opt<Date> end, com.entwinemedia.fn.data.Opt<String> source, com.entwinemedia.fn.data.Opt<String> recordingState, com.entwinemedia.fn.data.Opt<Long> recordingLastHeard, com.entwinemedia.fn.data.Opt<String> presenters, com.entwinemedia.fn.data.Opt<Date> lastModifiedDate, com.entwinemedia.fn.data.Opt<String> checksum, com.entwinemedia.fn.data.Opt<Map<String,String>> workflowProperties, com.entwinemedia.fn.data.Opt<Map<String,String>> captureAgentProperties) throws SchedulerServiceDatabaseException
      Create or update an event identified by mediapackageId and organizationId
      Parameters:
      mediapackageId - the mediapackage ID
      organizationId - the organization ID of the organization owning the event
      captureAgentId - the capture agent ID of the capture agent this event is scheduled on
      start - the recording start time
      end - the recording end time
      source - the source
      recordingState - the recording state
      recordingLastHeard - the recording last heard
      presenters - the presenters
      lastModifiedDate - the last modified date
      checksum - the checksum
      workflowProperties - the workflow properties
      captureAgentProperties - the capture agent properties
      Throws:
      SchedulerServiceDatabaseException - in case the event cannot be stored.
    • getEvents

      List<String> getEvents(String captureAgentId, Date start, Date end, int separationMillis) throws SchedulerServiceDatabaseException
      Get the mediapackage IDs of all events scheduled on the given capture agent between the given start/end time. Events which are only partially contained within the given interval are also included in the result set. The results are ordered by start date ascending.
      Parameters:
      captureAgentId - the capture agent ID of the capture agent to check
      start - the start date of the interval to check
      end - the end date of the interval to check
      separationMillis - number of milliseconds to prepend and append to given interval
      Returns:
      The mediapackage IDs of the events between start (inclusive) and end (inclusive) scheduled on the given capture agent.
      Throws:
      SchedulerServiceDatabaseException - If the database cannot be queried.
    • search

      List<ExtendedEventDto> search(com.entwinemedia.fn.data.Opt<String> captureAgentId, com.entwinemedia.fn.data.Opt<Date> startsFrom, com.entwinemedia.fn.data.Opt<Date> startsTo, com.entwinemedia.fn.data.Opt<Date> endFrom, com.entwinemedia.fn.data.Opt<Date> endTo, com.entwinemedia.fn.data.Opt<Integer> limit) throws SchedulerServiceDatabaseException
      Retrieve all events matching given filter ordered by start time ascending.
      Parameters:
      captureAgentId - the capture agent id filter
      startsFrom - the start from date filter
      startsTo - the start to date filter
      endFrom - the end from date filter
      endTo - the end to date filter
      limit - the maximum number of results to retrieve
      Returns:
      The events matching the given filter
      Throws:
      SchedulerServiceDatabaseException - If the database cannot be queried.
    • getKnownRecordings

      Retrieve all events which have a recording state and a recording last heard.
      Returns:
      all events which have a recording state and a recording last heard
      Throws:
      SchedulerServiceDatabaseException - If the database cannot be queried.
    • deleteEvent

      void deleteEvent(String mediapackageId) throws org.opencastproject.util.NotFoundException, SchedulerServiceDatabaseException
      Removes the extended event from persistent storage.
      Parameters:
      mediapackageId - ID of event to be removed
      Throws:
      org.opencastproject.util.NotFoundException - if there is no element with specified ID
      SchedulerServiceDatabaseException - if exception occurred
    • getEvent

      com.entwinemedia.fn.data.Opt<ExtendedEventDto> getEvent(String mediapackageId) throws SchedulerServiceDatabaseException
      Get the event with the given mediapackage id for the current organization.
      Parameters:
      mediapackageId - The mediapackage id to look for
      Returns:
      The event or nothing, if the event couldn't be found.
      Throws:
      SchedulerServiceDatabaseException - If the database cannot be queried.
    • getEvent

      com.entwinemedia.fn.data.Opt<ExtendedEventDto> getEvent(String mediapackageId, String orgId) throws SchedulerServiceDatabaseException
      Get the event with the given mediapackage id and organization.
      Parameters:
      mediapackageId - The mediapackage id to look for
      orgId - The organization id to look for
      Returns:
      The event or nothing, if the event couldn't be found.
      Throws:
      SchedulerServiceDatabaseException - If the database cannot be queried.
    • getEvents

      Get all events from the scheduler for the current organizations.
      Returns:
      The list of events.
      Throws:
      SchedulerServiceDatabaseException - If the database cannot be queried.
    • resetRecordingState

      void resetRecordingState(String mediapackageId) throws org.opencastproject.util.NotFoundException, SchedulerServiceDatabaseException
      Nulls recording state and recording last heard of of the given media package.
      Parameters:
      mediapackageId - The mediapackage id to look for
      Throws:
      org.opencastproject.util.NotFoundException - if there is no element with specified ID
      SchedulerServiceDatabaseException - If the database cannot be queried.
    • countEvents

      int countEvents() throws SchedulerServiceDatabaseException
      Retrieve the number of events.
      Returns:
      The number of events.
      Throws:
      SchedulerServiceDatabaseException - If the database cannot be queried.