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 Object
implements org.springframework.batch.core.JobExecutionListener
- Author:
- Erik Paulsson Date: 2/10/14
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterJob(org.springframework.batch.core.JobExecution jobExecution) voidbeforeJob(org.springframework.batch.core.JobExecution jobExecution) protected DategetExpirationDate(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)
-
Constructor Details
-
RestoreJobExecutionListener
public RestoreJobExecutionListener()
-
-
Method Details
-
setNotificationManager
public void setNotificationManager(org.duracloud.common.notification.NotificationManager notificationManager) - Parameters:
notificationManager- the notificationManager to set
-
setRestorationRepo
- Parameters:
restoreRepo- the restoreRepo to set
-
setSnapshotTaskClientHelper
- Parameters:
snapshotTaskClientHelper- the snapshotTaskClientHelper to set
-
setBridgeConfig
- Parameters:
bridgeConfig- the bridgeConfig to set
-
init
-
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
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
-