Class CaptureNowProlongingService
java.lang.Object
org.opencastproject.scheduler.impl.CaptureNowProlongingService
- All Implemented Interfaces:
org.osgi.service.cm.ManagedService
public class CaptureNowProlongingService
extends Object
implements org.osgi.service.cm.ManagedService
Prolong immediate recordings before reaching the end, as long as there are no conflicts
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classQuartz work horse. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) Activates the componentvoiddeactivate(org.osgi.service.component.ComponentContext cc) Deactivates the componentprotected voidfinalize()org.osgi.service.component.ComponentContextgetCurrentRecording(String agentId) Returns the current event for the given capture agent.intReturns the initial time duration (in milliseconds) of a recording started by the CaptureNow serviceintReturns the time duration (in milliseconds) a recording is prolonged by the prolonging job.voidprolongEvent(MediaPackage event, DublinCoreCatalog dublinCore, String agentId) Extends the current recording.voidSet the schedule and start or restart the scheduler.voidsetOrgDirectoryService(OrganizationDirectoryService orgDirectoryService) Sets the organization directory servicevoidsetSchedulerService(SchedulerService schedulerService) Sets the scheduler servicevoidsetSecurityService(SecurityService securityService) Sets the security servicevoidsetServiceRegistry(ServiceRegistry serviceRegistry) Sets the service registryvoidsetWorkspace(Workspace workspace) Sets the workspacevoidshutdown()Shutdown the scheduler.voidvoidupdated(Dictionary<String, ?> properties)
-
Constructor Details
-
CaptureNowProlongingService
public CaptureNowProlongingService()
-
-
Method Details
-
setSchedulerService
Sets the scheduler service -
setSecurityService
Sets the security service -
setServiceRegistry
Sets the service registry -
setOrgDirectoryService
Sets the organization directory service -
setWorkspace
Sets the workspace -
activate
public void activate(org.osgi.service.component.ComponentContext cc) Activates the component- Parameters:
cc- the component's context
-
deactivate
public void deactivate(org.osgi.service.component.ComponentContext cc) Deactivates the component -
updated
public void updated(Dictionary<String, ?> properties) throws org.osgi.service.cm.ConfigurationException- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
schedule
Set the schedule and start or restart the scheduler.- Throws:
org.quartz.SchedulerException
-
stop
-
shutdown
public void shutdown()Shutdown the scheduler. -
finalize
-
getInitialTime
public int getInitialTime()Returns the initial time duration (in milliseconds) of a recording started by the CaptureNow service- Returns:
- the initial time
-
getProlongingTime
public int getProlongingTime()Returns the time duration (in milliseconds) a recording is prolonged by the prolonging job.- Returns:
- the prolonging time
-
getSecurityService
-
getComponentContext
public org.osgi.service.component.ComponentContext getComponentContext() -
getServiceRegistry
-
getOrgDirectoryService
-
getWorkspace
-
getCurrentRecording
public MediaPackage getCurrentRecording(String agentId) throws NotFoundException, UnauthorizedException, SchedulerException Returns the current event for the given capture agent.- Parameters:
agentId- the capture agent- Returns:
- the recording
- Throws:
NotFoundException- if the there is no current recordingUnauthorizedException- if the event cannot be read due to a lack of access rightsSchedulerException- if accessing the scheduling database fails
-
prolongEvent
public void prolongEvent(MediaPackage event, DublinCoreCatalog dublinCore, String agentId) throws UnauthorizedException, NotFoundException, SchedulerException, IllegalArgumentException, IOException Extends the current recording.- Parameters:
event- the recording's media packagedublinCore- the recording's dublin core catalogagentId- the agent- Throws:
UnauthorizedException- if the event cannot be updated due to a lack of access rightsNotFoundException- if the event cannot be foundSchedulerException- if updating the scheduling data failsIOException- if updating the calendar to the worksapce failsIllegalArgumentException- if a URI cannot be created using the arguments provided
-