Interface IndexService

All Known Implementing Classes:
IndexServiceImpl

public interface IndexService
  • 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 id
      index - 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 a EventHttpServletRequest.
      Parameters:
      eventHttpServletRequest - The EventHttpServletRequest containing 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 DublinCoreCatalog
      org.opencastproject.mediapackage.MediaPackageException - Thrown if unable to update the event's MediaPackage
      org.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 unauthorized
      org.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 found
      org.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 update
      request - 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 DublinCoreCatalog
      org.opencastproject.mediapackage.MediaPackageException - Thrown if unable to update the event's MediaPackage
      org.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 started
      UnsupportedAssetException - 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 a MetadataList
      Parameters:
      id - The id of the event.
      metadataList - The MetadataList with the new metadata.
      index - The index used to process this update.
      Returns:
      The MetadataList with 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 the Event could 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's AccessControlList.
      Parameters:
      id - The id of the event to update.
      acl - The AccessControlList that 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 List of EventCatalogUIAdapter that provide the metadata to the front end.
    • getExtendedEventCatalogUIAdapters

      List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> getExtendedEventCatalogUIAdapters()
      Returns:
      A List of extended EventCatalogUIAdapter that provide the metadata to the front end. Does not contain the common EventCatalogUIAdapter.
    • 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 IndexServiceException
      Create a series from a set of metadata and options.
      Parameters:
      metadataList - The metadata for the series
      options - Options for the series
      optAcl - ACLs for the series
      optThemeId - 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 found
      org.opencastproject.series.api.SeriesException - Thrown if an error removing the series
      org.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 List of SeriesCatalogUIAdapter that 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 the Event could 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 complete MetadataList
      Parameters:
      id - The id of the series
      metadataList - The complete MetadataList
      index - 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

      Map<String,Map<String,String>> getEventWorkflowProperties(List<String> eventIds)