public class Email extends BioModuleImpl implements ApiModule
Modifier and Type | Field and Description |
---|---|
protected static String |
EMAIL_ENCRYPTED_PASSWORD
Config String property: "mail.encryptedPassword" |
protected static String |
EMAIL_FROM
Config String property: "mail.from" |
protected static String |
EMAIL_HOST
|
protected static String |
EMAIL_PORT
|
protected static String |
EMAIL_SMTP_AUTH
Config Boolean property: "mail.smtp.auth"Session SMTP authorization flag, set to "Y" if required by
"mail.smtp.host" |
protected static String |
EMAIL_START_TLS_ENABLE
Config Boolean property: "mail.smtp.starttls.enable"Session SMTP TLS enable flag, set to "Y" if required by
"mail.smtp.host" |
protected static String |
EMAIL_TO
Config List property: "mail.to" This property defines the email recipients |
GZIP_EXT, LOG_EXT, PDF_EXT, RETURN, SH_EXT, TAB_DELIM, TSV_EXT, TXT_EXT
LOG_DIR, MAIN_SCRIPT_PREFIX, NO_VERSION, OUTPUT_DIR, RES_DIR, TEMP_DIR
Constructor and Description |
---|
Email() |
Modifier and Type | Method and Description |
---|---|
void |
checkDependencies()
Verify required email
Config properties exist and are properly formatted. |
(package private) String |
decrypt(String val)
Used to authenticate the service email account defined in EMAIL_FROM.
|
protected static String |
encrypt(String password)
Encrypt clear-text password
|
static void |
encryptAndStoreEmailPassword()
Read clear-text password by call to
RuntimeParamUtil.getAdminEmailPassword() Encrypt password by call to encrypt(String) |
void |
executeTask()
|
String |
getCitationString()
At a minimum, this should return the name and/or url for the wrapped tool.
|
String |
getDescription()
Briefly describe what this module does.
|
String |
getDockerImageName()
Get the docker image to use for this module.
|
String |
getDockerImageOwner()
Get the name of the docker hub user that owns the image to use for this module.
|
protected javax.mail.Session |
getSession()
Build an authenticated javax.mail.Session using
Config email properties |
String |
getSummary()
Summary simply reports the status.
|
String |
version()
Changes to a module class should be accompanied by a increment in version.
|
addGeneralProperty, addGeneralProperty, addGeneralProperty, addNewProperty, addNewProperty, cacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getAlias, getDescription, getDetails, getDockerImageTag, getFileCache, getID, getInputFiles, getLogDir, getMenuPlacement, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getPropDescMap, getPropType, getPropTypeMap, getResourceDir, getTempDir, getTitle, hashCode, init, isValidInputModule, isValidProp, listProps, setAlias, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDescription, getDetails, getMenuPlacement, getPropType, getTitle, isValidProp, listProps
cleanUp, getAlias, getDockerImageTag, getID, getInputFiles, getLogDir, getMetadata, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getPropDefault, getResourceDir, getTempDir, init, isValidInputModule, setAlias
protected static final String EMAIL_ENCRYPTED_PASSWORD
Config
String property: "mail.encryptedPassword"protected static final String EMAIL_FROM
Config
String property: "mail.from"protected static final String EMAIL_HOST
protected static final String EMAIL_PORT
protected static final String EMAIL_SMTP_AUTH
Config
Boolean property: "mail.smtp.auth"Session
SMTP authorization flag, set to "Y" if required by
"mail.smtp.host"protected static final String EMAIL_START_TLS_ENABLE
Config
Boolean property: "mail.smtp.starttls.enable"Session
SMTP TLS enable flag, set to "Y" if required by
"mail.smtp.host"protected static final String EMAIL_TO
Config
List property: "mail.to" This property defines the email recipientspublic void checkDependencies() throws Exception
Config
properties exist and are properly formatted.
Config
.EMAIL_HOST
Config
.EMAIL_PORT
Config
.EMAIL_SMTP_AUTH
Config
.EMAIL_START_TLS_ENABLE
Config
.EMAIL_ENCRYPTED_PASSWORD
Config
.EMAIL_FROM
is a valid email address
Config
.EMAIL_TO
is a valid email address
checkDependencies
in interface BioModule
checkDependencies
in class BioModuleImpl
Exception
- thrown if missing or invalid dependencies are foundpublic void executeTask() throws Exception
Config
."mail.to"executeTask
in interface BioModule
executeTask
in class BioModuleImpl
Exception
- thrown if the module is unable to complete is taskpublic String getSummary() throws Exception
getSummary
in interface BioModule
getSummary
in class BioModuleImpl
Exception
- if any error occursString decrypt(String val)
val
- Encrypted passwordprotected javax.mail.Session getSession() throws Exception
Config
email propertiespublic static void encryptAndStoreEmailPassword() throws Exception
RuntimeParamUtil.getAdminEmailPassword()
encrypt(String)
Exception
- if unable to encrypt or store passwordprotected static String encrypt(String password) throws GeneralSecurityException, UnsupportedEncodingException
password
- Clear-text passwordGeneralSecurityException
- Encryption errorUnsupportedEncodingException
- Encryption errorpublic String getDockerImageOwner()
BioModule
getDockerImageOwner
in interface BioModule
getDockerImageOwner
in class BioModuleImpl
public String getDockerImageName()
BioModule
getDockerImageName
in interface BioModule
public String getDescription()
ApiModule
getDetails
.getDescription
in interface ApiModule
public String getCitationString()
ApiModule
getCitationString
in interface ApiModule