java.lang.Object
org.opencastproject.elasticsearch.index.objects.event.EventIndexUtils

public final class EventIndexUtils extends Object
Utility implementation to deal with the conversion of recording events and its corresponding index data structures.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final long
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Boolean
    subflavorMatches(List<org.opencastproject.mediapackage.Publication> publications, String previewSubtype)
    Returns true if the previewSubtype matches any of the publicationFlavors.
    static Event
    toRecordingEvent(org.opencastproject.elasticsearch.impl.SearchMetadataCollection metadata, javax.xml.bind.Unmarshaller unmarshaller)
    Creates a search result item based on the data returned from the search index.
    static org.opencastproject.elasticsearch.impl.SearchMetadataCollection
    toSearchMetadata(Event event, org.opencastproject.list.api.ListProvidersService listProviderService)
    Creates search metadata from a recording event such that the event can be stored in the search index.
    static Event
    updateEvent(Event event, org.opencastproject.mediapackage.MediaPackage mp)
    Update the given Event with the given MediaPackage.
    static Event
    updateEvent(Event event, org.opencastproject.metadata.dublincore.DublinCore dc)
    Update the given Event with the given DublinCore.
    static Event
    updateEventExtendedMetadata(Event event, org.opencastproject.metadata.dublincore.DublinCoreCatalog dc, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor)
    Update extended metadata for event from dublin core catalog.
    static void
    updateSeriesName(Event event, String organization, org.opencastproject.security.api.User user, ElasticsearchIndex searchIndex)
    A function to update the series title within an event.
    static void
    updateSeriesName(Event event, String organization, org.opencastproject.security.api.User user, ElasticsearchIndex searchIndex, int tries, long sleep)
    A function to update the series title within an event.
    static Event
     

    Methods inherited from class java.lang.Object

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

  • Method Details

    • toRecordingEvent

      public static Event toRecordingEvent(org.opencastproject.elasticsearch.impl.SearchMetadataCollection metadata, javax.xml.bind.Unmarshaller unmarshaller) throws IOException
      Creates a search result item based on the data returned from the search index.
      Parameters:
      metadata - the search metadata
      unmarshaller - the unmarshaller to use
      Returns:
      the search result item
      Throws:
      IOException - if unmarshalling fails
    • toSearchMetadata

      public static org.opencastproject.elasticsearch.impl.SearchMetadataCollection toSearchMetadata(Event event, org.opencastproject.list.api.ListProvidersService listProviderService)
      Creates search metadata from a recording event such that the event can be stored in the search index.
      Parameters:
      event - the recording event
      Returns:
      the set of metadata
    • updateEventExtendedMetadata

      public static Event updateEventExtendedMetadata(Event event, org.opencastproject.metadata.dublincore.DublinCoreCatalog dc, org.opencastproject.mediapackage.MediaPackageElementFlavor flavor)
      Update extended metadata for event from dublin core catalog.
      Parameters:
      event - The event
      dc - The dublin core catalog with extended metadata
      flavor - The flavor of the extended metadata
      Returns:
      The updated event
    • updateEvent

      public static Event updateEvent(Event event, org.opencastproject.metadata.dublincore.DublinCore dc)
      Update the given Event with the given DublinCore.
      Parameters:
      event - the event to update
      dc - the catalog with the metadata for the update
      Returns:
      the updated event
    • updateTechnicalDate

      public static Event updateTechnicalDate(Event event)
    • updateEvent

      public static Event updateEvent(Event event, org.opencastproject.mediapackage.MediaPackage mp)
      Update the given Event with the given MediaPackage.
      Parameters:
      event - the event to update
      mp - the mediapackage containing the metadata for the update
      Returns:
      the updated event
    • updateSeriesName

      public static void updateSeriesName(Event event, String organization, org.opencastproject.security.api.User user, ElasticsearchIndex searchIndex) throws org.opencastproject.elasticsearch.api.SearchIndexException
      A function to update the series title within an event. Uses the default number of attempts to get the series title and the default amount of time to sleep between attempts.
      Parameters:
      event - The event to update the series name in
      organization - The organization for this event and series
      user - The user
      searchIndex - The index to search for the series
      Throws:
      org.opencastproject.elasticsearch.api.SearchIndexException
    • updateSeriesName

      public static void updateSeriesName(Event event, String organization, org.opencastproject.security.api.User user, ElasticsearchIndex searchIndex, int tries, long sleep) throws org.opencastproject.elasticsearch.api.SearchIndexException
      A function to update the series title within an event.
      Parameters:
      event - The event to update the series name in
      organization - The organization for this event and series
      user - The user
      searchIndex - The index to search for the series
      tries - The number of attempts to try to get the series title
      sleep - The amount of time in ms to sleep between attempts to get the series title.
      Throws:
      org.opencastproject.elasticsearch.api.SearchIndexException
    • subflavorMatches

      public static Boolean subflavorMatches(List<org.opencastproject.mediapackage.Publication> publications, String previewSubtype)
      Returns true if the previewSubtype matches any of the publicationFlavors.
      Parameters:
      publications -
      previewSubtype -
      Returns: