public class EmailActionExecutor extends ActionExecutor
Modifier and Type | Class and Description |
---|---|
static class |
EmailActionExecutor.JavaMailAuthenticator |
ActionExecutor.Context, ActionExecutor.RETRYPOLICY
Modifier and Type | Field and Description |
---|---|
static String |
CONF_PREFIX |
static String |
EMAIL_ATTACHMENT_ENABLED |
static String |
EMAIL_ATTACHMENT_ERROR_MSG |
static String |
EMAIL_SMTP_AUTH |
static String |
EMAIL_SMTP_FROM |
static String |
EMAIL_SMTP_HOST |
static String |
EMAIL_SMTP_PASS |
static String |
EMAIL_SMTP_PORT |
static String |
EMAIL_SMTP_USER |
ACTION_RETRY_INTERVAL, ACTION_RETRY_POLICY, ERROR_OTHER, MAX_RETRIES, requiresNNJT, RETRY_INTERVAL
Constructor and Description |
---|
EmailActionExecutor() |
Modifier and Type | Method and Description |
---|---|
void |
check(ActionExecutor.Context context,
WorkflowAction action)
Check if an action has completed.
|
void |
email(String[] to,
String[] cc,
String subject,
String body,
String[] attachments,
String contentType,
String user) |
void |
end(ActionExecutor.Context context,
WorkflowAction action)
End an action after it has executed.
|
void |
initActionType()
Invoked once at system initialization time.
|
boolean |
isCompleted(String externalStatus)
Return if the external status indicates that the action has completed.
|
void |
kill(ActionExecutor.Context context,
WorkflowAction action)
Kill an action.
|
void |
start(ActionExecutor.Context context,
WorkflowAction action)
Start an action.
|
protected void |
validateAndMail(ActionExecutor.Context context,
org.jdom.Element element) |
convertException, disableInit, enableInit, getActionDir, getActionDirPath, getActionSignal, getMaxRetries, getOozieConf, getOozieRuntimeDir, getOozieSystemId, getRetryInterval, getRetryPolicy, getType, registerError, resetInitInfo, setMaxRetries, setRetryInterval, setRetryPolicy
public static final String CONF_PREFIX
public static final String EMAIL_SMTP_HOST
public static final String EMAIL_SMTP_PORT
public static final String EMAIL_SMTP_AUTH
public static final String EMAIL_SMTP_USER
public static final String EMAIL_SMTP_PASS
public static final String EMAIL_SMTP_FROM
public static final String EMAIL_ATTACHMENT_ENABLED
public static final String EMAIL_ATTACHMENT_ERROR_MSG
public EmailActionExecutor()
public void initActionType()
ActionExecutor
ActionExecutor.registerError(java.lang.String, org.apache.oozie.action.ActionExecutorException.ErrorType, java.lang.String)
method to register
all its possible errors. Subclasses overriding must invoke super.initActionType
in class ActionExecutor
public void start(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
ActionExecutor
ActionExecutor.Context.setStartData(java.lang.String, java.lang.String, java.lang.String)
method must be called within this method. If the
action has completed, the ActionExecutor.Context.setExecutionData(java.lang.String, java.util.Properties)
method must be called within this method.start
in class ActionExecutor
context
- executor context.action
- the action to start.ActionExecutorException
- thrown if the action could not start.protected void validateAndMail(ActionExecutor.Context context, org.jdom.Element element) throws ActionExecutorException
ActionExecutorException
public void email(String[] to, String[] cc, String subject, String body, String[] attachments, String contentType, String user) throws ActionExecutorException
ActionExecutorException
public void end(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
ActionExecutor
ActionExecutor.Context.setEndData(org.apache.oozie.client.WorkflowAction.Status, java.lang.String)
method must be called within this
method.end
in class ActionExecutor
context
- executor context.action
- the action to end.ActionExecutorException
- thrown if the action could not end.public void check(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
ActionExecutor
ActionExecutor.Context.setExecutionData(java.lang.String, java.util.Properties)
method must be called within this method. If the action
has not completed, the ActionExecutor.Context.setExternalStatus(java.lang.String)
method must be called within this method.check
in class ActionExecutor
context
- executor context.action
- the action to end.ActionExecutorException
- thrown if the action could not be checked.public void kill(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
ActionExecutor
ActionExecutor.Context.setEndData(org.apache.oozie.client.WorkflowAction.Status, java.lang.String)
method must be called within this method.kill
in class ActionExecutor
context
- executor context.action
- the action to kill.ActionExecutorException
- thrown if the action could not be killed.public boolean isCompleted(String externalStatus)
ActionExecutor
isCompleted
in class ActionExecutor
externalStatus
- external status to check.Copyright © 2015 Apache Software Foundation. All Rights Reserved.