Class AbstractScanner
java.lang.Object
org.opencastproject.kernel.scanner.AbstractScanner
- Direct Known Subclasses:
AbstractBufferScanner,TimedMediaArchiver
This class is designed to provide a template for sub classes that will scan
their data and respond accordingly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPlease remember that derived classes need a no-arg constructor in order to work with Quartz. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringThe key whose value will be a cron expression to determine how often the Scanner scans.static final StringThe key whose value will be used to determine if a scanner is enabled or disabled.protected org.quartz.SchedulerThe quartz scheduler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivate(org.osgi.service.component.ComponentContext cc) OSGi component activate callbackprotected voidbindOrganizationDirectoryService(OrganizationDirectoryService directoryService) OSGi callback to set organization directory serviceprotected voidbindSecurityService(SecurityService securityService) OSGi callback to set security serviceprotected voidbindServiceRegistry(ServiceRegistry serviceRegistry) voidOSGi deactivate component callback.protected voidfinalize()Just to make sure Quartz is being shut down...getAdminContextFor(String orgId) Get a system administrator context for the given organization id.Returns a cron style statement that defines how often this scanner will run.abstract StringThe name of the job group to schedule this quartz job under.abstract StringThe name of the jobGet an organization directory serviceprotected org.quartz.Schedulerabstract StringThe name of the scanner to use in log files.Get a service registryThe user name to run this scanner job under.abstract StringThe name of the group to store the quartz triggers under.abstract StringThe name of the triggers to use for the quartz jobs.booleanTrue if this scanner should be enabled.abstract voidscan()voidschedule()Schedule the scanning job to execute according to the cron schedule.voidsetCronExpression(String cronExpression) voidsetEnabled(boolean enabled) protected voidsetQuartz(org.quartz.Scheduler quartz) voidshutdown()Shutdown the scheduler.voidtrigger()Trigger the scheduler once independent of it's actual schedule.voidUnschedule the scanning job.
-
Field Details
-
JOB_PARAM_PARENT
- See Also:
-
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
The key whose value will be a cron expression to determine how often the Scanner scans.- See Also:
-
quartz
protected org.quartz.Scheduler quartzThe quartz scheduler
-
-
Constructor Details
-
AbstractScanner
public AbstractScanner()
-
-
Method Details
-
getJobGroup
The name of the job group to schedule this quartz job under. -
getJobName
The name of the job -
getTriggerGroupName
The name of the group to store the quartz triggers under. -
getTriggerName
The name of the triggers to use for the quartz jobs. -
getScannerName
The name of the scanner to use in log files. -
scan
public abstract void scan() -
getCronExpression
Returns a cron style statement that defines how often this scanner will run. -
setCronExpression
-
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
OSGi callback to set organization directory service -
bindSecurityService
OSGi callback to set security service -
bindServiceRegistry
-
getOrganizationDirectoryService
Get an organization directory service -
getAdminContextFor
Get a system administrator context for the given organization id.- Parameters:
orgId- The organization's id.- Returns:
- A SecurityContext for the admin.
-
getServiceRegistry
Get a service registry -
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
Just to make sure Quartz is being shut down...
-