Class EventIndexUtils
java.lang.Object
org.opencastproject.elasticsearch.index.objects.event.EventIndexUtils
Utility implementation to deal with the conversion of recording events and its corresponding index data structures.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final long -
Method Summary
Modifier and TypeMethodDescriptionstatic BooleansubflavorMatches(List<Publication> publications, String previewSubtype) Returnstrueif the previewSubtype matches any of the publicationFlavors.static EventtoRecordingEvent(SearchMetadataCollection metadata, javax.xml.bind.Unmarshaller unmarshaller) Creates a search result item based on the data returned from the search index.static SearchMetadataCollectiontoSearchMetadata(Event event, ListProvidersService listProviderService) Creates search metadata from a recording event such that the event can be stored in the search index.static EventupdateEvent(Event event, MediaPackage mp) Update the givenEventwith the givenMediaPackage.static EventupdateEvent(Event event, DublinCore dc) Update the givenEventwith the givenDublinCore.static EventupdateEventExtendedMetadata(Event event, DublinCoreCatalog dc, MediaPackageElementFlavor flavor) Update extended metadata for event from dublin core catalog.static voidupdateSeriesName(Event event, String organization, User user, ElasticsearchIndex searchIndex) A function to update the series title within an event.static voidupdateSeriesName(Event event, String organization, User user, ElasticsearchIndex searchIndex, int tries, long sleep) A function to update the series title within an event.static EventupdateTechnicalDate(Event event)
-
Field Details
-
DEFAULT_ATTEMPTS
public static final int DEFAULT_ATTEMPTS- See Also:
-
DEFAULT_SLEEP
public static final long DEFAULT_SLEEP- See Also:
-
-
Method Details
-
toRecordingEvent
public static Event toRecordingEvent(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 metadataunmarshaller- the unmarshaller to use- Returns:
- the search result item
- Throws:
IOException- if unmarshalling fails
-
toSearchMetadata
public static SearchMetadataCollection toSearchMetadata(Event event, 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, DublinCoreCatalog dc, MediaPackageElementFlavor flavor) Update extended metadata for event from dublin core catalog.- Parameters:
event- The eventdc- The dublin core catalog with extended metadataflavor- The flavor of the extended metadata- Returns:
- The updated event
-
updateEvent
Update the givenEventwith the givenDublinCore.- Parameters:
event- the event to updatedc- the catalog with the metadata for the update- Returns:
- the updated event
-
updateTechnicalDate
-
updateEvent
Update the givenEventwith the givenMediaPackage.- Parameters:
event- the event to updatemp- the mediapackage containing the metadata for the update- Returns:
- the updated event
-
updateSeriesName
public static void updateSeriesName(Event event, String organization, User user, ElasticsearchIndex searchIndex) throws 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 inorganization- The organization for this event and seriesuser- The usersearchIndex- The index to search for the series- Throws:
SearchIndexException
-
updateSeriesName
public static void updateSeriesName(Event event, String organization, User user, ElasticsearchIndex searchIndex, int tries, long sleep) throws SearchIndexException A function to update the series title within an event.- Parameters:
event- The event to update the series name inorganization- The organization for this event and seriesuser- The usersearchIndex- The index to search for the seriestries- The number of attempts to try to get the series titlesleep- The amount of time in ms to sleep between attempts to get the series title.- Throws:
SearchIndexException
-
subflavorMatches
Returnstrueif the previewSubtype matches any of the publicationFlavors.- Parameters:
publications-previewSubtype-- Returns:
-