Class SchedulerRestService
java.lang.Object
org.opencastproject.scheduler.endpoint.SchedulerRestService
REST Endpoint for Scheduler Service
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) The method that will be called, if the service will be activatedjavax.ws.rs.core.ResponseaddEvent(long startTime, long endTime, String agentId, String users, String mediaPackageXml, String workflowProperties, String agentParameters, String schedulingSource) Creates new event based on parameters.javax.ws.rs.core.ResponseaddMultipleEvents(String rruleString, long startTime, long endTime, long duration, String tzString, String agentId, String users, org.opencastproject.mediapackage.MediaPackage templateMp, String workflowProperties, String agentParameters, String schedulingSource) Creates new event based on parameters.javax.ws.rs.core.ResponsecurrentCapture(String agentId) Prolonging servicejavax.ws.rs.core.ResponsecurrentRecording(String agentId) javax.ws.rs.core.ResponsedeleteEvent(String eventId) Removes the specified event.javax.ws.rs.core.Responsejavax.ws.rs.core.Responsejavax.ws.rs.core.ResponsegetCalendar(String captureAgentId, String seriesId, Long cutoff, javax.servlet.http.HttpServletRequest request) Gets the iCalendar with all (even old) events for the specified filter.javax.ws.rs.core.ResponsegetCalendarJson(String captureAgentId, Long cutoff, Boolean timestamp, javax.servlet.http.HttpServletRequest request) javax.ws.rs.core.ResponsegetCaptureAgentMetadata(String eventId) Gets java Properties file with technical metadata for the specified event.javax.ws.rs.core.ResponsegetConflictingEventsJson(String device, String rrule, Long startDate, Long endDate, Long duration, String timezone) javax.ws.rs.core.ResponsegetConflicts(String type, String device, String rrule, Long startDate, Long endDate, Long duration, String timezone) javax.ws.rs.core.ResponsegetDublinCoreMetadataJSON(String eventId) Gets a Dublin Core metadata for the specified event as JSON.javax.ws.rs.core.ResponsegetDublinCoreMetadataXml(String eventId) Gets a XML with the Dublin Core metadata for the specified event.getEventListAsJsonString(List<org.opencastproject.mediapackage.MediaPackage> mpList) Serializes mediapackage schedule metadata into JSON array string.javax.ws.rs.core.ResponsegetEventsAsList(String type, String device, Long startsFromTime, Long startsToTime, Long endsFromTime, Long endsToTime) javax.ws.rs.core.ResponsegetLastModified(String agentId) javax.ws.rs.core.ResponsegetMediaPackageXml(String eventId) Gets a XML with the media package for the specified event.javax.ws.rs.core.Responsejavax.ws.rs.core.ResponsegetTechnicalMetadataJSON(String eventId) Gets a XML with the media package for the specified event.javax.ws.rs.core.ResponsegetWorkflowConfiguration(String eventId) Gets the workflow configuration for the specified event.javax.ws.rs.core.ResponseprolongCapture(String agentId) javax.ws.rs.core.ResponseremoveOldScheduledRecordings(long buffer) javax.ws.rs.core.ResponsevoidsetCaptureAgentStateService(org.opencastproject.capture.admin.api.CaptureAgentStateService agentService) Method to set the capture agent state service this REST endpoint usesvoidsetProlongingService(CaptureNowProlongingService prolongingService) Method to set the prolonging service this REST endpoint usesvoidsetService(org.opencastproject.scheduler.api.SchedulerService service) Method to set the service this REST endpoint usesvoidsetWorkspace(org.opencastproject.workspace.api.Workspace workspace) Method to set the workspace this REST endpoint usesjavax.ws.rs.core.ResponsestartCapture(String agentId, String wfId) javax.ws.rs.core.ResponsestopCapture(String agentId) voidunsetCaptureAgentStateService(org.opencastproject.capture.admin.api.CaptureAgentStateService agentService) Method to unset the capture agent state service this REST endpoint usesvoidunsetProlongingService(CaptureNowProlongingService prolongingService) Method to unset the prolonging service this REST endpoint usesvoidunsetService(org.opencastproject.scheduler.api.SchedulerService service) Method to unset the service this REST endpoint usesjavax.ws.rs.core.ResponseupcomingCapture(String agentId) javax.ws.rs.core.ResponseupcomingRecording(String agentId) javax.ws.rs.core.ResponseupdateEvent(String eventID, Long startTime, Long endTime, String agentId, String users, String mediaPackageXml, String workflowProperties, String agentParameters) javax.ws.rs.core.ResponseupdateRecordingState(String id, String state)
-
Field Details
-
serverUrl
-
serviceUrl
-
-
Constructor Details
-
SchedulerRestService
public SchedulerRestService()
-
-
Method Details
-
setService
public void setService(org.opencastproject.scheduler.api.SchedulerService service) Method to set the service this REST endpoint uses- Parameters:
service-
-
unsetService
public void unsetService(org.opencastproject.scheduler.api.SchedulerService service) Method to unset the service this REST endpoint uses- Parameters:
service-
-
setProlongingService
Method to set the prolonging service this REST endpoint uses- Parameters:
prolongingService-
-
unsetProlongingService
Method to unset the prolonging service this REST endpoint uses- Parameters:
prolongingService-
-
setCaptureAgentStateService
public void setCaptureAgentStateService(org.opencastproject.capture.admin.api.CaptureAgentStateService agentService) Method to set the capture agent state service this REST endpoint uses- Parameters:
agentService-
-
unsetCaptureAgentStateService
public void unsetCaptureAgentStateService(org.opencastproject.capture.admin.api.CaptureAgentStateService agentService) Method to unset the capture agent state service this REST endpoint uses- Parameters:
agentService-
-
setWorkspace
public void setWorkspace(org.opencastproject.workspace.api.Workspace workspace) Method to set the workspace this REST endpoint uses- Parameters:
workspace-
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) The method that will be called, if the service will be activated- Parameters:
cc- The ComponentContext of this service
-
getMediaPackageXml
@GET @Produces("text/xml") @Path("{id:.+}/mediapackage.xml") public javax.ws.rs.core.Response getMediaPackageXml(@PathParam("id") String eventId) throws org.opencastproject.security.api.UnauthorizedException Gets a XML with the media package for the specified event.- Parameters:
eventId- The unique ID of the event.- Returns:
- media package XML for the event
- Throws:
org.opencastproject.security.api.UnauthorizedException
-
getDublinCoreMetadataXml
@GET @Produces("text/xml") @Path("{id:.+}/dublincore.xml") public javax.ws.rs.core.Response getDublinCoreMetadataXml(@PathParam("id") String eventId) throws org.opencastproject.security.api.UnauthorizedException Gets a XML with the Dublin Core metadata for the specified event.- Parameters:
eventId- The unique ID of the event.- Returns:
- Dublin Core XML for the event
- Throws:
org.opencastproject.security.api.UnauthorizedException
-
getDublinCoreMetadataJSON
@GET @Produces("application/json") @Path("{id:.+}/dublincore.json") public javax.ws.rs.core.Response getDublinCoreMetadataJSON(@PathParam("id") String eventId) throws org.opencastproject.security.api.UnauthorizedException Gets a Dublin Core metadata for the specified event as JSON.- Parameters:
eventId- The unique ID of the event.- Returns:
- Dublin Core JSON for the event
- Throws:
org.opencastproject.security.api.UnauthorizedException
-
getTechnicalMetadataJSON
@GET @Produces("text/xml") @Path("{id:.+}/technical.json") public javax.ws.rs.core.Response getTechnicalMetadataJSON(@PathParam("id") String eventId) throws org.opencastproject.security.api.UnauthorizedException Gets a XML with the media package for the specified event.- Parameters:
eventId- The unique ID of the event.- Returns:
- media package XML for the event
- Throws:
org.opencastproject.security.api.UnauthorizedException
-
getWorkflowConfiguration
@GET @Produces("text/plain") @Path("{id:.+}/workflow.properties") public javax.ws.rs.core.Response getWorkflowConfiguration(@PathParam("id") String eventId) throws org.opencastproject.security.api.UnauthorizedException Gets the workflow configuration for the specified event.- Parameters:
eventId- The unique ID of the event.- Returns:
- the workflow configuration
- Throws:
org.opencastproject.security.api.UnauthorizedException
-
getCaptureAgentMetadata
@GET @Produces("text/plain") @Path("{id:.+}/agent.properties") public javax.ws.rs.core.Response getCaptureAgentMetadata(@PathParam("id") String eventId) throws org.opencastproject.security.api.UnauthorizedException Gets java Properties file with technical metadata for the specified event.- Parameters:
eventId- The unique ID of the event.- Returns:
- Java Properties File with the metadata for the event
- Throws:
org.opencastproject.security.api.UnauthorizedException
-
deleteEvent
@DELETE @Path("{id:.+}") @Produces("text/plain") public javax.ws.rs.core.Response deleteEvent(@PathParam("id") String eventId) throws org.opencastproject.security.api.UnauthorizedException Removes the specified event. Returns true if the event was found and could be removed.- Parameters:
eventId- The unique ID of the event.- Returns:
- true if the event was found and could be deleted.
- Throws:
org.opencastproject.security.api.UnauthorizedException
-
getCalendar
@GET @Produces("text/calendar") @Path("calendars") public javax.ws.rs.core.Response getCalendar(@QueryParam("agentid") String captureAgentId, @QueryParam("seriesid") String seriesId, @QueryParam("cutoff") Long cutoff, @Context javax.servlet.http.HttpServletRequest request) Gets the iCalendar with all (even old) events for the specified filter.- Parameters:
captureAgentId- The ID that specifies the capture agent.seriesId- The ID that specifies series.- Returns:
- an iCalendar
-
getCalendarJson
-
getLastModified
@GET @Produces("text/plain") @Path("{id}/lastmodified") public javax.ws.rs.core.Response getLastModified(@PathParam("id") String agentId) -
removeOldScheduledRecordings
@POST @Path("/removeOldScheduledRecordings") public javax.ws.rs.core.Response removeOldScheduledRecordings(@FormParam("buffer") long buffer) throws org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.security.api.UnauthorizedException
-
addEvent
@POST @Path("/") public javax.ws.rs.core.Response addEvent(@FormParam("start") long startTime, @FormParam("end") long endTime, @FormParam("agent") String agentId, @FormParam("users") String users, @FormParam("mediaPackage") String mediaPackageXml, @FormParam("wfproperties") String workflowProperties, @FormParam("agentparameters") String agentParameters, @FormParam("source") String schedulingSource) throws org.opencastproject.security.api.UnauthorizedException Creates new event based on parameters. All times and dates are in milliseconds.- Throws:
org.opencastproject.security.api.UnauthorizedException
-
addMultipleEvents
@POST @Path("/multiple") public javax.ws.rs.core.Response addMultipleEvents(@FormParam("rrule") String rruleString, @FormParam("start") long startTime, @FormParam("end") long endTime, @FormParam("duration") long duration, @FormParam("tz") String tzString, @FormParam("agent") String agentId, @FormParam("users") String users, @FormParam("templateMp") org.opencastproject.mediapackage.MediaPackage templateMp, @FormParam("wfproperties") String workflowProperties, @FormParam("agentparameters") String agentParameters, @FormParam("source") String schedulingSource) throws org.opencastproject.security.api.UnauthorizedException Creates new event based on parameters. All times and dates are in milliseconds.- Throws:
org.opencastproject.security.api.UnauthorizedException
-
updateEvent
@PUT @Path("{id}") public javax.ws.rs.core.Response updateEvent(@PathParam("id") String eventID, @FormParam("start") Long startTime, @FormParam("end") Long endTime, @FormParam("agent") String agentId, @FormParam("users") String users, @FormParam("mediaPackage") String mediaPackageXml, @FormParam("wfproperties") String workflowProperties, @FormParam("agentparameters") String agentParameters) throws org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.security.api.UnauthorizedException
-
currentRecording
@GET @Path("currentRecording/{agent}") @Produces("text/xml") public javax.ws.rs.core.Response currentRecording(@PathParam("agent") String agentId) throws org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.security.api.UnauthorizedException
-
upcomingRecording
@GET @Path("upcomingRecording/{agent}") @Produces("text/xml") public javax.ws.rs.core.Response upcomingRecording(@PathParam("agent") String agentId) throws org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.security.api.UnauthorizedException
-
eventCount
@GET @Path("eventCount") @Produces("text/plain") public javax.ws.rs.core.Response eventCount() throws org.opencastproject.security.api.UnauthorizedException- Throws:
org.opencastproject.security.api.UnauthorizedException
-
getEventsAsList
@GET @Produces({"application/xml","application/json"}) @Path("recordings.{type:xml|json}") public javax.ws.rs.core.Response getEventsAsList(@PathParam("type") String type, @QueryParam("agent") String device, @QueryParam("startsfrom") Long startsFromTime, @QueryParam("startsto") Long startsToTime, @QueryParam("endsfrom") Long endsFromTime, @QueryParam("endsto") Long endsToTime) throws org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.security.api.UnauthorizedException
-
getConflictingEventsJson
@GET @Produces("application/json") @Path("conflicts.json") public javax.ws.rs.core.Response getConflictingEventsJson(@QueryParam("agent") String device, @QueryParam("rrule") String rrule, @QueryParam("start") Long startDate, @QueryParam("end") Long endDate, @QueryParam("duration") Long duration, @QueryParam("timezone") String timezone) throws org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.security.api.UnauthorizedException
-
getConflicts
@GET @Produces({"application/xml","application/json"}) @Path("conflicts.{type:xml|json}") public javax.ws.rs.core.Response getConflicts(@PathParam("type") String type, @QueryParam("agent") String device, @QueryParam("rrule") String rrule, @QueryParam("start") Long startDate, @QueryParam("end") Long endDate, @QueryParam("duration") Long duration, @QueryParam("timezone") String timezone) throws org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.security.api.UnauthorizedException
-
updateRecordingState
@PUT @Path("{id}/recordingStatus") public javax.ws.rs.core.Response updateRecordingState(@PathParam("id") String id, @FormParam("state") String state) throws org.opencastproject.util.NotFoundException - Throws:
org.opencastproject.util.NotFoundException
-
getRecordingState
@GET @Produces("application/json") @Path("{id}/recordingStatus") public javax.ws.rs.core.Response getRecordingState(@PathParam("id") String id) throws org.opencastproject.util.NotFoundException - Throws:
org.opencastproject.util.NotFoundException
-
removeRecording
@DELETE @Path("{id}/recordingStatus") public javax.ws.rs.core.Response removeRecording(@PathParam("id") String id) throws org.opencastproject.util.NotFoundException - Throws:
org.opencastproject.util.NotFoundException
-
getAllRecordings
@GET @Produces("application/json") @Path("recordingStatus") public javax.ws.rs.core.Response getAllRecordings() -
currentCapture
@GET @Path("capture/{agent}") @Produces("application/json") public javax.ws.rs.core.Response currentCapture(@PathParam("agent") String agentId) throws org.opencastproject.util.NotFoundException Prolonging service- Throws:
org.opencastproject.util.NotFoundException
-
upcomingCapture
@GET @Path("capture/{agent}/upcoming") @Produces("application/json") public javax.ws.rs.core.Response upcomingCapture(@PathParam("agent") String agentId) throws org.opencastproject.util.NotFoundException - Throws:
org.opencastproject.util.NotFoundException
-
startCapture
@POST @Path("capture/{agent}") public javax.ws.rs.core.Response startCapture(@PathParam("agent") String agentId, @FormParam("workflowDefinitionId") String wfId) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.security.api.UnauthorizedException
-
stopCapture
@DELETE @Path("capture/{agent}") @Produces("text/plain") public javax.ws.rs.core.Response stopCapture(@PathParam("agent") String agentId) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.security.api.UnauthorizedException
-
prolongCapture
@PUT @Path("capture/{agent}/prolong") @Produces("text/plain") public javax.ws.rs.core.Response prolongCapture(@PathParam("agent") String agentId) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.security.api.UnauthorizedException
-
getEventListAsJsonString
public String getEventListAsJsonString(List<org.opencastproject.mediapackage.MediaPackage> mpList) throws org.opencastproject.scheduler.api.SchedulerException Serializes mediapackage schedule metadata into JSON array string.- Returns:
- serialized array as json array string
- Throws:
org.opencastproject.scheduler.api.SchedulerException- if parsing list into JSON format fails
-