Class RestoreJobExecutionListener
- java.lang.Object
-
- org.duracloud.snapshot.service.impl.RestoreJobExecutionListener
-
- All Implemented Interfaces:
org.springframework.batch.core.JobExecutionListener
@Component("restoreJobListener") public class RestoreJobExecutionListener extends java.lang.Object implements org.springframework.batch.core.JobExecutionListener- Author:
- Erik Paulsson Date: 2/10/14
-
-
Constructor Summary
Constructors Constructor Description RestoreJobExecutionListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterJob(org.springframework.batch.core.JobExecution jobExecution)voidbeforeJob(org.springframework.batch.core.JobExecution jobExecution)protected java.util.DategetExpirationDate(java.util.Date endDate, int daysToExpire)Calculates the restore expiration date based on the restoration end date and the number of days before retirementvoidinit(ExecutionListenerConfig config, int daysToExpire)voidsetBridgeConfig(BridgeConfiguration bridgeConfig)voidsetNotificationManager(org.duracloud.common.notification.NotificationManager notificationManager)voidsetRestorationRepo(RestoreRepo restoreRepo)voidsetSnapshotTaskClientHelper(SnapshotTaskClientHelper snapshotTaskClientHelper)
-
-
-
Method Detail
-
setNotificationManager
public void setNotificationManager(org.duracloud.common.notification.NotificationManager notificationManager)
- Parameters:
notificationManager- the notificationManager to set
-
setRestorationRepo
public void setRestorationRepo(RestoreRepo restoreRepo)
- Parameters:
restoreRepo- the restoreRepo to set
-
setSnapshotTaskClientHelper
public void setSnapshotTaskClientHelper(SnapshotTaskClientHelper snapshotTaskClientHelper)
- Parameters:
snapshotTaskClientHelper- the snapshotTaskClientHelper to set
-
setBridgeConfig
public void setBridgeConfig(BridgeConfiguration bridgeConfig)
- Parameters:
bridgeConfig- the bridgeConfig to set
-
init
public void init(ExecutionListenerConfig config, int daysToExpire)
-
beforeJob
@Transactional public void beforeJob(org.springframework.batch.core.JobExecution jobExecution)
- Specified by:
beforeJobin interfaceorg.springframework.batch.core.JobExecutionListener
-
afterJob
@Transactional public void afterJob(org.springframework.batch.core.JobExecution jobExecution)
- Specified by:
afterJobin interfaceorg.springframework.batch.core.JobExecutionListener
-
getExpirationDate
protected java.util.Date getExpirationDate(java.util.Date endDate, int daysToExpire)Calculates the restore expiration date based on the restoration end date and the number of days before retirement- Parameters:
endDate- date on which the restoration completeddaysToExpire- number of days the restored content should stay in place before it is retired- Returns:
- expiration date of restored content
-
-