Class ExecuteExtractionSchedulable
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
-
- org.ametys.cms.schedule.AbstractSendingMailSchedulable
-
- org.ametys.plugins.extraction.execution.ExecuteExtractionSchedulable
-
- All Implemented Interfaces:
Schedulable,LogEnabled,PluginAware,Initializable,Component,Configurable,Contextualizable,Serviceable
public class ExecuteExtractionSchedulable extends AbstractSendingMailSchedulable
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 static String__RESULT_FILE_PATHSprivate ExtractionExecutor_extractionExecutorprivate JSONUtils_jsonUtilsprivate 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.cms.schedule.AbstractSendingMailSchedulable
_currentUserProvider, _i18nUtils, _mailSender, _sysadminMail, _userHelper
-
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 void_doExecute(JobExecutionContext context)Executes the schedulable.private String_getDefaultResultFileName(String definitionFilePath, PipelineDescriptor pipeline)private String_getDefinitionFilePath(JobExecutionContext context)protected I18nizableText_getErrorMailBody(JobExecutionContext context, Throwable throwable)Retrieves the body of the error mailprotected I18nizableText_getErrorMailSubject(JobExecutionContext context)Retrieves the subject of the error mailprivate Map<String,Object>_getExtractionParameters(JobDataMap jobDataMap)protected Optional<String>_getRecipient(JobExecutionContext context)Retrieves the optional recipient of the mailprivate String_getResultFileDownloadLink(Path resultFilePath)protected I18nizableText_getSuccessMailBody(JobExecutionContext context)Retrieves the body of the success mailprotected I18nizableText_getSuccessMailSubject(JobExecutionContext context)Retrieves the subject of the success mailprotected boolean_isMailBodyInHTML(JobExecutionContext context)Determines if the mail body is in HTMLvoidservice(ServiceManager manager)-
Methods inherited from class org.ametys.cms.schedule.AbstractSendingMailSchedulable
_sendMail, execute, initialize
-
Methods inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
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_PATHS
private static final String __RESULT_FILE_PATHS
- 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
-
_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 classAbstractSendingMailSchedulable- Throws:
ServiceException
-
_doExecute
public void _doExecute(JobExecutionContext context) throws Exception
Description copied from class:AbstractSendingMailSchedulableExecutes the schedulable.- Specified by:
_doExecutein classAbstractSendingMailSchedulable- Parameters:
context- the context- Throws:
Exception- if an error occurred
-
_getDefaultResultFileName
private String _getDefaultResultFileName(String definitionFilePath, PipelineDescriptor pipeline)
-
_getExtractionParameters
private Map<String,Object> _getExtractionParameters(JobDataMap jobDataMap)
-
_getRecipient
protected Optional<String> _getRecipient(JobExecutionContext context)
Description copied from class:AbstractSendingMailSchedulableRetrieves the optional recipient of the mail- Overrides:
_getRecipientin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
- the optional recipient of the mail
-
_isMailBodyInHTML
protected boolean _isMailBodyInHTML(JobExecutionContext context)
Description copied from class:AbstractSendingMailSchedulableDetermines if the mail body is in HTML- Overrides:
_isMailBodyInHTMLin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
trueif the mail body is in HTML,falseotherwise
-
_getSuccessMailSubject
protected I18nizableText _getSuccessMailSubject(JobExecutionContext context)
Description copied from class:AbstractSendingMailSchedulableRetrieves the subject of the success mail- Specified by:
_getSuccessMailSubjectin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
- the subject of the success mail
-
_getSuccessMailBody
protected I18nizableText _getSuccessMailBody(JobExecutionContext context)
Description copied from class:AbstractSendingMailSchedulableRetrieves the body of the success mail- Specified by:
_getSuccessMailBodyin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
- the body of the success mail
-
_getErrorMailSubject
protected I18nizableText _getErrorMailSubject(JobExecutionContext context)
Description copied from class:AbstractSendingMailSchedulableRetrieves the subject of the error mail- Specified by:
_getErrorMailSubjectin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
- the subject of the error mail
-
_getErrorMailBody
protected I18nizableText _getErrorMailBody(JobExecutionContext context, Throwable throwable)
Description copied from class:AbstractSendingMailSchedulableRetrieves the body of the error mail- Specified by:
_getErrorMailBodyin classAbstractSendingMailSchedulable- Parameters:
context- the contextthrowable- the error- Returns:
- the body of the error mail
-
_getDefinitionFilePath
private String _getDefinitionFilePath(JobExecutionContext context)
-
_getResultFileDownloadLink
private String _getResultFileDownloadLink(Path resultFilePath)
-
-