Class AbstractScanner

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

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.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Please remember that derived classes need a no-arg constructor in order to work with Quartz.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
    The key whose value will be a cron expression to determine how often the Scanner scans.
    static final String
    The key whose value will be used to determine if a scanner is enabled or disabled.
    protected org.quartz.Scheduler
    The quartz scheduler
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    activate(org.osgi.service.component.ComponentContext cc)
    OSGi component activate callback
    protected void
    bindOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService directoryService)
    OSGi callback to set organization directory service
    protected void
    bindSecurityService(org.opencastproject.security.api.SecurityService securityService)
    OSGi callback to set security service
    protected void
    bindServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
     
    void
    OSGi deactivate component callback.
    protected void
    Just to make sure Quartz is being shut down...
    org.opencastproject.security.util.SecurityContext
    Get a system administrator context for the given organization id.
    Returns a cron style statement that defines how often this scanner will run.
    abstract String
    The name of the job group to schedule this quartz job under.
    abstract String
    The name of the job
    org.opencastproject.security.api.OrganizationDirectoryService
    Get an organization directory service
    protected org.quartz.Scheduler
     
    abstract String
    The name of the scanner to use in log files.
    org.opencastproject.serviceregistry.api.ServiceRegistry
    Get a service registry
    The user name to run this scanner job under.
    abstract String
    The name of the group to store the quartz triggers under.
    abstract String
    The name of the triggers to use for the quartz jobs.
    boolean
    True if this scanner should be enabled.
    abstract void
     
    void
    Schedule the scanning job to execute according to the cron schedule.
    void
    setCronExpression(String cronExpression)
     
    void
    setEnabled(boolean enabled)
     
    protected void
    setQuartz(org.quartz.Scheduler quartz)
     
    void
    Shutdown the scheduler.
    void
    Trigger the scheduler once independent of it's actual schedule.
    void
    Unschedule the scanning job.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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(org.opencastproject.security.api.OrganizationDirectoryService directoryService)
      OSGi callback to set organization directory service
    • bindSecurityService

      protected void bindSecurityService(org.opencastproject.security.api.SecurityService securityService)
      OSGi callback to set security service
    • bindServiceRegistry

      protected void bindServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
    • getOrganizationDirectoryService

      public org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()
      Get an organization directory service
    • getAdminContextFor

      public org.opencastproject.security.util.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 org.opencastproject.serviceregistry.api.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