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.ComponentContextorg.opencastproject.mediapackage.MediaPackagegetCurrentRecording(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 serviceorg.opencastproject.security.api.OrganizationDirectoryServiceintReturns the time duration (in milliseconds) a recording is prolonged by the prolonging job.org.opencastproject.security.api.SecurityServiceorg.opencastproject.serviceregistry.api.ServiceRegistryorg.opencastproject.workspace.api.WorkspacevoidprolongEvent(org.opencastproject.mediapackage.MediaPackage event, org.opencastproject.metadata.dublincore.DublinCoreCatalog dublinCore, String agentId) Extends the current recording.voidSet the schedule and start or restart the scheduler.voidsetOrgDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService orgDirectoryService) Sets the organization directory servicevoidsetSchedulerService(org.opencastproject.scheduler.api.SchedulerService schedulerService) Sets the scheduler servicevoidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) Sets the security servicevoidsetServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) Sets the service registryvoidsetWorkspace(org.opencastproject.workspace.api.Workspace workspace) Sets the workspacevoidshutdown()Shutdown the scheduler.voidvoidupdated(Dictionary<String, ?> properties)
-
Constructor Details
-
CaptureNowProlongingService
public CaptureNowProlongingService()
-
-
Method Details
-
setSchedulerService
public void setSchedulerService(org.opencastproject.scheduler.api.SchedulerService schedulerService) Sets the scheduler service -
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) Sets the security service -
setServiceRegistry
public void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) Sets the service registry -
setOrgDirectoryService
public void setOrgDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService orgDirectoryService) Sets the organization directory service -
setWorkspace
public void setWorkspace(org.opencastproject.workspace.api.Workspace workspace) 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
public org.opencastproject.security.api.SecurityService getSecurityService() -
getComponentContext
public org.osgi.service.component.ComponentContext getComponentContext() -
getServiceRegistry
public org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry() -
getOrgDirectoryService
public org.opencastproject.security.api.OrganizationDirectoryService getOrgDirectoryService() -
getWorkspace
public org.opencastproject.workspace.api.Workspace getWorkspace() -
getCurrentRecording
public org.opencastproject.mediapackage.MediaPackage getCurrentRecording(String agentId) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.scheduler.api.SchedulerException Returns the current event for the given capture agent.- Parameters:
agentId- the capture agent- Returns:
- the recording
- Throws:
org.opencastproject.util.NotFoundException- if the there is no current recordingorg.opencastproject.security.api.UnauthorizedException- if the event cannot be read due to a lack of access rightsorg.opencastproject.scheduler.api.SchedulerException- if accessing the scheduling database fails
-
prolongEvent
public void prolongEvent(org.opencastproject.mediapackage.MediaPackage event, org.opencastproject.metadata.dublincore.DublinCoreCatalog dublinCore, String agentId) throws org.opencastproject.security.api.UnauthorizedException, org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException, IllegalArgumentException, IOException Extends the current recording.- Parameters:
event- the recording's media packagedublinCore- the recording's dublin core catalogagentId- the agent- Throws:
org.opencastproject.security.api.UnauthorizedException- if the event cannot be updated due to a lack of access rightsorg.opencastproject.util.NotFoundException- if the event cannot be foundorg.opencastproject.scheduler.api.SchedulerException- if updating the scheduling data failsIOException- if updating the calendar to the worksapce failsIllegalArgumentException- if a URI cannot be created using the arguments provided
-