Class SchedulerServiceRemoteImpl
java.lang.Object
org.opencastproject.serviceregistry.api.RemoteBase
org.opencastproject.scheduler.remote.SchedulerServiceRemoteImpl
- All Implemented Interfaces:
SchedulerService
A proxy to a remote series service.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencastproject.serviceregistry.api.RemoteBase
RemoteBase.HttpClientClosingInputStream -
Field Summary
Fields inherited from class org.opencastproject.serviceregistry.api.RemoteBase
client, remoteServiceManager, serviceTypeFields inherited from interface org.opencastproject.scheduler.api.SchedulerService
JOB_TYPE, WORKFLOW_CONFIG_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEvent(Date startDateTime, Date endDateTime, String captureAgentId, Set<String> userIds, MediaPackage mediaPackage, Map<String, String> wfProperties, Map<String, String> caMetadata, Optional<String> schedulingSource) Creates new event using specified mediapackage, workflow configuration and capture agent configuration.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, Optional<String> schedulingSource) Creates a group of new event using specified mediapackage, workflow configuration and capture agent configuration.findConflictingEvents(String captureDeviceID, Date startDate, Date endDate) Returns list of all conflicting events, i.e. all events that ends after start date and begins before end date.findConflictingEvents(String captureAgentId, net.fortuna.ical4j.model.property.RRule rrule, Date startDate, Date endDate, long duration, TimeZone timezone) Returns list of all conflicting events.Generates calendar for specified capture agent.getCaptureAgentConfiguration(String eventId) Retrieves capture agent configuration for specified event.getCurrentRecording(String captureAgentId) Retrieves the currently active recording for the given capture agent (if any).getDublinCore(String eventId) Retrieves dublin core catalog associated with specified event ID.intReturns the number of scheduled events.Gets the state of all recordings in the system.getMediaPackage(String eventId) Retrieves mediapackage associated with specified event ID.Gets the state of a recording, if it exists.getScheduleLastModified(String agentId) Returns hash of last modification of event belonging to specified capture agent.getTechnicalMetadata(String eventId) Retrieves the technical metadata associated with specified event ID.getUpcomingRecording(String captureAgentId) Retrieves the upcoming recording for the given capture agent (if any).getWorkflowConfig(String eventId) Retrieves workflow configuration associated with specified event ID.voidremoveEvent(String eventId) Removes event with specified ID.voidremoveRecording(String eventId) Removes a recording from the system, if the recording exists.voidremoveScheduledRecordingsBeforeBuffer(long buffer) Remove all of the scheduled events before a buffer.search(Optional<String> captureAgentId, Optional<Date> startsFrom, Optional<Date> startsTo, Optional<Date> endFrom, Optional<Date> endTo) Retrieves all events matching given filter.voidsetRemoteServiceManager(ServiceRegistry serviceRegistry) Sets the remote service manager.voidsetTrustedHttpClient(TrustedHttpClient trustedHttpClient) Sets the trusted http clientvoidupdateEvent(String eventId, Optional<Date> startDateTime, Optional<Date> endDateTime, Optional<String> captureAgentId, Optional<Set<String>> userIds, Optional<MediaPackage> mediaPackage, Optional<Map<String, String>> wfProperties, Optional<Map<String, String>> caMetadata) Updates event with specified ID and check for conflicts.voidupdateEvent(String eventId, Optional<Date> startDateTime, Optional<Date> endDateTime, Optional<String> captureAgentId, Optional<Set<String>> userIds, Optional<MediaPackage> mediaPackage, Optional<Map<String, String>> wfProperties, Optional<Map<String, String>> caMetadata, boolean allowConflict) Updates event with specified ID and possibly checking for conflicts.booleanupdateRecordingState(String mediapackageId, String state) Updates the state of a recording with the given state, if it exists.Methods inherited from class org.opencastproject.serviceregistry.api.RemoteBase
closeConnection, elementsFromHttpResponse, getResponse, getResponse, runRequest
-
Constructor Details
-
SchedulerServiceRemoteImpl
public SchedulerServiceRemoteImpl()
-
-
Method Details
-
addEvent
public void addEvent(Date startDateTime, Date endDateTime, String captureAgentId, Set<String> userIds, MediaPackage mediaPackage, Map<String, String> wfProperties, Map<String, throws UnauthorizedException, SchedulerConflictException, SchedulerExceptionString> caMetadata, Optional<String> schedulingSource) Description copied from interface:SchedulerServiceCreates 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)
- Specified by:
addEventin interfaceSchedulerService- 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 iduserIds- the list of user identifiers of speakers/lecturersmediaPackage- the mediapackagewfProperties- the workflow configurationcaMetadata- the capture agent configurationschedulingSource- the optional scheduling source from which the event comes from- Throws:
UnauthorizedException- if the caller is not authorized to take this actionSchedulerConflictException- if there are conflicting eventsSchedulerException- if creating new events failed
-
addMultipleEvents
public 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, throws UnauthorizedException, SchedulerConflictException, SchedulerExceptionString> caMetadata, Optional<String> schedulingSource) Description copied from interface:SchedulerServiceCreates 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)
- Specified by:
addMultipleEventsin interfaceSchedulerService- Parameters:
rRule- theRRulefor the events to schedulestart- the start date for the recurrenceend- the end date for the recurrenceduration- the duration of the eventstz- theTimeZonefor the eventscaptureAgentId- the capture agent iduserIds- the list of user identifiers of speakers/lecturerstemplateMp- the mediapackage to base the events onwfProperties- the workflow configurationcaMetadata- the capture agent configurationschedulingSource- the optional scheduling source from which the event comes from- Returns:
- A
Mapof mediapackage ID andPeriodwhere the event occurs - Throws:
UnauthorizedException- if the caller is not authorized to take this actionSchedulerConflictException- if there are conflicting eventsSchedulerException- if creating new events failed
-
updateEvent
public void updateEvent(String eventId, Optional<Date> startDateTime, Optional<Date> endDateTime, Optional<String> captureAgentId, Optional<Set<String>> userIds, Optional<MediaPackage> mediaPackage, Optional<Map<String, String>> wfProperties, Optional<Map<String, throws NotFoundException, UnauthorizedException, SchedulerConflictException, SchedulerExceptionString>> caMetadata) Description copied from interface:SchedulerServiceUpdates 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)
- Specified by:
updateEventin interfaceSchedulerService- Parameters:
eventId- the optional event identifierstartDateTime- the optional event start timeendDateTime- the optional event end timecaptureAgentId- the optional capture agent iduserIds- the optional list of user identifiers of speakers/lecturersmediaPackage- the optional mediapackage to updatewfProperties- the optional workflow configuration to updatecaMetadata- the optional capture configuration to update- Throws:
NotFoundException- if event with specified ID cannot be foundUnauthorizedException- if the current user is not authorized to perform this actionSchedulerConflictException- if there are conflicting eventsSchedulerException- if exception occurred
-
updateEvent
public void updateEvent(String eventId, Optional<Date> startDateTime, Optional<Date> endDateTime, Optional<String> captureAgentId, Optional<Set<String>> userIds, Optional<MediaPackage> mediaPackage, Optional<Map<String, String>> wfProperties, Optional<Map<String, throws NotFoundException, UnauthorizedException, SchedulerConflictException, SchedulerExceptionString>> caMetadata, boolean allowConflict) Description copied from interface:SchedulerServiceUpdates 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)
- Specified by:
updateEventin interfaceSchedulerService- Parameters:
eventId- the event identifierstartDateTime- the optional event start timeendDateTime- the optional event end timecaptureAgentId- the optional capture agent iduserIds- the optional list of user identifiers of speakers/lecturersmediaPackage- the optional mediapackage to updatewfProperties- the optional workflow configuration to updatecaMetadata- the optional capture configuration to updateallowConflict- the flag to ignore conflict checks- Throws:
NotFoundException- if event with specified ID cannot be foundUnauthorizedException- if the current user is not authorized to perform this actionSchedulerConflictException- if there are conflicting eventsSchedulerException- if exception occurred
-
removeEvent
public void removeEvent(String eventId) throws NotFoundException, UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceRemoves event with specified ID.- Specified by:
removeEventin interfaceSchedulerService- Parameters:
eventId- the event identifier- Throws:
NotFoundException- if event with specified ID cannot be foundUnauthorizedException- if the current user is not authorized to perform this actionSchedulerException- if exception occurred
-
getMediaPackage
public MediaPackage getMediaPackage(String eventId) throws NotFoundException, UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceRetrieves mediapackage associated with specified event ID.- Specified by:
getMediaPackagein interfaceSchedulerService- Parameters:
eventId- ID of event for which mediapackage will be retrieved- Returns:
MediaPackagefor specified event- Throws:
NotFoundException- if event with specified ID cannot be foundSchedulerException- if exception occurredUnauthorizedException
-
getDublinCore
public DublinCoreCatalog getDublinCore(String eventId) throws NotFoundException, UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceRetrieves dublin core catalog associated with specified event ID.- Specified by:
getDublinCorein interfaceSchedulerService- Parameters:
eventId- ID of event for which DublinCore will be retrieved- Returns:
DublinCoreCatalogfor specified event- Throws:
NotFoundException- if event with specified ID cannot be foundSchedulerException- if exception occurredUnauthorizedException
-
getTechnicalMetadata
public TechnicalMetadata getTechnicalMetadata(String eventId) throws NotFoundException, UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceRetrieves the technical metadata associated with specified event ID.- Specified by:
getTechnicalMetadatain interfaceSchedulerService- Parameters:
eventId- ID of event for which technical metadata will be retrieved- Returns:
TechnicalMetadatafor specified event- Throws:
NotFoundException- if event with specified ID cannot be foundSchedulerException- if exception occurredUnauthorizedException
-
getWorkflowConfig
public Map<String,String> getWorkflowConfig(String eventId) throws NotFoundException, UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceRetrieves workflow configuration associated with specified event ID.- Specified by:
getWorkflowConfigin interfaceSchedulerService- Parameters:
eventId- ID of event for which workflow configuration will be retrieved- Returns:
- configuration of the workflow
- Throws:
NotFoundException- if event with specified ID cannot be foundSchedulerException- if exception occurredUnauthorizedException
-
getCaptureAgentConfiguration
public Map<String,String> getCaptureAgentConfiguration(String eventId) throws NotFoundException, UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceRetrieves capture agent configuration for specified event.- Specified by:
getCaptureAgentConfigurationin interfaceSchedulerService- Parameters:
eventId- 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 foundSchedulerException- if exception occurredUnauthorizedException
-
getEventCount
Description copied from interface:SchedulerServiceReturns the number of scheduled events.- Specified by:
getEventCountin interfaceSchedulerService- Returns:
- the number of scheduled events
- Throws:
SchedulerException- if exception occurredUnauthorizedException
-
getScheduleLastModified
Description copied from interface:SchedulerServiceReturns hash of last modification of event belonging to specified capture agent.- Specified by:
getScheduleLastModifiedin interfaceSchedulerService- Parameters:
agentId- the capture agent identifier- Returns:
- the last modification hash
- Throws:
SchedulerException- if exception occurred
-
search
public List<MediaPackage> search(Optional<String> captureAgentId, Optional<Date> startsFrom, Optional<Date> startsTo, Optional<Date> endFrom, Optional<Date> endTo) throws UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceRetrieves all events matching given filter.- Specified by:
searchin interfaceSchedulerService- 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 filter- Returns:
- a
MediaPackagelist of matching events - Throws:
SchedulerException- if exception occurredUnauthorizedException
-
getCurrentRecording
public Optional<MediaPackage> getCurrentRecording(String captureAgentId) throws SchedulerException, UnauthorizedException Description copied from interface:SchedulerServiceRetrieves the currently active recording for the given capture agent (if any).- Specified by:
getCurrentRecordingin interfaceSchedulerService- 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
public Optional<MediaPackage> getUpcomingRecording(String captureAgentId) throws SchedulerException, UnauthorizedException Description copied from interface:SchedulerServiceRetrieves the upcoming recording for the given capture agent (if any).- Specified by:
getUpcomingRecordingin interfaceSchedulerService- 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
public List<MediaPackage> findConflictingEvents(String captureDeviceID, Date startDate, Date endDate) throws UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceReturns list of all conflicting events, i.e. all events that ends after start date and begins before end date.- Specified by:
findConflictingEventsin interfaceSchedulerService- Parameters:
captureDeviceID- capture device ID for which conflicting events are searched forstartDate- start date of conflicting periodendDate- end date of conflicting period- Returns:
- a
MediaPackagelist of all conflicting events - Throws:
SchedulerException- if exception occurredUnauthorizedException
-
findConflictingEvents
public List<MediaPackage> findConflictingEvents(String captureAgentId, net.fortuna.ical4j.model.property.RRule rrule, Date startDate, Date endDate, long duration, TimeZone timezone) throws UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceReturns list of all conflicting events. Conflicting periods are calculated based on recurrence rule, start date, end date and duration of each conflicting period.- Specified by:
findConflictingEventsin interfaceSchedulerService- Parameters:
captureAgentId- capture agent ID for which conflicting events are searched forrrule- recurrence rulestartDate- beginning of periodendDate- ending of periodduration- duration of each periodtimezone- the time zone of the capture agent- Returns:
- a
MediaPackagelist of all conflicting events - Throws:
SchedulerException- if exception occurredUnauthorizedException
-
getCalendar
public String getCalendar(Optional<String> captureAgentId, Optional<String> seriesId, Optional<Date> cutoff) throws SchedulerException Description copied from interface:SchedulerServiceGenerates calendar for specified capture agent.- Specified by:
getCalendarin interfaceSchedulerService- Parameters:
captureAgentId- capture agent id filterseriesId- series id filtercutoff- cutoff date filter- Returns:
- generated calendar
- Throws:
SchedulerException- if exception occurred
-
removeScheduledRecordingsBeforeBuffer
public void removeScheduledRecordingsBeforeBuffer(long buffer) throws UnauthorizedException, SchedulerException Description copied from interface:SchedulerServiceRemove all of the scheduled events before a buffer.- Specified by:
removeScheduledRecordingsBeforeBufferin interfaceSchedulerService- 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:
SchedulerExceptionUnauthorizedException
-
updateRecordingState
public boolean updateRecordingState(String mediapackageId, String state) throws NotFoundException, SchedulerException Description copied from interface:SchedulerServiceUpdates the state of a recording with the given state, if it exists.- Specified by:
updateRecordingStatein interfaceSchedulerService- Parameters:
mediapackageId- The id of the recording in the system.state- The state to set for that recording. This should be defined fromRecording.- Throws:
NotFoundException- if the recording with the given id has not been foundSchedulerException
-
getRecordingState
Description copied from interface:SchedulerServiceGets the state of a recording, if it exists.- Specified by:
getRecordingStatein interfaceSchedulerService- Parameters:
id- 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 foundSchedulerException
-
removeRecording
Description copied from interface:SchedulerServiceRemoves a recording from the system, if the recording exists.- Specified by:
removeRecordingin interfaceSchedulerService- Parameters:
eventId- The id of the recording to remove.- Throws:
NotFoundException- if the recording with the given id has not been foundSchedulerException
-
getKnownRecordings
Description copied from interface:SchedulerServiceGets the state of all recordings in the system.- Specified by:
getKnownRecordingsin interfaceSchedulerService- Returns:
- A map of recording-state pairs.
- Throws:
SchedulerException
-
setTrustedHttpClient
Description copied from class:RemoteBaseSets the trusted http client- Overrides:
setTrustedHttpClientin classRemoteBase- Parameters:
trustedHttpClient-
-
setRemoteServiceManager
Description copied from class:RemoteBaseSets the remote service manager.- Overrides:
setRemoteServiceManagerin classRemoteBase- Parameters:
serviceRegistry-
-