Class EventsEndpoint
java.lang.Object
org.opencastproject.external.endpoint.EventsEndpoint
- All Implemented Interfaces:
org.osgi.service.cm.ManagedService
@Path("/api/events")
@Produces({"application/json","application/v1.0.0+json","application/v1.1.0+json","application/v1.2.0+json","application/v1.3.0+json","application/v1.4.0+json","application/v1.5.0+json","application/v1.6.0+json","application/v1.7.0+json","application/v1.8.0+json","application/v1.9.0+json","application/v1.10.0+json","application/v1.11.0+json"})
public class EventsEndpoint
extends Object
implements org.osgi.service.cm.ManagedService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter) OSGi DI.javax.ws.rs.core.ResponseaddEventAce(String acceptHeader, String id, String action, String role) javax.ws.rs.core.ResponsecreateNewEvent(String acceptHeader, javax.servlet.http.HttpServletRequest request) javax.ws.rs.core.ResponsedeleteEvent(String acceptHeader, String id) javax.ws.rs.core.ResponsedeleteEventAce(String acceptHeader, String id, String action, String role) javax.ws.rs.core.ResponsedeleteEventMetadataByType(String acceptHeader, String id, String type) protected com.google.gson.JsonObjecteventToJSON(org.opencastproject.elasticsearch.index.objects.event.Event event, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean withPublications, Boolean includeInternalPublication, Boolean withSignedUrls, ApiVersion requestedVersion) Transform anEventto Jsonprotected static org.opencastproject.security.api.AccessControlListgetAclFromEvent(org.opencastproject.elasticsearch.index.objects.event.Event event) Get anAccessControlListfrom anEvent.org.opencastproject.capture.admin.api.CaptureAgentStateServiceOSGi DIjavax.ws.rs.core.ResponsegetAllEventMetadata(String acceptHeader, String id, String type) javax.ws.rs.core.ResponsegetEvent(String acceptHeader, String id, boolean sign, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean withPublications, Boolean includeInternalPublication) javax.ws.rs.core.ResponsegetEventAcl(String acceptHeader, String id) List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> getEventCatalogUIAdapters(String organization) javax.ws.rs.core.ResponsegetEventMedia(String acceptHeader, String id) protected Optional<org.opencastproject.metadata.dublincore.MetadataList> getEventMetadata(org.opencastproject.elasticsearch.index.objects.event.Event event) protected Optional<org.opencastproject.metadata.dublincore.MetadataList> javax.ws.rs.core.ResponsegetEventPublication(String acceptHeader, String eventId, String publicationId, boolean sign) javax.ws.rs.core.ResponsegetEventPublications(String acceptHeader, String id, boolean sign, boolean includeInternalPublication) javax.ws.rs.core.ResponsegetEvents(String acceptHeader, String id, String reasonFilter, String resolutionFilter, List<String> filter, String sort, Integer offset, Integer limit, boolean sign, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean onlyWithWriteAccess, Boolean withPublications, Boolean includeInternalPublication) javax.ws.rs.core.ResponsegetEventScheduling(String acceptHeader, String id) protected javax.ws.rs.core.ResponsegetJsonEvents(String acceptHeader, List<org.opencastproject.elasticsearch.index.objects.IndexObject> events, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean withPublications, Boolean includeInternalPublication, Boolean withSignedUrls, ApiVersion requestedVersion) Render a collection ofEvents into a json array.com.google.gson.JsonObjectgetPublication(org.opencastproject.mediapackage.Publication publication, Boolean sign, ApiVersion requestedVersion) org.opencastproject.scheduler.api.SchedulerServiceorg.opencastproject.security.api.SecurityServicestatic <T> booleanisNullOrEmpty(List<String> list) voidremoveCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter) OSGi DI.voidsetAgentStateService(org.opencastproject.capture.admin.api.CaptureAgentStateService agentStateService) OSGi DIvoidsetAssetManager(org.opencastproject.assetmanager.api.AssetManager assetManager) OSGi DIvoidsetIndexService(org.opencastproject.index.service.api.IndexService indexService) OSGi DIvoidsetIngestService(org.opencastproject.ingest.api.IngestService ingestService) OSGi DIvoidsetSchedulerService(org.opencastproject.scheduler.api.SchedulerService schedulerService) voidsetUrlSigningService(org.opencastproject.security.urlsigning.service.UrlSigningService urlSigningService) OSGi DIvoidsetWorkflowService(org.opencastproject.workflow.api.WorkflowService workflowService) OSGi DIvoidupdated(Dictionary<String, ?> properties) OSGi callback if properties file is presentjavax.ws.rs.core.ResponseupdateEventAcl(String acceptHeader, String id, String acl) javax.ws.rs.core.ResponseupdateEventMetadata(String acceptHeader, javax.servlet.http.HttpServletRequest request, String eventId) javax.ws.rs.core.ResponseupdateEventMetadataByType(String acceptHeader, String id, String type, String metadataJSON) javax.ws.rs.core.ResponseupdateEventScheduling(String acceptHeader, String id, String scheduling, boolean allowConflict) javax.ws.rs.core.ResponseupdateFlavorWithTrack(String acceptHeader, String id, javax.servlet.http.HttpServletRequest request)
-
Field Details
-
URL_SIGNING_EXPIRES_DURATION_SECONDS_KEY
- See Also:
-
DEFAULT_URL_SIGNING_EXPIRE_DURATION
The default time before a piece of signed content expires. 2 Hours. -
endpointBaseUrl
Base URL of this endpoint
-
-
Constructor Details
-
EventsEndpoint
public EventsEndpoint()
-
-
Method Details
-
setAssetManager
public void setAssetManager(org.opencastproject.assetmanager.api.AssetManager assetManager) OSGi DI -
setIndexService
public void setIndexService(org.opencastproject.index.service.api.IndexService indexService) OSGi DI -
setIngestService
public void setIngestService(org.opencastproject.ingest.api.IngestService ingestService) OSGi DI -
setUrlSigningService
public void setUrlSigningService(org.opencastproject.security.urlsigning.service.UrlSigningService urlSigningService) OSGi DI -
getSecurityService
public org.opencastproject.security.api.SecurityService getSecurityService() -
getSchedulerService
public org.opencastproject.scheduler.api.SchedulerService getSchedulerService() -
setSchedulerService
public void setSchedulerService(org.opencastproject.scheduler.api.SchedulerService schedulerService) -
addCatalogUIAdapter
public void addCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter) OSGi DI. -
removeCatalogUIAdapter
public void removeCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter) OSGi DI. -
getAgentStateService
public org.opencastproject.capture.admin.api.CaptureAgentStateService getAgentStateService()OSGi DI -
setAgentStateService
public void setAgentStateService(org.opencastproject.capture.admin.api.CaptureAgentStateService agentStateService) OSGi DI -
setWorkflowService
public void setWorkflowService(org.opencastproject.workflow.api.WorkflowService workflowService) OSGi DI -
getEventCatalogUIAdapters
-
updated
public void updated(Dictionary<String, ?> properties) throws org.osgi.service.cm.ConfigurationExceptionOSGi callback if properties file is present- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
isNullOrEmpty
-
getEvent
@GET @Path("{eventId}") public javax.ws.rs.core.Response getEvent(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @QueryParam("sign") boolean sign, @QueryParam("withacl") Boolean withAcl, @QueryParam("withmetadata") Boolean withMetadata, @QueryParam("withscheduling") Boolean withScheduling, @QueryParam("withpublications") Boolean withPublications, @QueryParam("includeInternalPublication") Boolean includeInternalPublication) throws Exception - Throws:
Exception
-
getEventMedia
@GET @Path("{eventId}/media") public javax.ws.rs.core.Response getEventMedia(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id) throws Exception - Throws:
Exception
-
deleteEvent
@DELETE @Path("{eventId}") public javax.ws.rs.core.Response deleteEvent(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id) throws org.opencastproject.elasticsearch.api.SearchIndexException, org.opencastproject.security.api.UnauthorizedException - Throws:
org.opencastproject.elasticsearch.api.SearchIndexExceptionorg.opencastproject.security.api.UnauthorizedException
-
updateEventMetadata
-
createNewEvent
@POST @Path("/") @Consumes("multipart/form-data") public javax.ws.rs.core.Response createNewEvent(@HeaderParam("Accept") String acceptHeader, @Context javax.servlet.http.HttpServletRequest request) -
getEvents
@GET @Path("/") public javax.ws.rs.core.Response getEvents(@HeaderParam("Accept") String acceptHeader, @QueryParam("id") String id, @QueryParam("commentReason") String reasonFilter, @QueryParam("commentResolution") String resolutionFilter, @QueryParam("filter") List<String> filter, @QueryParam("sort") String sort, @QueryParam("offset") Integer offset, @QueryParam("limit") Integer limit, @QueryParam("sign") boolean sign, @QueryParam("withacl") Boolean withAcl, @QueryParam("withmetadata") Boolean withMetadata, @QueryParam("withscheduling") Boolean withScheduling, @QueryParam("onlyWithWriteAccess") Boolean onlyWithWriteAccess, @QueryParam("withpublications") Boolean withPublications, @QueryParam("includeInternalPublication") Boolean includeInternalPublication) -
getJsonEvents
protected javax.ws.rs.core.Response getJsonEvents(String acceptHeader, List<org.opencastproject.elasticsearch.index.objects.IndexObject> events, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean withPublications, Boolean includeInternalPublication, Boolean withSignedUrls, ApiVersion requestedVersion) throws org.opencastproject.index.service.exception.IndexServiceException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.scheduler.api.SchedulerException Render a collection ofEvents into a json array.- Parameters:
acceptHeader- The accept header to return to the client.events- TheListofEvents to render into json.withAcl- Whether to include the events' ACLs.withMetadata- Whether to include the events' metadata.withScheduling- Whether to include the events' scheduling information.withPublications- Whether to include the events' publications.withSignedUrls- Whether to sign the included urls.- Returns:
- A
Responsewith the accept header and body as the Json array ofEvents. - Throws:
org.opencastproject.index.service.exception.IndexServiceExceptionorg.opencastproject.scheduler.api.SchedulerExceptionorg.opencastproject.security.api.UnauthorizedException
-
eventToJSON
protected com.google.gson.JsonObject eventToJSON(org.opencastproject.elasticsearch.index.objects.event.Event event, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean withPublications, Boolean includeInternalPublication, Boolean withSignedUrls, ApiVersion requestedVersion) throws org.opencastproject.index.service.exception.IndexServiceException, org.opencastproject.scheduler.api.SchedulerException, org.opencastproject.security.api.UnauthorizedException Transform anEventto Json- Parameters:
event- The event to transform into jsonwithAcl- Whether to add the acl information for the eventwithMetadata- Whether to add all the metadata for the eventwithScheduling- Whether to add the scheduling information for the eventwithPublications- Whether to add the publicationswithSignedUrls- Whether to sign the urls if they are protected by stream security.- Returns:
- The event in json format.
- Throws:
org.opencastproject.index.service.exception.IndexServiceException- Thrown if unable to get the metadata for the event.org.opencastproject.scheduler.api.SchedulerExceptionorg.opencastproject.security.api.UnauthorizedException
-
getEventAcl
@GET @Path("{eventId}/acl") public javax.ws.rs.core.Response getEventAcl(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id) throws Exception - Throws:
Exception
-
updateEventAcl
@PUT @Path("{eventId}/acl") public javax.ws.rs.core.Response updateEventAcl(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @FormParam("acl") String acl) throws Exception - Throws:
Exception
-
addEventAce
@POST @Path("{eventId}/acl/{action}") public javax.ws.rs.core.Response addEventAce(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @PathParam("action") String action, @FormParam("role") String role) throws Exception - Throws:
Exception
-
deleteEventAce
@DELETE @Path("{eventId}/acl/{action}/{role}") public javax.ws.rs.core.Response deleteEventAce(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @PathParam("action") String action, @PathParam("role") String role) throws Exception - Throws:
Exception
-
getAllEventMetadata
@GET @Path("{eventId}/metadata") public javax.ws.rs.core.Response getAllEventMetadata(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @QueryParam("type") String type) throws Exception - Throws:
Exception
-
getEventMetadataById
protected Optional<org.opencastproject.metadata.dublincore.MetadataList> getEventMetadataById(String id) throws org.opencastproject.index.service.exception.IndexServiceException, Exception - Throws:
org.opencastproject.index.service.exception.IndexServiceExceptionException
-
getEventMetadata
protected Optional<org.opencastproject.metadata.dublincore.MetadataList> getEventMetadata(org.opencastproject.elasticsearch.index.objects.event.Event event) throws org.opencastproject.index.service.exception.IndexServiceException, Exception - Throws:
org.opencastproject.index.service.exception.IndexServiceExceptionException
-
updateEventMetadataByType
@PUT @Path("{eventId}/metadata") public javax.ws.rs.core.Response updateEventMetadataByType(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @QueryParam("type") String type, @FormParam("metadata") String metadataJSON) throws Exception - Throws:
Exception
-
deleteEventMetadataByType
@DELETE @Path("{eventId}/metadata") public javax.ws.rs.core.Response deleteEventMetadataByType(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @QueryParam("type") String type) throws org.opencastproject.elasticsearch.api.SearchIndexException - Throws:
org.opencastproject.elasticsearch.api.SearchIndexException
-
getEventPublications
@GET @Path("{eventId}/publications") public javax.ws.rs.core.Response getEventPublications(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @QueryParam("sign") boolean sign, @QueryParam("includeInternalPublication") boolean includeInternalPublication) throws Exception - Throws:
Exception
-
getPublication
public com.google.gson.JsonObject getPublication(org.opencastproject.mediapackage.Publication publication, Boolean sign, ApiVersion requestedVersion) -
getEventPublication
@GET @Path("{eventId}/publications/{publicationId}") public javax.ws.rs.core.Response getEventPublication(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String eventId, @PathParam("publicationId") String publicationId, @QueryParam("sign") boolean sign) throws Exception - Throws:
Exception
-
getAclFromEvent
protected static org.opencastproject.security.api.AccessControlList getAclFromEvent(org.opencastproject.elasticsearch.index.objects.event.Event event) Get anAccessControlListfrom anEvent.- Parameters:
event- TheEventto get the ACL from.- Returns:
- The
AccessControlListstored in theEvent
-
getEventScheduling
@GET @Path("{eventId}/scheduling") @Produces({"application/json","application/v1.1.0+json","application/v1.2.0+json","application/v1.3.0+json","application/v1.4.0+json","application/v1.5.0+json","application/v1.6.0+json","application/v1.7.0+json","application/v1.8.0+json","application/v1.9.0+json","application/v1.10.0+json","application/v1.11.0+json"}) public javax.ws.rs.core.Response getEventScheduling(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id) throws Exception - Throws:
Exception
-
updateEventScheduling
@PUT @Path("{eventId}/scheduling") @Produces({"application/json","application/v1.1.0+json","application/v1.2.0+json","application/v1.3.0+json","application/v1.4.0+json","application/v1.5.0+json","application/v1.6.0+json","application/v1.7.0+json","application/v1.8.0+json","application/v1.9.0+json","application/v1.10.0+json","application/v1.11.0+json"}) public javax.ws.rs.core.Response updateEventScheduling(@HeaderParam("Accept") String acceptHeader, @PathParam("eventId") String id, @FormParam("scheduling") String scheduling, @FormParam("allowConflict") @DefaultValue("false") boolean allowConflict) throws Exception - Throws:
Exception
-
updateFlavorWithTrack
-