Interface SchedulerService

All Known Implementing Classes:
SchedulerServiceImpl, SchedulerServiceRemoteImpl

public interface SchedulerService
Scheduler service manages events (creates new, updates already existing and removes events). It enables searches over existing events, retrieving event data like dublincore, acl or workflow configuration for specific event, search for conflicting events and generating calendar for capture agent.
  • Field Details

  • Method Details

    • addEvent

      void addEvent(Date startDateTime, Date endDateTime, String captureAgentId, Set<String> userIds, MediaPackage mediaPackage, Map<String,String> wfProperties, Map<String,String> caMetadata, com.entwinemedia.fn.data.Opt<String> schedulingSource) throws UnauthorizedException, SchedulerConflictException, SchedulerException
      Creates new event using specified mediapackage, workflow configuration and capture agent configuration. The mediapackage id is used as the event's identifier. Default capture agent properties are created from agentId and DublinCore. Following values are generated:
      • event.title (mapped from dc:title)
      • event.series (mapped from mediaPackage#getSeries())
      • event.location (mapped from captureAgentId)
      Parameters:
      startDateTime - the event start time (the start date must be before the end date)
      endDateTime - the event end time (the end date must be after the start date)
      captureAgentId - the capture agent id
      userIds - the list of user identifiers of speakers/lecturers
      mediaPackage - the mediapackage
      wfProperties - the workflow configuration
      caMetadata - the capture agent configuration
      schedulingSource - the optional scheduling source from which the event comes from
      Throws:
      UnauthorizedException - if the caller is not authorized to take this action
      SchedulerConflictException - if there are conflicting events
      SchedulerException - if creating new events failed
    • addMultipleEvents

      Map<String,net.fortuna.ical4j.model.Period> addMultipleEvents(net.fortuna.ical4j.model.property.RRule rRule, Date start, Date end, Long duration, TimeZone tz, String captureAgentId, Set<String> userIds, MediaPackage templateMp, Map<String,String> wfProperties, Map<String,String> caMetadata, com.entwinemedia.fn.data.Opt<String> schedulingSource) throws UnauthorizedException, SchedulerConflictException, SchedulerException
      Creates a group of new event using specified mediapackage, workflow configuration and capture agent configuration. The mediapackage id is used as the event's identifier. Default capture agent properties are created from agentId and DublinCore. Following values are generated:
      • event.title (mapped from dc:title)
      • event.series (mapped from mediaPackage#getSeries())
      • event.location (mapped from captureAgentId)
      Parameters:
      rRule - the RRule for the events to schedule
      start - the start date for the recurrence
      end - the end date for the recurrence
      duration - the duration of the events
      tz - the TimeZone for the events
      captureAgentId - the capture agent id
      userIds - the list of user identifiers of speakers/lecturers
      templateMp - the mediapackage to base the events on
      wfProperties - the workflow configuration
      caMetadata - the capture agent configuration
      schedulingSource - the optional scheduling source from which the event comes from
      Returns:
      A Map of mediapackage ID and Period where the event occurs
      Throws:
      UnauthorizedException - if the caller is not authorized to take this action
      SchedulerConflictException - if there are conflicting events
      SchedulerException - if creating new events failed
    • updateEvent

      void updateEvent(String mediaPackageId, com.entwinemedia.fn.data.Opt<Date> startDateTime, com.entwinemedia.fn.data.Opt<Date> endDateTime, com.entwinemedia.fn.data.Opt<String> captureAgentId, com.entwinemedia.fn.data.Opt<Set<String>> userIds, com.entwinemedia.fn.data.Opt<MediaPackage> mediaPackage, com.entwinemedia.fn.data.Opt<Map<String,String>> wfProperties, com.entwinemedia.fn.data.Opt<Map<String,String>> caMetadata) throws NotFoundException, UnauthorizedException, SchedulerConflictException, SchedulerException
      Updates event with specified ID and check for conflicts. Default capture agent properties are created from DublinCore. Following values are generated:
      • event.title (mapped from dc:title)
      • event.series (mapped from mediaPackage#getSeries())
      • event.location (mapped from captureAgentId)
      Parameters:
      mediaPackageId - the optional event identifier
      startDateTime - the optional event start time
      endDateTime - the optional event end time
      captureAgentId - the optional capture agent id
      userIds - the optional list of user identifiers of speakers/lecturers
      mediaPackage - the optional mediapackage to update
      wfProperties - the optional workflow configuration to update
      caMetadata - the optional capture configuration to update
      Throws:
      NotFoundException - if event with specified ID cannot be found
      UnauthorizedException - if the current user is not authorized to perform this action
      SchedulerConflictException - if there are conflicting events
      SchedulerException - if exception occurred
    • updateEvent

      void updateEvent(String mediaPackageId, com.entwinemedia.fn.data.Opt<Date> startDateTime, com.entwinemedia.fn.data.Opt<Date> endDateTime, com.entwinemedia.fn.data.Opt<String> captureAgentId, com.entwinemedia.fn.data.Opt<Set<String>> userIds, com.entwinemedia.fn.data.Opt<MediaPackage> mediaPackage, com.entwinemedia.fn.data.Opt<Map<String,String>> wfProperties, com.entwinemedia.fn.data.Opt<Map<String,String>> caMetadata, boolean allowConflict) throws NotFoundException, UnauthorizedException, SchedulerConflictException, SchedulerException
      Updates event with specified ID and possibly checking for conflicts. Default capture agent properties are created from DublinCore. Following values are generated:
      • event.title (mapped from dc:title)
      • event.series (mapped from mediaPackage#getSeries())
      • event.location (mapped from captureAgentId)
      Parameters:
      mediaPackageId - the event identifier
      startDateTime - the optional event start time
      endDateTime - the optional event end time
      captureAgentId - the optional capture agent id
      userIds - the optional list of user identifiers of speakers/lecturers
      mediaPackage - the optional mediapackage to update
      wfProperties - the optional workflow configuration to update
      caMetadata - the optional capture configuration to update
      allowConflict - the flag to ignore conflict checks
      Throws:
      NotFoundException - if event with specified ID cannot be found
      UnauthorizedException - if the current user is not authorized to perform this action
      SchedulerConflictException - if there are conflicting events
      SchedulerException - if exception occurred
    • removeEvent

      void removeEvent(String mediaPackageId) throws NotFoundException, UnauthorizedException, SchedulerException
      Removes event with specified ID.
      Parameters:
      mediaPackageId - the event identifier
      Throws:
      NotFoundException - if event with specified ID cannot be found
      UnauthorizedException - if the current user is not authorized to perform this action
      SchedulerException - if exception occurred
    • getMediaPackage

      Retrieves mediapackage associated with specified event ID.
      Parameters:
      mediaPackageId - ID of event for which mediapackage will be retrieved
      Returns:
      MediaPackage for specified event
      Throws:
      NotFoundException - if event with specified ID cannot be found
      SchedulerException - if exception occurred
      UnauthorizedException
    • getDublinCore

      Retrieves dublin core catalog associated with specified event ID.
      Parameters:
      mediaPackageId - ID of event for which DublinCore will be retrieved
      Returns:
      DublinCoreCatalog for specified event
      Throws:
      NotFoundException - if event with specified ID cannot be found
      SchedulerException - if exception occurred
      UnauthorizedException
    • getTechnicalMetadata

      Retrieves the technical metadata associated with specified event ID.
      Parameters:
      mediaPackageId - ID of event for which technical metadata will be retrieved
      Returns:
      TechnicalMetadata for specified event
      Throws:
      NotFoundException - if event with specified ID cannot be found
      SchedulerException - if exception occurred
      UnauthorizedException
    • getWorkflowConfig

      Map<String,String> getWorkflowConfig(String mediaPackageId) throws NotFoundException, UnauthorizedException, SchedulerException
      Retrieves workflow configuration associated with specified event ID.
      Parameters:
      mediaPackageId - ID of event for which workflow configuration will be retrieved
      Returns:
      configuration of the workflow
      Throws:
      NotFoundException - if event with specified ID cannot be found
      SchedulerException - if exception occurred
      UnauthorizedException
    • getCaptureAgentConfiguration

      Map<String,String> getCaptureAgentConfiguration(String mediaPackageId) throws NotFoundException, UnauthorizedException, SchedulerException
      Retrieves capture agent configuration for specified event.
      Parameters:
      mediaPackageId - ID of event for which capture agent configuration will be retrieved
      Returns:
      configurations of capture agent
      Throws:
      NotFoundException - if event with specified ID cannot be found
      SchedulerException - if exception occurred
      UnauthorizedException
    • getEventCount

      int getEventCount() throws SchedulerException, UnauthorizedException
      Returns the number of scheduled events.
      Returns:
      the number of scheduled events
      Throws:
      SchedulerException - if exception occurred
      UnauthorizedException
    • search

      List<MediaPackage> 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) throws SchedulerException, UnauthorizedException
      Retrieves all events matching given filter.
      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
      Returns:
      a MediaPackage list of matching events
      Throws:
      SchedulerException - if exception occurred
      UnauthorizedException
    • getCurrentRecording

      com.entwinemedia.fn.data.Opt<MediaPackage> getCurrentRecording(String captureAgentId) throws SchedulerException, UnauthorizedException
      Retrieves the currently active recording for the given capture agent (if any).
      Parameters:
      captureAgentId - The id of the agent to get the current recording of.
      Returns:
      The currently active recording or none, if agent is currently idle
      Throws:
      SchedulerException - In case the current recording cannot be retrieved.
      UnauthorizedException
    • getUpcomingRecording

      com.entwinemedia.fn.data.Opt<MediaPackage> getUpcomingRecording(String captureAgentId) throws SchedulerException, UnauthorizedException
      Retrieves the upcoming recording for the given capture agent (if any).
      Parameters:
      captureAgentId - The id of the agent to get the upcoming recording of.
      Returns:
      The cupcoming recording or none, if there is none.
      Throws:
      SchedulerException - In case the upcoming recording cannot be retrieved.
      UnauthorizedException
    • findConflictingEvents

      List<MediaPackage> findConflictingEvents(String captureDeviceID, Date startDate, Date endDate) throws UnauthorizedException, SchedulerException
      Returns list of all conflicting events, i.e. all events that ends after start date and begins before end date.
      Parameters:
      captureDeviceID - capture device ID for which conflicting events are searched for
      startDate - start date of conflicting period
      endDate - end date of conflicting period
      Returns:
      a MediaPackage list of all conflicting events
      Throws:
      SchedulerException - if exception occurred
      UnauthorizedException
    • findConflictingEvents

      List<MediaPackage> findConflictingEvents(String captureAgentId, net.fortuna.ical4j.model.property.RRule rrule, Date startDate, Date endDate, long duration, TimeZone timezone) throws UnauthorizedException, SchedulerException
      Returns list of all conflicting events. Conflicting periods are calculated based on recurrence rule, start date, end date and duration of each conflicting period.
      Parameters:
      captureAgentId - capture agent ID for which conflicting events are searched for
      rrule - recurrence rule
      startDate - beginning of period
      endDate - ending of period
      duration - duration of each period
      timezone - the time zone of the capture agent
      Returns:
      a MediaPackage list of all conflicting events
      Throws:
      SchedulerException - if exception occurred
      UnauthorizedException
    • getCalendar

      String getCalendar(com.entwinemedia.fn.data.Opt<String> captureAgentId, com.entwinemedia.fn.data.Opt<String> seriesId, com.entwinemedia.fn.data.Opt<Date> cutoff) throws SchedulerException
      Generates calendar for specified capture agent.
      Parameters:
      captureAgentId - capture agent id filter
      seriesId - series id filter
      cutoff - cutoff date filter
      Returns:
      generated calendar
      Throws:
      SchedulerException - if exception occurred
    • getScheduleLastModified

      String getScheduleLastModified(String captureAgentId) throws SchedulerException
      Returns hash of last modification of event belonging to specified capture agent.
      Parameters:
      captureAgentId - the capture agent identifier
      Returns:
      the last modification hash
      Throws:
      SchedulerException - if exception occurred
    • updateRecordingState

      boolean updateRecordingState(String mediaPackageId, String state) throws NotFoundException, SchedulerException
      Updates the state of a recording with the given state, if it exists.
      Parameters:
      mediaPackageId - The id of the recording in the system.
      state - The state to set for that recording. This should be defined from Recording.
      Throws:
      NotFoundException - if the recording with the given id has not been found
      SchedulerException
    • getRecordingState

      Recording getRecordingState(String mediaPackageId) throws NotFoundException, SchedulerException
      Gets the state of a recording, if it exists.
      Parameters:
      mediaPackageId - The id of the recording.
      Returns:
      The state of the recording, or null if it does not exist. This should be defined from Recording.
      Throws:
      NotFoundException - if the recording with the given id has not been found
      SchedulerException
    • removeRecording

      void removeRecording(String mediaPackageId) throws NotFoundException, SchedulerException
      Removes a recording from the system, if the recording exists.
      Parameters:
      mediaPackageId - The id of the recording to remove.
      Throws:
      NotFoundException - if the recording with the given id has not been found
      SchedulerException
    • getKnownRecordings

      Map<String,Recording> getKnownRecordings() throws SchedulerException
      Gets the state of all recordings in the system.
      Returns:
      A map of recording-state pairs.
      Throws:
      SchedulerException
    • removeScheduledRecordingsBeforeBuffer

      void removeScheduledRecordingsBeforeBuffer(long buffer) throws UnauthorizedException, SchedulerException
      Remove all of the scheduled events before a buffer.
      Parameters:
      buffer - The number of seconds before now that defines a cutoff for events, if they have their end time before this cutoff they will be removed
      Throws:
      SchedulerException
      UnauthorizedException