Interface IndexService
- All Known Implementing Classes:
IndexServiceImpl
public interface IndexService
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptioncreateEvent(javax.servlet.http.HttpServletRequest request) Creates a new event based on a request.createEvent(EventHttpServletRequest eventHttpServletRequest) Create a new event using aEventHttpServletRequest.createSeries(org.json.simple.JSONObject metadata) Create a new series.createSeries(org.opencastproject.metadata.dublincore.MetadataList metadataList, Map<String, String> options, Optional<org.opencastproject.security.api.AccessControlList> optAcl, Optional<Long> optThemeId) Create a series from a set of metadata and options.org.opencastproject.metadata.dublincore.EventCatalogUIAdapterorg.opencastproject.metadata.dublincore.SeriesCatalogUIAdapterOptional<org.opencastproject.elasticsearch.index.objects.event.Event> Get a single eventList<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> org.opencastproject.mediapackage.MediaPackagegetEventMediapackage(org.opencastproject.elasticsearch.index.objects.event.Event event) getEventSource(org.opencastproject.elasticsearch.index.objects.event.Event event) getEventWorkflowProperties(List<String> eventIds) List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> org.opencastproject.metadata.dublincore.MetadataListorg.opencastproject.metadata.dublincore.MetadataListList<org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter> voidremoveCatalogByFlavor(org.opencastproject.elasticsearch.index.objects.event.Event event, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor) Remove catalogs from the event with the given flavor.voidremoveCatalogByFlavor(org.opencastproject.elasticsearch.index.objects.series.Series series, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor) Remove a catalog from the series that matches the given flavor.booleanremoveEvent(String id) Removes an event.removeEvent(org.opencastproject.elasticsearch.index.objects.event.Event event, String retractWorkflowId) Removes an event and retracts it if necessary.voidremoveSeries(String id) Remove a series.org.opencastproject.metadata.dublincore.MetadataListupdateAllEventMetadata(String id, String metadataJSON, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) Update the event metadata in all available catalogs.org.opencastproject.metadata.dublincore.MetadataListupdateAllSeriesMetadata(String id, String metadataJSON, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) Update the series metadata in all available catalogs.org.opencastproject.metadata.dublincore.MetadataListupdateAllSeriesMetadata(String id, org.opencastproject.metadata.dublincore.MetadataList metadataList, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) Update the series metadata in all available catalogs by providing a completeMetadataListvoidupdateCommentCatalog(org.opencastproject.elasticsearch.index.objects.event.Event event, List<org.opencastproject.event.comment.EventComment> comments) org.opencastproject.security.api.AccessControlListupdateEventAcl(String id, org.opencastproject.security.api.AccessControlList acl, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) Update the event'sAccessControlList.updateEventAssets(org.opencastproject.mediapackage.MediaPackage mp, javax.servlet.http.HttpServletRequest request) Create or Update an existing event asset.org.opencastproject.metadata.dublincore.MetadataListupdateEventMetadata(String id, org.opencastproject.metadata.dublincore.MetadataList metadataList, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) Update an event's metadata using aMetadataList
-
Method Details
-
getEvent
Optional<org.opencastproject.elasticsearch.index.objects.event.Event> getEvent(String id, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws org.opencastproject.elasticsearch.api.SearchIndexException Get a single event- Parameters:
id- the mediapackage idindex- The index to get the event from.- Returns:
- an event or none if not found wrapped in an option
- Throws:
org.opencastproject.elasticsearch.api.SearchIndexException- Thrown if the index cannot be read
-
createEvent
String createEvent(javax.servlet.http.HttpServletRequest request) throws IndexServiceException, IllegalArgumentException, UnsupportedAssetException Creates a new event based on a request.- Parameters:
request- The request containing the data to create the event.- Returns:
- The event's id (or a comma seperated list of event ids if it was a group of events)
- Throws:
IndexServiceException- Thrown if there was an internal server error while creating the event.IllegalArgumentException- Thrown if the provided request was inappropriate.UnsupportedAssetException- Thrown if the provided asset file type is not accepted.
-
createEvent
String createEvent(EventHttpServletRequest eventHttpServletRequest) throws ParseException, IOException, org.opencastproject.mediapackage.MediaPackageException, org.opencastproject.ingest.api.IngestException, org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException, org.opencastproject.security.api.UnauthorizedException Create a new event using aEventHttpServletRequest.- Parameters:
eventHttpServletRequest- TheEventHttpServletRequestcontaining all of the necessary information to create a new event.- Returns:
- The id or ids created by the
EventHttpServletRequest. - Throws:
ParseException- Thrown if unable to parse the start and end UTC date and time.IOException- Thrown if unable to update the event's DublinCoreCatalogorg.opencastproject.mediapackage.MediaPackageException- Thrown if unable to update the event'sMediaPackageorg.opencastproject.ingest.api.IngestException- Thrown if unable to update the ingest service with the new Event.org.opencastproject.util.NotFoundException- Thrown if the specified workflow definition cannot be found.org.opencastproject.scheduler.api.SchedulerException- Thrown if unable to schedule the new event.org.opencastproject.security.api.UnauthorizedException- Thrown if the current user is unable to create the new event.
-
removeEvent
IndexService.EventRemovalResult removeEvent(org.opencastproject.elasticsearch.index.objects.event.Event event, String retractWorkflowId) throws org.opencastproject.security.api.UnauthorizedException, org.opencastproject.workflow.api.WorkflowDatabaseException, org.opencastproject.util.NotFoundException Removes an event and retracts it if necessary.- Parameters:
event- The event to remove.retractWorkflowId- The id of the workflow to use to retract the event if necessary.- Returns:
- A result which tells if the event was removed, removal failed, or the event is being retracted and will be removed later.
- Throws:
org.opencastproject.security.api.UnauthorizedException- Thrown if the action is unauthorizedorg.opencastproject.workflow.api.WorkflowDatabaseException- Thrown if the workflow database is not reachable. This may be a temporary problem.org.opencastproject.util.NotFoundException- If the configured retract workflow cannot be found. This is most likely a configuration issue.
-
removeEvent
boolean removeEvent(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException Removes an event.- Parameters:
id- The id for the event to remove.- Returns:
- true if the event was found and removed.
- Throws:
org.opencastproject.util.NotFoundException- Thrown if the group was not foundorg.opencastproject.security.api.UnauthorizedException- Thrown if the action is unauthorized
-
updateEventAssets
String updateEventAssets(org.opencastproject.mediapackage.MediaPackage mp, javax.servlet.http.HttpServletRequest request) throws ParseException, IOException, org.opencastproject.mediapackage.MediaPackageException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException, IndexServiceException, UnsupportedAssetException Create or Update an existing event asset. The request contains a JSON describing asset type, flavor, subflavor, the mpId, a workflow description id to initiate on the event, and the asset file streams in a multipart form. Existing type-flavor matches are updated, otherwise the asset is added.- Parameters:
mp- The mediapackage to updaterequest- The http servlet request containing metadata, workflow id, and file streams- Returns:
- the workflow instance id that was started
- Throws:
ParseException- Thrown if unable to parse the start and end UTC date and time.IOException- Thrown if unable to update the event's DublinCoreCatalogorg.opencastproject.mediapackage.MediaPackageException- Thrown if unable to update the event'sMediaPackageorg.opencastproject.util.NotFoundException- Thrown if the specified workflow definition cannot be found.org.opencastproject.security.api.UnauthorizedException- Thrown if the current user is unable to create the new event.IndexServiceException- Thrown if the update assets workflow cannot be startedUnsupportedAssetException- Thrown if the provided asset file type is not accepted.
-
updateEventMetadata
org.opencastproject.metadata.dublincore.MetadataList updateEventMetadata(String id, org.opencastproject.metadata.dublincore.MetadataList metadataList, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws IndexServiceException, org.opencastproject.elasticsearch.api.SearchIndexException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException Update an event's metadata using aMetadataList- Parameters:
id- The id of the event.metadataList- TheMetadataListwith the new metadata.index- The index used to process this update.- Returns:
- The
MetadataListwith the updated fields. - Throws:
IndexServiceException- Thrown if unable to update the event with the index.org.opencastproject.elasticsearch.api.SearchIndexException- Thrown if there was a problem getting the event.org.opencastproject.util.NotFoundException- Thrown if unable to find the event.org.opencastproject.security.api.UnauthorizedException- Thrown if the current user is unable to edit the event.
-
updateAllEventMetadata
org.opencastproject.metadata.dublincore.MetadataList updateAllEventMetadata(String id, String metadataJSON, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws IllegalArgumentException, IndexServiceException, org.opencastproject.elasticsearch.api.SearchIndexException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException Update the event metadata in all available catalogs.- Parameters:
id- The id of the event to update.metadataJSON- The metadata to update in json format.index- The index to update the event in.- Returns:
- A metadata list of the updated fields.
- Throws:
IllegalArgumentException- Thrown if the metadata was not formatted correctly.IndexServiceException- Thrown if there was an error updating the event.org.opencastproject.elasticsearch.api.SearchIndexException- Thrown if there was an error searching the search index.org.opencastproject.util.NotFoundException- Thrown if theEventcould not be found.org.opencastproject.security.api.UnauthorizedException- Thrown if the current user is unable to update the event.
-
removeCatalogByFlavor
void removeCatalogByFlavor(org.opencastproject.elasticsearch.index.objects.event.Event event, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor) throws IndexServiceException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException Remove catalogs from the event with the given flavor.- Parameters:
event- The event who will have the catalog removed.flavor- The flavor to use to find the catalogs.- Throws:
IndexServiceException- Thrown if there was a problem getting the catalog for the event.org.opencastproject.util.NotFoundException- Thrown if unable to find a catalog that matches the flavor.org.opencastproject.security.api.UnauthorizedException- Thrown if the action is unauthorized.
-
updateEventAcl
org.opencastproject.security.api.AccessControlList updateEventAcl(String id, org.opencastproject.security.api.AccessControlList acl, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws IllegalArgumentException, IndexServiceException, org.opencastproject.elasticsearch.api.SearchIndexException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException Update the event'sAccessControlList.- Parameters:
id- The id of the event to update.acl- TheAccessControlListthat this event will get updated with.index- The index to update the event in.- Returns:
- The updated
AccessControlList. - Throws:
IllegalArgumentException- Thrown if the event is currently processing as a workflow so unable to update the ACL as we may have already distributed it.IndexServiceException- Thrown if there was a problem updating the ACL for an event.org.opencastproject.elasticsearch.api.SearchIndexException- Thrown if there was an error searching the search index.org.opencastproject.util.NotFoundException- Thrown if the event cannot be found to update.org.opencastproject.security.api.UnauthorizedException- Thrown if the action is unauthorized.
-
getEventMediapackage
org.opencastproject.mediapackage.MediaPackage getEventMediapackage(org.opencastproject.elasticsearch.index.objects.event.Event event) throws IndexServiceException - Throws:
IndexServiceException
-
getEventSource
IndexService.Source getEventSource(org.opencastproject.elasticsearch.index.objects.event.Event event) -
updateCommentCatalog
void updateCommentCatalog(org.opencastproject.elasticsearch.index.objects.event.Event event, List<org.opencastproject.event.comment.EventComment> comments) throws Exception - Throws:
Exception
-
getMetadataListWithAllSeriesCatalogUIAdapters
org.opencastproject.metadata.dublincore.MetadataList getMetadataListWithAllSeriesCatalogUIAdapters() -
getMetadataListWithAllEventCatalogUIAdapters
org.opencastproject.metadata.dublincore.MetadataList getMetadataListWithAllEventCatalogUIAdapters() -
getEventCatalogUIAdapters
List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> getEventCatalogUIAdapters()- Returns:
- A
ListofEventCatalogUIAdapterthat provide the metadata to the front end.
-
getExtendedEventCatalogUIAdapters
List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> getExtendedEventCatalogUIAdapters()- Returns:
- A
Listof extendedEventCatalogUIAdapterthat provide the metadata to the front end. Does not contain the commonEventCatalogUIAdapter.
-
getCommonEventCatalogUIAdapter
org.opencastproject.metadata.dublincore.EventCatalogUIAdapter getCommonEventCatalogUIAdapter()- Returns:
- the common
EventCatalogUIAdapter
-
createSeries
String createSeries(org.json.simple.JSONObject metadata) throws IllegalArgumentException, IndexServiceException, org.opencastproject.security.api.UnauthorizedException Create a new series.- Parameters:
metadata- The json metadata to create the new series.- Returns:
- The series id.
- Throws:
IllegalArgumentException- Thrown if the metadata is incomplete or malformed.IndexServiceException- Thrown if there are issues with processing the request.org.opencastproject.security.api.UnauthorizedException- Thrown if the user cannot create a new series.
-
createSeries
String createSeries(org.opencastproject.metadata.dublincore.MetadataList metadataList, Map<String, String> options, Optional<org.opencastproject.security.api.AccessControlList> optAcl, Optional<Long> optThemeId) throws IndexServiceExceptionCreate a series from a set of metadata and options.- Parameters:
metadataList- The metadata for the seriesoptions- Options for the seriesoptAcl- ACLs for the seriesoptThemeId- Themes for the series- Returns:
- The series id.
- Throws:
IndexServiceException- Thrown if there are issues with processing the request.
-
removeSeries
void removeSeries(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.series.api.SeriesException, org.opencastproject.security.api.UnauthorizedException Remove a series.- Parameters:
id- The id of the series to remove.- Throws:
org.opencastproject.util.NotFoundException- Thrown if the series is not foundorg.opencastproject.series.api.SeriesException- Thrown if an error removing the seriesorg.opencastproject.security.api.UnauthorizedException- Thrown if the activity is unauthorized
-
getCommonSeriesCatalogUIAdapter
org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter getCommonSeriesCatalogUIAdapter()- Returns:
- the common
SeriesCatalogUIAdapter
-
getSeriesCatalogUIAdapters
List<org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter> getSeriesCatalogUIAdapters()- Returns:
- A
ListofSeriesCatalogUIAdapterthat provide the metadata to the front end.
-
updateAllSeriesMetadata
org.opencastproject.metadata.dublincore.MetadataList updateAllSeriesMetadata(String id, String metadataJSON, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws IllegalArgumentException, IndexServiceException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException Update the series metadata in all available catalogs.- Parameters:
id- The id of the series to update.metadataJSON- The metadata to update in json format.index- The index to update the series in.- Returns:
- A metadata list of the updated fields.
- Throws:
IllegalArgumentException- Thrown if the metadata was not formatted correctly.IndexServiceException- Thrown if there was an error updating the event.org.opencastproject.util.NotFoundException- Thrown if theEventcould not be found.org.opencastproject.security.api.UnauthorizedException- Thrown if the current user is unable to update the event.
-
updateAllSeriesMetadata
org.opencastproject.metadata.dublincore.MetadataList updateAllSeriesMetadata(String id, org.opencastproject.metadata.dublincore.MetadataList metadataList, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws IndexServiceException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException Update the series metadata in all available catalogs by providing a completeMetadataList- Parameters:
id- The id of the seriesmetadataList- The completeMetadataListindex- The index that will be used to find the series.- Returns:
- The updated
MetadataList - Throws:
IndexServiceException- Thrown if unable to query the index for the series.org.opencastproject.util.NotFoundException- Thrown if unable to find the series to update the metadata for.org.opencastproject.security.api.UnauthorizedException- Thrown if the user is unable to update the series.
-
removeCatalogByFlavor
void removeCatalogByFlavor(org.opencastproject.elasticsearch.index.objects.series.Series series, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor) throws IndexServiceException, org.opencastproject.util.NotFoundException Remove a catalog from the series that matches the given flavor.- Parameters:
series- The series to remove the catalog from.flavor- The flavor that will match the catalog.- Throws:
IndexServiceException- Thrown if there was an error reading the given event.org.opencastproject.util.NotFoundException- Thrown if the catalog cannot be found.
-
getEventWorkflowProperties
-