com.atlassian.crowd.manager.backup
Class QuartzBackupScheduler

java.lang.Object
  extended by com.atlassian.crowd.manager.backup.QuartzBackupScheduler
All Implemented Interfaces:
BackupScheduler

public class QuartzBackupScheduler
extends Object
implements BackupScheduler

Quartz-specific implementation of BackupScheduler

Since:
v2.7

Field Summary
static String ENABLED_PROPERTY
           
static String GROUP_NAME
           
static String HOUR_PROPERTY
           
static String JOB_NAME
           
 
Constructor Summary
QuartzBackupScheduler(org.quartz.Scheduler scheduler, PropertyManager propertyManager, BackupManager backupManager, com.atlassian.event.api.EventPublisher eventPublisher, BackupFileStore backupFileStore)
           
 
Method Summary
protected  org.quartz.JobDetail buildJobDetail()
           
protected  org.quartz.Trigger buildTrigger(String cron)
           
 void disable()
          Disable automated backups.
 void enable()
          Enable automated backups.
 int getHourToRun()
          Return the time of day at which the automated backups are run
 boolean isEnabled()
          Return whether automated backup is enabled
 void onApplicationStart(com.atlassian.config.lifecycle.events.ApplicationStartedEvent event)
           
protected  void scheduleJob(int timeOfDay)
           
 void setHourToRun(int timeOfDay)
          Set the time of day at which the automated backups are run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENABLED_PROPERTY

public static final String ENABLED_PROPERTY
See Also:
Constant Field Values

HOUR_PROPERTY

public static final String HOUR_PROPERTY
See Also:
Constant Field Values

JOB_NAME

public static final String JOB_NAME
See Also:
Constant Field Values

GROUP_NAME

public static final String GROUP_NAME
See Also:
Constant Field Values
Constructor Detail

QuartzBackupScheduler

public QuartzBackupScheduler(org.quartz.Scheduler scheduler,
                             PropertyManager propertyManager,
                             BackupManager backupManager,
                             com.atlassian.event.api.EventPublisher eventPublisher,
                             BackupFileStore backupFileStore)
Method Detail

onApplicationStart

@EventListener
public void onApplicationStart(com.atlassian.config.lifecycle.events.ApplicationStartedEvent event)

isEnabled

public boolean isEnabled()
Description copied from interface: BackupScheduler
Return whether automated backup is enabled

Specified by:
isEnabled in interface BackupScheduler
Returns:
true if automated backup is enabled

enable

public void enable()
            throws ScheduledBackupException
Description copied from interface: BackupScheduler
Enable automated backups.

Specified by:
enable in interface BackupScheduler
Throws:
ScheduledBackupException - if there was a problem scheduling the automated backup job

disable

public void disable()
             throws ScheduledBackupException
Description copied from interface: BackupScheduler
Disable automated backups.

Specified by:
disable in interface BackupScheduler
Throws:
ScheduledBackupException - if there was a problem scheduling the automated backup job

getHourToRun

public int getHourToRun()
Description copied from interface: BackupScheduler
Return the time of day at which the automated backups are run

Specified by:
getHourToRun in interface BackupScheduler
Returns:
a number between 0 and 23

setHourToRun

public void setHourToRun(int timeOfDay)
                  throws ScheduledBackupException
Description copied from interface: BackupScheduler
Set the time of day at which the automated backups are run.

Specified by:
setHourToRun in interface BackupScheduler
Parameters:
timeOfDay - a valid time (must be between 0 and 23)
Throws:
ScheduledBackupException - if there was a problem re-scheduling the automated backup job

scheduleJob

protected void scheduleJob(int timeOfDay)
                    throws org.quartz.SchedulerException,
                           ParseException
Throws:
org.quartz.SchedulerException
ParseException

buildJobDetail

protected org.quartz.JobDetail buildJobDetail()

buildTrigger

protected org.quartz.Trigger buildTrigger(String cron)
                                   throws ParseException
Throws:
ParseException


Copyright © 2013 Atlassian. All Rights Reserved.