Class SchedulingUtils
java.lang.Object
org.opencastproject.external.util.SchedulingUtils
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic List<com.google.gson.JsonObject> convertConflictingEvents(Optional<String> checkedEventId, List<MediaPackage> mediaPackages, IndexService indexService, ElasticsearchIndex elasticsearchIndex) Convert the given list ofMediaPackageelements to a JSON used to tell which events are causing conflicts.static List<MediaPackage> getConflictingEvents(SchedulingUtils.SchedulingInfo schedulingInfo, CaptureAgentStateService agentStateService, SchedulerService schedulerService) Get the conflicting events for the given SchedulingInfo.
-
Method Details
-
convertConflictingEvents
public static List<com.google.gson.JsonObject> convertConflictingEvents(Optional<String> checkedEventId, List<MediaPackage> mediaPackages, IndexService indexService, ElasticsearchIndex elasticsearchIndex) throws SearchIndexException Convert the given list ofMediaPackageelements to a JSON used to tell which events are causing conflicts.- Parameters:
checkedEventId- The id of the event which was checked for conflicts. May be empty if an rrule was checked.mediaPackages- The conflictingMediaPackages.indexService- TheIndexServicefor getting the corresponding events for the conflictingMediaPackages.elasticsearchIndex- The index to use for getting the corresponding events for the conflicting MediaPackages.- Returns:
- A List of conflicting events, represented as JSON objects.
- Throws:
SearchIndexException- If an event cannot be found.
-
getConflictingEvents
public static List<MediaPackage> getConflictingEvents(SchedulingUtils.SchedulingInfo schedulingInfo, CaptureAgentStateService agentStateService, SchedulerService schedulerService) throws NotFoundException, UnauthorizedException, SchedulerException Get the conflicting events for the given SchedulingInfo.- Parameters:
schedulingInfo- The SchedulingInfo to check for conflicts.agentStateService- TheCaptureAgentStateServiceto use for retrieving capture agents.schedulerService- TheSchedulerServiceto use for conflict checking.- Returns:
- A list of
MediaPackageelements which cause conflicts with the given SchedulingInfo. - Throws:
NotFoundException- If the capture agent cannot be found.UnauthorizedException- If theSchedulerServicecannot be queried due to missing authorization.SchedulerException- In case internal errors occur within theSchedulerService.
-