Class ExecuteExtractionSchedulable
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
-
- org.ametys.plugins.extraction.execution.ExecuteExtractionSchedulable
-
- All Implemented Interfaces:
Schedulable,LogEnabled,PluginAware,Initializable,Component,Configurable,Contextualizable,Serviceable
public class ExecuteExtractionSchedulable extends AbstractStaticSchedulable implements Initializable
ASchedulablejob which execute an extraction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser
-
-
Field Summary
Fields Modifier and Type Field Description private static String__JOBDATAMAP_DEFINITION_FILE_PATH_KEYprivate static String__JOBDATAMAP_PIPELINE_KEYprivate static String__JOBDATAMAP_RECIPIENT_KEYprivate static String__JOBDATAMAP_VARIABLES_KEYprivate ExtractionExecutor_extractionExecutorprivate I18nUtils_i18nUtilsprivate JSONUtils_jsonUtilsprivate String_mailFromprivate PipelineManager_pipelineManagerstatic StringDEFINITION_FILE_PATH_KEYThe key for the extraction definition filestatic StringPIPELINE_KEYThe key for the pipelinestatic StringRECIPIENT_KEYThe key for the recipientprivate static DateTimeFormatterRESULT_FILE_NAME_DATE_TIME_FORMATTERstatic StringVARIABLES_KEYThe key for the variables values-
Fields inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
_acceptConcurrentExecution, _context, _description, _iconGlyph, _iconLarge, _iconMedium, _iconSmall, _id, _label, _parameters, _pluginName, _private, _schedulableParameterTypeExtensionPoint, _smanager, _userManager
-
-
Constructor Summary
Constructors Constructor Description ExecuteExtractionSchedulable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Map<String,Object>_getExtractionParameters(JobDataMap jobDataMap)private String_getFailureMailBody(String definitionFileName, Throwable exception)private String_getMailSubject()private String_getResultFileName(String definitionFilePath, PipelineDescriptor pipeline)private String_getSuccessMailBody(String definitionFileName)private void_sendMail(String recipient, String body)voidexecute(JobExecutionContext context)The action to perform when a trigger is fired.voidinitialize()voidservice(ServiceManager manager)-
Methods inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
_getLaunchUser, _getLaunchUserIdentity, acceptConcurrentExecution, configure, contextualize, getDescription, getIconGlyph, getIconLarge, getIconMedium, getIconSmall, getId, getLabel, getParameters, isPrivate, setPluginInfo
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
DEFINITION_FILE_PATH_KEY
public static final String DEFINITION_FILE_PATH_KEY
The key for the extraction definition file- See Also:
- Constant Field Values
-
VARIABLES_KEY
public static final String VARIABLES_KEY
The key for the variables values- See Also:
- Constant Field Values
-
RECIPIENT_KEY
public static final String RECIPIENT_KEY
The key for the recipient- See Also:
- Constant Field Values
-
PIPELINE_KEY
public static final String PIPELINE_KEY
The key for the pipeline- See Also:
- Constant Field Values
-
__JOBDATAMAP_DEFINITION_FILE_PATH_KEY
private static final String __JOBDATAMAP_DEFINITION_FILE_PATH_KEY
- See Also:
- Constant Field Values
-
__JOBDATAMAP_VARIABLES_KEY
private static final String __JOBDATAMAP_VARIABLES_KEY
- See Also:
- Constant Field Values
-
__JOBDATAMAP_RECIPIENT_KEY
private static final String __JOBDATAMAP_RECIPIENT_KEY
- See Also:
- Constant Field Values
-
__JOBDATAMAP_PIPELINE_KEY
private static final String __JOBDATAMAP_PIPELINE_KEY
- See Also:
- Constant Field Values
-
RESULT_FILE_NAME_DATE_TIME_FORMATTER
private static final DateTimeFormatter RESULT_FILE_NAME_DATE_TIME_FORMATTER
-
_jsonUtils
private JSONUtils _jsonUtils
-
_i18nUtils
private I18nUtils _i18nUtils
-
_pipelineManager
private PipelineManager _pipelineManager
-
_extractionExecutor
private ExtractionExecutor _extractionExecutor
-
-
Constructor Detail
-
ExecuteExtractionSchedulable
public ExecuteExtractionSchedulable()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractStaticSchedulable- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
execute
public void execute(JobExecutionContext context) throws Exception
Description copied from interface:SchedulableThe action to perform when a trigger is fired. Do not manually call this method.- Specified by:
executein interfaceSchedulable- Specified by:
executein classAbstractStaticSchedulable- Parameters:
context- the context- Throws:
Exception- if an error occured
-
_getExtractionParameters
private Map<String,Object> _getExtractionParameters(JobDataMap jobDataMap)
-
_getResultFileName
private String _getResultFileName(String definitionFilePath, PipelineDescriptor pipeline)
-
_getSuccessMailBody
private String _getSuccessMailBody(String definitionFileName)
-
_getFailureMailBody
private String _getFailureMailBody(String definitionFileName, Throwable exception)
-
_getMailSubject
private String _getMailSubject()
-
-