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(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.entwinemedia.fn.data.json.JValueeventToJSON(Event event, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean withPublications, Boolean includeInternalPublication, Boolean withSignedUrls, ApiVersion requestedVersion) Transform anEventto Jsonprotected static AccessControlListgetAclFromEvent(Event event) Get anAccessControlListfrom anEvent.OSGi 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) getEventCatalogUIAdapters(String organization) javax.ws.rs.core.ResponsegetEventMedia(String acceptHeader, String id) protected com.entwinemedia.fn.data.Opt<MetadataList> getEventMetadata(Event event) protected com.entwinemedia.fn.data.Opt<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<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.entwinemedia.fn.data.json.JObjectgetPublication(Publication publication, Boolean sign, ApiVersion requestedVersion) static <T> booleanisNullOrEmpty(List<String> list) voidremoveCatalogUIAdapter(EventCatalogUIAdapter catalogUIAdapter) OSGi DI.voidsetAgentStateService(CaptureAgentStateService agentStateService) OSGi DIvoidsetAssetManager(AssetManager assetManager) OSGi DIvoidsetIndexService(IndexService indexService) OSGi DIvoidsetIngestService(IngestService ingestService) OSGi DIvoidsetSchedulerService(SchedulerService schedulerService) voidsetUrlSigningService(UrlSigningService urlSigningService) OSGi DIvoidsetWorkflowService(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
OSGi DI -
setIndexService
OSGi DI -
setIngestService
OSGi DI -
setUrlSigningService
OSGi DI -
getSecurityService
-
getSchedulerService
-
setSchedulerService
-
addCatalogUIAdapter
OSGi DI. -
removeCatalogUIAdapter
OSGi DI. -
getAgentStateService
OSGi DI -
setAgentStateService
OSGi DI -
setWorkflowService
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 SearchIndexException, 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<IndexObject> events, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean withPublications, Boolean includeInternalPublication, Boolean withSignedUrls, ApiVersion requestedVersion) throws IndexServiceException, UnauthorizedException, 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:
IndexServiceExceptionSchedulerExceptionUnauthorizedException
-
eventToJSON
protected com.entwinemedia.fn.data.json.JValue eventToJSON(Event event, Boolean withAcl, Boolean withMetadata, Boolean withScheduling, Boolean withPublications, Boolean includeInternalPublication, Boolean withSignedUrls, ApiVersion requestedVersion) throws IndexServiceException, SchedulerException, 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:
IndexServiceException- Thrown if unable to get the metadata for the event.SchedulerExceptionUnauthorizedException
-
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 com.entwinemedia.fn.data.Opt<MetadataList> getEventMetadataById(String id) throws IndexServiceException, Exception - Throws:
IndexServiceExceptionException
-
getEventMetadata
protected com.entwinemedia.fn.data.Opt<MetadataList> getEventMetadata(Event event) throws IndexServiceException, Exception - Throws:
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 SearchIndexException - Throws:
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.entwinemedia.fn.data.json.JObject getPublication(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
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
-