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, 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<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(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(SchedulerService service) Method to set the service this REST endpoint usesvoidsetWorkspace(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(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(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
Method to set the service this REST endpoint uses- Parameters:
service-
-
unsetService
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
Method to set the capture agent state service this REST endpoint uses- Parameters:
agentService-
-
unsetCaptureAgentStateService
Method to unset the capture agent state service this REST endpoint uses- Parameters:
agentService-
-
setWorkspace
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 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:
UnauthorizedException
-
getDublinCoreMetadataXml
@GET @Produces("text/xml") @Path("{id:.+}/dublincore.xml") public javax.ws.rs.core.Response getDublinCoreMetadataXml(@PathParam("id") String eventId) throws 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:
UnauthorizedException
-
getDublinCoreMetadataJSON
@GET @Produces("application/json") @Path("{id:.+}/dublincore.json") public javax.ws.rs.core.Response getDublinCoreMetadataJSON(@PathParam("id") String eventId) throws 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:
UnauthorizedException
-
getTechnicalMetadataJSON
@GET @Produces("text/xml") @Path("{id:.+}/technical.json") public javax.ws.rs.core.Response getTechnicalMetadataJSON(@PathParam("id") String eventId) throws 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:
UnauthorizedException
-
getWorkflowConfiguration
@GET @Produces("text/plain") @Path("{id:.+}/workflow.properties") public javax.ws.rs.core.Response getWorkflowConfiguration(@PathParam("id") String eventId) throws UnauthorizedException Gets the workflow configuration for the specified event.- Parameters:
eventId- The unique ID of the event.- Returns:
- the workflow configuration
- Throws:
UnauthorizedException
-
getCaptureAgentMetadata
@GET @Produces("text/plain") @Path("{id:.+}/agent.properties") public javax.ws.rs.core.Response getCaptureAgentMetadata(@PathParam("id") String eventId) throws 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:
UnauthorizedException
-
deleteEvent
@DELETE @Path("{id:.+}") @Produces("text/plain") public javax.ws.rs.core.Response deleteEvent(@PathParam("id") String eventId) throws 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:
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 UnauthorizedException - Throws:
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 UnauthorizedException Creates new event based on parameters. All times and dates are in milliseconds.- Throws:
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") MediaPackage templateMp, @FormParam("wfproperties") String workflowProperties, @FormParam("agentparameters") String agentParameters, @FormParam("source") String schedulingSource) throws UnauthorizedException Creates new event based on parameters. All times and dates are in milliseconds.- Throws:
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 UnauthorizedException - Throws:
UnauthorizedException
-
currentRecording
@GET @Path("currentRecording/{agent}") @Produces("text/xml") public javax.ws.rs.core.Response currentRecording(@PathParam("agent") String agentId) throws UnauthorizedException - Throws:
UnauthorizedException
-
upcomingRecording
@GET @Path("upcomingRecording/{agent}") @Produces("text/xml") public javax.ws.rs.core.Response upcomingRecording(@PathParam("agent") String agentId) throws UnauthorizedException - Throws:
UnauthorizedException
-
eventCount
@GET @Path("eventCount") @Produces("text/plain") public javax.ws.rs.core.Response eventCount() throws UnauthorizedException- Throws:
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 UnauthorizedException - Throws:
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 UnauthorizedException - Throws:
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 UnauthorizedException - Throws:
UnauthorizedException
-
updateRecordingState
@PUT @Path("{id}/recordingStatus") public javax.ws.rs.core.Response updateRecordingState(@PathParam("id") String id, @FormParam("state") String state) throws NotFoundException - Throws:
NotFoundException
-
getRecordingState
@GET @Produces("application/json") @Path("{id}/recordingStatus") public javax.ws.rs.core.Response getRecordingState(@PathParam("id") String id) throws NotFoundException - Throws:
NotFoundException
-
removeRecording
@DELETE @Path("{id}/recordingStatus") public javax.ws.rs.core.Response removeRecording(@PathParam("id") String id) throws NotFoundException - Throws:
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 NotFoundException Prolonging service- Throws:
NotFoundException
-
upcomingCapture
@GET @Path("capture/{agent}/upcoming") @Produces("application/json") public javax.ws.rs.core.Response upcomingCapture(@PathParam("agent") String agentId) throws NotFoundException - Throws:
NotFoundException
-
startCapture
@POST @Path("capture/{agent}") public javax.ws.rs.core.Response startCapture(@PathParam("agent") String agentId, @FormParam("workflowDefinitionId") String wfId) throws NotFoundException, UnauthorizedException -
stopCapture
@DELETE @Path("capture/{agent}") @Produces("text/plain") public javax.ws.rs.core.Response stopCapture(@PathParam("agent") String agentId) throws NotFoundException, UnauthorizedException -
prolongCapture
@PUT @Path("capture/{agent}/prolong") @Produces("text/plain") public javax.ws.rs.core.Response prolongCapture(@PathParam("agent") String agentId) throws NotFoundException, UnauthorizedException -
getEventListAsJsonString
Serializes mediapackage schedule metadata into JSON array string.- Returns:
- serialized array as json array string
- Throws:
SchedulerException- if parsing list into JSON format fails
-