Class IndexServiceImpl

java.lang.Object
org.opencastproject.index.service.impl.IndexServiceImpl
All Implemented Interfaces:
IndexService

public class IndexServiceImpl extends Object implements IndexService
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.opencastproject.index.service.api.IndexService

    IndexService.EventRemovalResult, IndexService.Source, IndexService.SourceType
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(org.osgi.service.component.ComponentContext cc)
     
    void
    addCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter)
    OSGi callback to add EventCatalogUIAdapter instance.
    void
    addCatalogUIAdapter(org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter catalogUIAdapter)
    OSGi callback to add SeriesCatalogUIAdapter instance.
    createEvent(javax.servlet.http.HttpServletRequest request)
    Creates a new event based on a request.
    createEvent(org.json.simple.JSONObject metadataJson, org.opencastproject.mediapackage.MediaPackage mp)
     
    createEvent(EventHttpServletRequest eventHttpServletRequest)
    Create a new event using a EventHttpServletRequest.
    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.
    void
    deactivate(org.osgi.service.component.ComponentContext cc)
     
    org.opencastproject.authorization.xacml.manager.api.AclService
     
    org.opencastproject.metadata.dublincore.EventCatalogUIAdapter
     
    org.opencastproject.metadata.dublincore.EventCatalogUIAdapter
     
    org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter
     
    org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter
     
    Optional<org.opencastproject.elasticsearch.index.objects.event.Event>
    getEvent(String id, org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
    Get a single event
    List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter>
     
    List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter>
     
    org.opencastproject.mediapackage.MediaPackage
    getEventMediapackage(org.opencastproject.elasticsearch.index.objects.event.Event event)
     
    getEventSource(org.opencastproject.elasticsearch.index.objects.event.Event event)
    Determines in a very basic way what kind of source the event is
     
    List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter>
     
    org.opencastproject.metadata.dublincore.MetadataList
     
    org.opencastproject.metadata.dublincore.MetadataList
     
    List<org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter>
     
    List<org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter>
     
    protected org.opencastproject.util.data.Tuple<List<String>,Set<String>>
    getTechnicalPresenters(org.opencastproject.metadata.dublincore.DublinCoreMetadataCollection eventMetadata)
    Processes the combined usernames and free text entries of the presenters (creator) field into a list of presenters using the full names of the users if available and adds the usernames to a set of technical presenters.
    boolean
    isWorkflowActive(String workflowState)
     
    void
    removeCatalogByFlavor(org.opencastproject.elasticsearch.index.objects.event.Event event, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor)
    Remove catalogs from the event with the given flavor.
    void
    removeCatalogByFlavor(org.opencastproject.elasticsearch.index.objects.series.Series series, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor)
    Remove a catalog from the series that matches the given flavor.
    void
    removeCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter)
    OSGi callback to remove EventCatalogUIAdapter instance.
    void
    removeCatalogUIAdapter(org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter catalogUIAdapter)
    OSGi callback to remove SeriesCatalogUIAdapter instance.
    boolean
    Removes an event.
    removeEvent(org.opencastproject.elasticsearch.index.objects.event.Event event, String retractWorkflowId)
    Removes an event and retracts it if necessary.
    void
    Remove a series.
    void
    setAclServiceFactory(org.opencastproject.authorization.xacml.manager.api.AclServiceFactory aclServiceFactory)
    OSGi DI.
    void
    setAssetManager(org.opencastproject.assetmanager.api.AssetManager assetManager)
    OSGi DI.
    void
    setAuthorizationService(org.opencastproject.security.api.AuthorizationService authorizationService)
    OSGi DI.
    void
    setCaptureAgentStateService(org.opencastproject.capture.admin.api.CaptureAgentStateService captureAgentStateService)
    OSGi DI.
    void
    setElasticsearchIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex elasticsearchIndex)
     
    void
    setEventCommentService(org.opencastproject.event.comment.EventCommentService eventCommentService)
    OSGi callback for the event comment service.
    void
    setIngestService(org.opencastproject.ingest.api.IngestService ingestService)
    OSGi DI.
    void
    setListProvidersService(org.opencastproject.list.api.ListProvidersService listProvidersService)
    OSGi DI.
    void
    setSchedulerService(org.opencastproject.scheduler.api.SchedulerService schedulerService)
    OSGi DI.
    void
    setSecurityService(org.opencastproject.security.api.SecurityService securityService)
    OSGi DI.
    void
    setSeriesService(org.opencastproject.series.api.SeriesService seriesService)
    OSGi DI.
    void
    setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
    OSGi DI.
    void
    setWorkflowService(org.opencastproject.workflow.api.WorkflowService workflowService)
    OSGi DI.
    void
    setWorkspace(org.opencastproject.workspace.api.Workspace workspace)
    OSGi DI.
    org.opencastproject.metadata.dublincore.MetadataList
    updateAllEventMetadata(String id, String metadataJSON, org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
    Update the event metadata in all available catalogs.
    org.opencastproject.metadata.dublincore.MetadataList
    updateAllSeriesMetadata(String id, String metadataJSON, org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
    Update the series metadata in all available catalogs.
    org.opencastproject.metadata.dublincore.MetadataList
    updateAllSeriesMetadata(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 complete MetadataList
    void
    updateCommentCatalog(org.opencastproject.elasticsearch.index.objects.event.Event event, List<org.opencastproject.event.comment.EventComment> comments)
     
    org.opencastproject.security.api.AccessControlList
    updateEventAcl(String id, org.opencastproject.security.api.AccessControlList acl, org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
    Update the event's AccessControlList.
    updateEventAssets(org.opencastproject.mediapackage.MediaPackage mp, javax.servlet.http.HttpServletRequest request)
    Create or Update an existing event asset.
    org.opencastproject.metadata.dublincore.MetadataList
    updateEventMetadata(String id, org.opencastproject.metadata.dublincore.MetadataList metadataList, org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
    Update an event's metadata using a MetadataList
    protected org.opencastproject.mediapackage.MediaPackage
    updateMpAssetFlavor(List<String> assetList, org.opencastproject.mediapackage.MediaPackage mp, org.json.simple.JSONArray assetMetadata)
    Update the flavor of newly added asset with the passed metadata

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • IndexServiceImpl

      public IndexServiceImpl()
  • Method Details

    • setAclServiceFactory

      public void setAclServiceFactory(org.opencastproject.authorization.xacml.manager.api.AclServiceFactory aclServiceFactory)
      OSGi DI.
      Parameters:
      aclServiceFactory - the factory to set
    • setElasticsearchIndex

      public void setElasticsearchIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex elasticsearchIndex)
    • setAuthorizationService

      public void setAuthorizationService(org.opencastproject.security.api.AuthorizationService authorizationService)
      OSGi DI.
      Parameters:
      authorizationService - the service to set
    • setCaptureAgentStateService

      public void setCaptureAgentStateService(org.opencastproject.capture.admin.api.CaptureAgentStateService captureAgentStateService)
      OSGi DI.
      Parameters:
      captureAgentStateService - the service to set
    • setEventCommentService

      public void setEventCommentService(org.opencastproject.event.comment.EventCommentService eventCommentService)
      OSGi callback for the event comment service.
      Parameters:
      eventCommentService - the service to set
    • addCatalogUIAdapter

      public void addCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter)
      OSGi callback to add EventCatalogUIAdapter instance.
      Parameters:
      catalogUIAdapter - the adapter to add
    • removeCatalogUIAdapter

      public void removeCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter)
      OSGi callback to remove EventCatalogUIAdapter instance.
      Parameters:
      catalogUIAdapter - the adapter to remove
    • addCatalogUIAdapter

      public void addCatalogUIAdapter(org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter catalogUIAdapter)
      OSGi callback to add SeriesCatalogUIAdapter instance.
      Parameters:
      catalogUIAdapter - the adapter to add
    • removeCatalogUIAdapter

      public void removeCatalogUIAdapter(org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter catalogUIAdapter)
      OSGi callback to remove SeriesCatalogUIAdapter instance.
      Parameters:
      catalogUIAdapter - the adapter to remove
    • setIngestService

      public void setIngestService(org.opencastproject.ingest.api.IngestService ingestService)
      OSGi DI.
      Parameters:
      ingestService - the service to set
    • setListProvidersService

      public void setListProvidersService(org.opencastproject.list.api.ListProvidersService listProvidersService)
      OSGi DI.
      Parameters:
      listProvidersService - the service to set
    • setAssetManager

      public void setAssetManager(org.opencastproject.assetmanager.api.AssetManager assetManager)
      OSGi DI.
      Parameters:
      assetManager - the manager to set
    • setSchedulerService

      public void setSchedulerService(org.opencastproject.scheduler.api.SchedulerService schedulerService)
      OSGi DI.
      Parameters:
      schedulerService - the service to set
    • setSecurityService

      public void setSecurityService(org.opencastproject.security.api.SecurityService securityService)
      OSGi DI.
      Parameters:
      securityService - the service to set
    • setSeriesService

      public void setSeriesService(org.opencastproject.series.api.SeriesService seriesService)
      OSGi DI.
      Parameters:
      seriesService - the service to set
    • setWorkflowService

      public void setWorkflowService(org.opencastproject.workflow.api.WorkflowService workflowService)
      OSGi DI.
      Parameters:
      workflowService - the service to set
    • setWorkspace

      public void setWorkspace(org.opencastproject.workspace.api.Workspace workspace)
      OSGi DI.
      Parameters:
      workspace - the workspace to set
    • setUserDirectoryService

      public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
      OSGi DI.
      Parameters:
      userDirectoryService - the service to set
    • getAclService

      public org.opencastproject.authorization.xacml.manager.api.AclService getAclService()
      Returns:
      the acl service
    • getEventCatalogUIAdapters

      public List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> getEventCatalogUIAdapters(String organization)
    • getSeriesCatalogUIAdapters

      public List<org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter> getSeriesCatalogUIAdapters(String organization)
      Parameters:
      organization - The organization to filter the results with.
      Returns:
      A List of SeriesCatalogUIAdapter that provide the metadata to the front end.
    • getCommonEventCatalogUIAdapter

      public org.opencastproject.metadata.dublincore.EventCatalogUIAdapter getCommonEventCatalogUIAdapter(String organization)
    • getCommonSeriesCatalogUIAdapter

      public org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter getCommonSeriesCatalogUIAdapter(String organization)
    • getEventCatalogUIAdapters

      public List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> getEventCatalogUIAdapters()
      Specified by:
      getEventCatalogUIAdapters in interface IndexService
      Returns:
      A List of EventCatalogUIAdapter that provide the metadata to the front end.
    • getExtendedEventCatalogUIAdapters

      public List<org.opencastproject.metadata.dublincore.EventCatalogUIAdapter> getExtendedEventCatalogUIAdapters()
      Specified by:
      getExtendedEventCatalogUIAdapters in interface IndexService
      Returns:
      A List of extended EventCatalogUIAdapter that provide the metadata to the front end. Does not contain the common EventCatalogUIAdapter.
    • getSeriesCatalogUIAdapters

      public List<org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter> getSeriesCatalogUIAdapters()
      Specified by:
      getSeriesCatalogUIAdapters in interface IndexService
      Returns:
      A List of SeriesCatalogUIAdapter that provide the metadata to the front end.
    • getCommonEventCatalogUIAdapter

      public org.opencastproject.metadata.dublincore.EventCatalogUIAdapter getCommonEventCatalogUIAdapter()
      Specified by:
      getCommonEventCatalogUIAdapter in interface IndexService
      Returns:
      the common EventCatalogUIAdapter
    • getCommonSeriesCatalogUIAdapter

      public org.opencastproject.metadata.dublincore.SeriesCatalogUIAdapter getCommonSeriesCatalogUIAdapter()
      Specified by:
      getCommonSeriesCatalogUIAdapter in interface IndexService
      Returns:
      the common SeriesCatalogUIAdapter
    • activate

      public void activate(org.osgi.service.component.ComponentContext cc)
    • deactivate

      public void deactivate(org.osgi.service.component.ComponentContext cc)
    • createEvent

      public String createEvent(javax.servlet.http.HttpServletRequest request) throws IndexServiceException, UnsupportedAssetException
      Description copied from interface: IndexService
      Creates a new event based on a request.
      Specified by:
      createEvent in interface IndexService
      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.
      UnsupportedAssetException - Thrown if the provided asset file type is not accepted.
    • updateEventAssets

      public String updateEventAssets(org.opencastproject.mediapackage.MediaPackage mp, javax.servlet.http.HttpServletRequest request) throws IndexServiceException, UnsupportedAssetException
      Description copied from interface: IndexService
      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.
      Specified by:
      updateEventAssets in interface IndexService
      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:
      IndexServiceException - Thrown if the update assets workflow cannot be started
      UnsupportedAssetException - Thrown if the provided asset file type is not accepted.
    • createEvent

      public String createEvent(org.json.simple.JSONObject metadataJson, org.opencastproject.mediapackage.MediaPackage mp) 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
      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
    • createEvent

      public 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
      Description copied from interface: IndexService
      Create a new event using a EventHttpServletRequest.
      Specified by:
      createEvent in interface IndexService
      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.
    • updateMpAssetFlavor

      protected org.opencastproject.mediapackage.MediaPackage updateMpAssetFlavor(List<String> assetList, org.opencastproject.mediapackage.MediaPackage mp, org.json.simple.JSONArray assetMetadata)
      Update the flavor of newly added asset with the passed metadata
      Parameters:
      assetList - the list of assets to update
      mp - the mediapackage to update
      assetMetadata - a set of mapping metadata for the asset list
      Returns:
      mediapackage updated with assets
    • updateAllEventMetadata

      public org.opencastproject.metadata.dublincore.MetadataList updateAllEventMetadata(String id, String metadataJSON, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws IllegalArgumentException, IndexServiceException, org.opencastproject.util.NotFoundException, org.opencastproject.elasticsearch.api.SearchIndexException, org.opencastproject.security.api.UnauthorizedException
      Description copied from interface: IndexService
      Update the event metadata in all available catalogs.
      Specified by:
      updateAllEventMetadata in interface IndexService
      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.util.NotFoundException - Thrown if the Event could not be found.
      org.opencastproject.elasticsearch.api.SearchIndexException - Thrown if there was an error searching the search index.
      org.opencastproject.security.api.UnauthorizedException - Thrown if the current user is unable to update the event.
    • removeCatalogByFlavor

      public 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
      Description copied from interface: IndexService
      Remove catalogs from the event with the given flavor.
      Specified by:
      removeCatalogByFlavor in interface IndexService
      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.
    • removeCatalogByFlavor

      public void removeCatalogByFlavor(org.opencastproject.elasticsearch.index.objects.series.Series series, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor) throws org.opencastproject.util.NotFoundException, IndexServiceException
      Description copied from interface: IndexService
      Remove a catalog from the series that matches the given flavor.
      Specified by:
      removeCatalogByFlavor in interface IndexService
      Parameters:
      series - The series to remove the catalog from.
      flavor - The flavor that will match the catalog.
      Throws:
      org.opencastproject.util.NotFoundException - Thrown if the catalog cannot be found.
      IndexServiceException - Thrown if there was an error reading the given event.
    • updateEventMetadata

      public 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
      Description copied from interface: IndexService
      Update an event's metadata using a MetadataList
      Specified by:
      updateEventMetadata in interface IndexService
      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.
    • getTechnicalPresenters

      protected org.opencastproject.util.data.Tuple<List<String>,Set<String>> getTechnicalPresenters(org.opencastproject.metadata.dublincore.DublinCoreMetadataCollection eventMetadata)
      Processes the combined usernames and free text entries of the presenters (creator) field into a list of presenters using the full names of the users if available and adds the usernames to a set of technical presenters.
      Parameters:
      eventMetadata - The metadata list that has the presenter (creator) field to pull the list of presenters from.
      Returns:
      A Tuple with a list of friendly presenter names and a set of user names if available for the presenters.
    • updateEventAcl

      public 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
      Description copied from interface: IndexService
      Update the event's AccessControlList.
      Specified by:
      updateEventAcl in interface IndexService
      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.
    • getEventWorkflowProperties

      public Map<String,Map<String,String>> getEventWorkflowProperties(List<String> eventIds)
      Specified by:
      getEventWorkflowProperties in interface IndexService
    • getEvent

      public Optional<org.opencastproject.elasticsearch.index.objects.event.Event> getEvent(String id, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws org.opencastproject.elasticsearch.api.SearchIndexException
      Description copied from interface: IndexService
      Get a single event
      Specified by:
      getEvent in interface IndexService
      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
    • removeEvent

      public 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
      Description copied from interface: IndexService
      Removes an event and retracts it if necessary.
      Specified by:
      removeEvent in interface IndexService
      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

      public boolean removeEvent(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException
      Description copied from interface: IndexService
      Removes an event.
      Specified by:
      removeEvent in interface IndexService
      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
    • getEventMediapackage

      public org.opencastproject.mediapackage.MediaPackage getEventMediapackage(org.opencastproject.elasticsearch.index.objects.event.Event event) throws IndexServiceException
      Specified by:
      getEventMediapackage in interface IndexService
      Throws:
      IndexServiceException
    • getEventSource

      public IndexService.Source getEventSource(org.opencastproject.elasticsearch.index.objects.event.Event event)
      Determines in a very basic way what kind of source the event is
      Specified by:
      getEventSource in interface IndexService
      Parameters:
      event - the event
      Returns:
      the source type
    • createSeries

      public String createSeries(org.opencastproject.metadata.dublincore.MetadataList metadataList, Map<String,String> options, Optional<org.opencastproject.security.api.AccessControlList> optAcl, Optional<Long> optThemeId) throws IndexServiceException
      Description copied from interface: IndexService
      Create a series from a set of metadata and options.
      Specified by:
      createSeries in interface IndexService
      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.
    • createSeries

      public String createSeries(org.json.simple.JSONObject metadata) throws IllegalArgumentException, IndexServiceException, org.opencastproject.security.api.UnauthorizedException
      Description copied from interface: IndexService
      Create a new series.
      Specified by:
      createSeries in interface IndexService
      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.
    • removeSeries

      public void removeSeries(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.series.api.SeriesException, org.opencastproject.security.api.UnauthorizedException
      Description copied from interface: IndexService
      Remove a series.
      Specified by:
      removeSeries in interface IndexService
      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
    • updateAllSeriesMetadata

      public org.opencastproject.metadata.dublincore.MetadataList updateAllSeriesMetadata(String id, String metadataJSON, org.opencastproject.elasticsearch.index.ElasticsearchIndex index) throws IllegalArgumentException, IndexServiceException, org.opencastproject.util.NotFoundException
      Description copied from interface: IndexService
      Update the series metadata in all available catalogs.
      Specified by:
      updateAllSeriesMetadata in interface IndexService
      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.
    • updateAllSeriesMetadata

      public 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
      Description copied from interface: IndexService
      Update the series metadata in all available catalogs by providing a complete MetadataList
      Specified by:
      updateAllSeriesMetadata in interface IndexService
      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.
    • updateCommentCatalog

      public void updateCommentCatalog(org.opencastproject.elasticsearch.index.objects.event.Event event, List<org.opencastproject.event.comment.EventComment> comments) throws Exception
      Specified by:
      updateCommentCatalog in interface IndexService
      Throws:
      Exception
    • getMetadataListWithAllSeriesCatalogUIAdapters

      public org.opencastproject.metadata.dublincore.MetadataList getMetadataListWithAllSeriesCatalogUIAdapters()
      Specified by:
      getMetadataListWithAllSeriesCatalogUIAdapters in interface IndexService
      Returns:
      A MetadataList with all of the available CatalogUIAdapters empty DublinCoreMetadataCollection available
    • getMetadataListWithAllEventCatalogUIAdapters

      public org.opencastproject.metadata.dublincore.MetadataList getMetadataListWithAllEventCatalogUIAdapters()
      Specified by:
      getMetadataListWithAllEventCatalogUIAdapters in interface IndexService
    • isWorkflowActive

      public boolean isWorkflowActive(String workflowState)