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
ASchedulable
job 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_KEY
private static String
__JOBDATAMAP_PIPELINE_KEY
private static String
__JOBDATAMAP_RECIPIENT_KEY
private static String
__JOBDATAMAP_VARIABLES_KEY
private ExtractionExecutor
_extractionExecutor
private I18nUtils
_i18nUtils
private JSONUtils
_jsonUtils
private String
_mailFrom
private PipelineManager
_pipelineManager
static String
DEFINITION_FILE_PATH_KEY
The key for the extraction definition filestatic String
PIPELINE_KEY
The key for the pipelinestatic String
RECIPIENT_KEY
The key for the recipientprivate static DateTimeFormatter
RESULT_FILE_NAME_DATE_TIME_FORMATTER
static String
VARIABLES_KEY
The 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)
void
execute(JobExecutionContext context)
The action to perform when a trigger is fired.void
initialize()
void
service(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:
service
in interfaceServiceable
- Overrides:
service
in classAbstractStaticSchedulable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
execute
public void execute(JobExecutionContext context) throws Exception
Description copied from interface:Schedulable
The action to perform when a trigger is fired. Do not manually call this method.- Specified by:
execute
in interfaceSchedulable
- Specified by:
execute
in 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()
-
-