Class AbstractScanner

java.lang.Object
org.opencastproject.kernel.scanner.AbstractScanner
Direct Known Subclasses:
AbstractBufferScanner, TimedMediaArchiver

public abstract class AbstractScanner extends Object
This class is designed to provide a template for sub classes that will scan their data and respond accordingly.
  • Field Details

    • JOB_PARAM_PARENT

      public static final String JOB_PARAM_PARENT
      See Also:
    • PARAM_KEY_ENABLED

      public static final String PARAM_KEY_ENABLED
      The key whose value will be used to determine if a scanner is enabled or disabled.
      See Also:
    • PARAM_KEY_CRON_EXPR

      public static final String PARAM_KEY_CRON_EXPR
      The key whose value will be a cron expression to determine how often the Scanner scans.
      See Also:
    • quartz

      protected org.quartz.Scheduler quartz
      The quartz scheduler
  • Constructor Details

    • AbstractScanner

      public AbstractScanner()
  • Method Details

    • getJobGroup

      public abstract String getJobGroup()
      The name of the job group to schedule this quartz job under.
    • getJobName

      public abstract String getJobName()
      The name of the job
    • getTriggerGroupName

      public abstract String getTriggerGroupName()
      The name of the group to store the quartz triggers under.
    • getTriggerName

      public abstract String getTriggerName()
      The name of the triggers to use for the quartz jobs.
    • getScannerName

      public abstract String getScannerName()
      The name of the scanner to use in log files.
    • scan

      public abstract void scan()
    • getCronExpression

      public String getCronExpression()
      Returns a cron style statement that defines how often this scanner will run.
    • setCronExpression

      public void setCronExpression(String cronExpression)
    • getQuartz

      protected org.quartz.Scheduler getQuartz()
      Returns:
      Returns the current quartz scheduler used to schedule scanning jobs.
    • setQuartz

      protected void setQuartz(org.quartz.Scheduler quartz)
    • isEnabled

      public boolean isEnabled()
      True if this scanner should be enabled.
    • setEnabled

      public void setEnabled(boolean enabled)
    • schedule

      public void schedule()
      Schedule the scanning job to execute according to the cron schedule.
    • unschedule

      public void unschedule()
      Unschedule the scanning job.
    • bindOrganizationDirectoryService

      protected void bindOrganizationDirectoryService(OrganizationDirectoryService directoryService)
      OSGi callback to set organization directory service
    • bindSecurityService

      protected void bindSecurityService(SecurityService securityService)
      OSGi callback to set security service
    • bindServiceRegistry

      protected void bindServiceRegistry(ServiceRegistry serviceRegistry)
    • getOrganizationDirectoryService

      public OrganizationDirectoryService getOrganizationDirectoryService()
      Get an organization directory service
    • getAdminContextFor

      public SecurityContext getAdminContextFor(String orgId)
      Get a system administrator context for the given organization id.
      Parameters:
      orgId - The organization's id.
      Returns:
      A SecurityContext for the admin.
    • getServiceRegistry

      public ServiceRegistry getServiceRegistry()
      Get a service registry
    • getSystemUserName

      public String getSystemUserName()
      The user name to run this scanner job under.
    • activate

      protected void activate(org.osgi.service.component.ComponentContext cc)
      OSGi component activate callback
    • deactivate

      public void deactivate()
      OSGi deactivate component callback.
    • shutdown

      public void shutdown()
      Shutdown the scheduler.
    • trigger

      public void trigger()
      Trigger the scheduler once independent of it's actual schedule.
    • finalize

      protected void finalize() throws Throwable
      Just to make sure Quartz is being shut down...
      Overrides:
      finalize in class Object
      Throws:
      Throwable