Class SchedulerServiceImpl

java.lang.Object
org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
org.opencastproject.scheduler.impl.SchedulerServiceImpl
All Implemented Interfaces:
org.opencastproject.elasticsearch.index.rebuild.IndexProducer, org.opencastproject.scheduler.api.SchedulerService, org.osgi.service.cm.ManagedService

public class SchedulerServiceImpl extends org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer implements org.opencastproject.scheduler.api.SchedulerService, org.osgi.service.cm.ManagedService
Implementation of SchedulerService.
  • Field Details

    • lastModifiedCache

      protected com.google.common.cache.Cache<String,String> lastModifiedCache
      The last modified cache
  • Constructor Details

    • SchedulerServiceImpl

      public SchedulerServiceImpl()
  • Method Details

    • addSchedulerUpdateHandler

      public void addSchedulerUpdateHandler(org.opencastproject.message.broker.api.update.SchedulerUpdateHandler handler)
      OSGi callback to add an update handler.
      Parameters:
      handler -
    • removeSchedulerUpdateHandler

      public void removeSchedulerUpdateHandler(org.opencastproject.message.broker.api.update.SchedulerUpdateHandler handler)
    • setPersistence

      public void setPersistence(SchedulerServiceDatabase persistence)
      OSGi callback to set Persistence Service.
      Parameters:
      persistence -
    • setSeriesService

      public void setSeriesService(org.opencastproject.series.api.SeriesService seriesService)
      OSGi callback for setting Series Service.
      Parameters:
      seriesService -
    • setSecurityService

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

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

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

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

      public void setOrgDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService orgDirectoryService)
      OSGi callback to set the organization directory service.
      Parameters:
      orgDirectoryService -
    • setIndex

      public void setIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
      OSgi callback to set the Elasticsearch index.
      Parameters:
      index - the Elasticsearch index.
    • addCatalogUIAdapter

      public void addCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter)
      OSGi callback to add EventCatalogUIAdapter instance.
    • removeCatalogUIAdapter

      public void removeCatalogUIAdapter(org.opencastproject.metadata.dublincore.EventCatalogUIAdapter catalogUIAdapter)
      OSGi callback to remove EventCatalogUIAdapter instance.
    • activate

      public void activate(org.osgi.service.component.ComponentContext cc) throws Exception
      Activates Scheduler Service.
      Parameters:
      cc - ComponentContext
      Throws:
      Exception
    • updated

      public void updated(Dictionary<String,?> properties) throws org.osgi.service.cm.ConfigurationException
      Specified by:
      updated in interface org.osgi.service.cm.ManagedService
      Throws:
      org.osgi.service.cm.ConfigurationException
    • addEvent

      public void addEvent(Date startDateTime, Date endDateTime, String captureAgentId, Set<String> userIds, org.opencastproject.mediapackage.MediaPackage mediaPackage, Map<String,String> wfProperties, Map<String,String> caMetadata, Optional<String> schedulingSource) throws org.opencastproject.security.api.UnauthorizedException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      addEvent in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.security.api.UnauthorizedException
      org.opencastproject.scheduler.api.SchedulerException
    • addMultipleEvents

      public Map<String,net.fortuna.ical4j.model.Period> addMultipleEvents(net.fortuna.ical4j.model.property.RRule rRule, Date start, Date end, Long duration, TimeZone tz, String captureAgentId, Set<String> userIds, org.opencastproject.mediapackage.MediaPackage templateMp, Map<String,String> wfProperties, Map<String,String> caMetadata, Optional<String> schedulingSource) throws org.opencastproject.security.api.UnauthorizedException, org.opencastproject.scheduler.api.SchedulerConflictException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      addMultipleEvents in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.security.api.UnauthorizedException
      org.opencastproject.scheduler.api.SchedulerConflictException
      org.opencastproject.scheduler.api.SchedulerException
    • updateEvent

      public void updateEvent(String mpId, Optional<Date> startDateTime, Optional<Date> endDateTime, Optional<String> captureAgentId, Optional<Set<String>> userIds, Optional<org.opencastproject.mediapackage.MediaPackage> mediaPackage, Optional<Map<String,String>> wfProperties, Optional<Map<String,String>> caMetadata) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      updateEvent in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.security.api.UnauthorizedException
      org.opencastproject.scheduler.api.SchedulerException
    • updateEvent

      public void updateEvent(String mpId, Optional<Date> startDateTime, Optional<Date> endDateTime, Optional<String> captureAgentId, Optional<Set<String>> userIds, Optional<org.opencastproject.mediapackage.MediaPackage> mediaPackage, Optional<Map<String,String>> wfProperties, Optional<Map<String,String>> caMetadata, boolean allowConflict) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      updateEvent in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.security.api.UnauthorizedException
      org.opencastproject.scheduler.api.SchedulerException
    • removeEvent

      public void removeEvent(String mediaPackageId) throws org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      removeEvent in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.scheduler.api.SchedulerException
    • getMediaPackage

      public org.opencastproject.mediapackage.MediaPackage getMediaPackage(String mediaPackageId) throws org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getMediaPackage in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.scheduler.api.SchedulerException
    • getDublinCore

      public org.opencastproject.metadata.dublincore.DublinCoreCatalog getDublinCore(String mediaPackageId) throws org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getDublinCore in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.scheduler.api.SchedulerException
    • getTechnicalMetadata

      public org.opencastproject.scheduler.api.TechnicalMetadata getTechnicalMetadata(String mediaPackageId) throws org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getTechnicalMetadata in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.security.api.UnauthorizedException
      org.opencastproject.scheduler.api.SchedulerException
    • getWorkflowConfig

      public Map<String,String> getWorkflowConfig(String mediaPackageId) throws org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getWorkflowConfig in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.scheduler.api.SchedulerException
    • getCaptureAgentConfiguration

      public Map<String,String> getCaptureAgentConfiguration(String mediaPackageId) throws org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getCaptureAgentConfiguration in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.scheduler.api.SchedulerException
    • getEventCount

      public int getEventCount() throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getEventCount in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • search

      public List<org.opencastproject.mediapackage.MediaPackage> search(Optional<String> captureAgentId, Optional<Date> startsFrom, Optional<Date> startsTo, Optional<Date> endFrom, Optional<Date> endTo) throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      search in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • getCurrentRecording

      public Optional<org.opencastproject.mediapackage.MediaPackage> getCurrentRecording(String captureAgentId) throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getCurrentRecording in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • getUpcomingRecording

      public Optional<org.opencastproject.mediapackage.MediaPackage> getUpcomingRecording(String captureAgentId) throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getUpcomingRecording in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • findConflictingEvents

      public List<org.opencastproject.mediapackage.MediaPackage> findConflictingEvents(String captureDeviceID, Date startDate, Date endDate) throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      findConflictingEvents in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • findConflictingEvents

      public List<org.opencastproject.mediapackage.MediaPackage> findConflictingEvents(String captureAgentId, net.fortuna.ical4j.model.property.RRule rrule, Date start, Date end, long duration, TimeZone tz) throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      findConflictingEvents in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • getCalendar

      public String getCalendar(Optional<String> captureAgentId, Optional<String> seriesId, Optional<Date> cutoff) throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getCalendar in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • getScheduleLastModified

      public String getScheduleLastModified(String captureAgentId) throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getScheduleLastModified in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • removeScheduledRecordingsBeforeBuffer

      public void removeScheduledRecordingsBeforeBuffer(long buffer) throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      removeScheduledRecordingsBeforeBuffer in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • updateRecordingState

      public boolean updateRecordingState(String id, String state) throws org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      updateRecordingState in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.scheduler.api.SchedulerException
    • getRecordingState

      public org.opencastproject.scheduler.api.Recording getRecordingState(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getRecordingState in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.scheduler.api.SchedulerException
    • removeRecording

      public void removeRecording(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      removeRecording in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.scheduler.api.SchedulerException
    • getKnownRecordings

      public Map<String,org.opencastproject.scheduler.api.Recording> getKnownRecordings() throws org.opencastproject.scheduler.api.SchedulerException
      Specified by:
      getKnownRecordings in interface org.opencastproject.scheduler.api.SchedulerService
      Throws:
      org.opencastproject.scheduler.api.SchedulerException
    • repopulate

      public void repopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type) throws org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
      Specified by:
      repopulate in interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
      Throws:
      org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
    • getService

      public org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service getService()
      Specified by:
      getService in interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
    • getSecurityService

      public org.opencastproject.security.api.SecurityService getSecurityService()