Interface SchedulerServiceDatabase
- All Known Implementing Classes:
SchedulerServiceDatabaseImpl
public interface SchedulerServiceDatabase
Permanent storage for events. Does not support searching.
-
Method Summary
Modifier and TypeMethodDescriptionintRetrieve the number of events.voiddeleteEvent(String mediapackageId) Removes the extended event from persistent storage.Get the event with the given mediapackage id for the current organization.Get the event with the given mediapackage id and organization.Get all events from the scheduler for the current organizations.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.getLastModified(String agentId) Get the last modification date by an agent identifierGet aMapof last modification dates of all existing capture agents.voidresetRecordingState(String mediapackageId) Nulls recording state and recording last heard of of the given media package.search(Optional<String> captureAgentId, Optional<Date> startsFrom, Optional<Date> startsTo, Optional<Date> endFrom, Optional<Date> endTo, Optional<Integer> limit) Retrieve all events matching given filter ordered by start time ascending.voidstoreEvent(String mediapackageId, String organizationId, Optional<String> captureAgentId, Optional<Date> start, Optional<Date> end, Optional<String> source, Optional<String> recordingState, Optional<Long> recordingLastHeard, Optional<String> presenters, Optional<Date> lastModifiedDate, Optional<String> checksum, Optional<Map<String, String>> workflowProperties, Optional<Map<String, String>> captureAgentProperties) Create or update an event identified by mediapackageId and organizationIdvoidtouchLastEntry(String agentId) Touches the most recent entry by updating its last modification date.
-
Method Details
-
touchLastEntry
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 foundSchedulerServiceDatabaseException- if exception occurred
-
getLastModifiedDates
Get aMapof 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, Optional<String> captureAgentId, Optional<Date> start, Optional<Date> end, Optional<String> source, Optional<String> recordingState, Optional<Long> recordingLastHeard, Optional<String> presenters, Optional<Date> lastModifiedDate, Optional<String> checksum, Optional<Map<String, String>> workflowProperties, Optional<Map<String, throws SchedulerServiceDatabaseExceptionString>> captureAgentProperties) Create or update an event identified by mediapackageId and organizationId- Parameters:
mediapackageId- the mediapackage IDorganizationId- the organization ID of the organization owning the eventcaptureAgentId- the capture agent ID of the capture agent this event is scheduled onstart- the recording start timeend- the recording end timesource- the sourcerecordingState- the recording staterecordingLastHeard- the recording last heardpresenters- the presenterslastModifiedDate- the last modified datechecksum- the checksumworkflowProperties- the workflow propertiescaptureAgentProperties- 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 checkstart- the start date of the interval to checkend- the end date of the interval to checkseparationMillis- 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(Optional<String> captureAgentId, Optional<Date> startsFrom, Optional<Date> startsTo, Optional<Date> endFrom, Optional<Date> endTo, Optional<Integer> limit) throws SchedulerServiceDatabaseException Retrieve all events matching given filter ordered by start time ascending.- Parameters:
captureAgentId- the capture agent id filterstartsFrom- the start from date filterstartsTo- the start to date filterendFrom- the end from date filterendTo- the end to date filterlimit- 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 IDSchedulerServiceDatabaseException- if exception occurred
-
getEvent
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
Optional<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 fororgId- 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 IDSchedulerServiceDatabaseException- If the database cannot be queried.
-
countEvents
Retrieve the number of events.- Returns:
- The number of events.
- Throws:
SchedulerServiceDatabaseException- If the database cannot be queried.
-