Package org.frankframework.senders
Class SendGridSender
java.lang.Object
org.frankframework.senders.AbstractSender
org.frankframework.senders.AbstractSenderWithParameters
org.frankframework.senders.AbstractMailSender
org.frankframework.senders.SendGridSender
- All Implemented Interfaces:
IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,HasKeystore
,HasTruststore
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
Sender that sends a mail via SendGrid v3 (cloud-based SMTP provider).
Sample XML file can be found in the path: iaf-core/src/test/resources/emailSamplesXML/emailSample.xml
- Author:
- alisihab
-
Nested Class Summary
Nested classes/interfaces inherited from class org.frankframework.senders.AbstractMailSender
AbstractMailSender.EMail, AbstractMailSender.MailAttachmentBase<T>, AbstractMailSender.MailAttachmentStream, AbstractMailSender.MailSessionBase
-
Field Summary
Fields inherited from class org.frankframework.senders.AbstractSenderWithParameters
parameterNamesMustBeUnique, paramList
Fields inherited from class org.frankframework.senders.AbstractSender
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure()
is called once at startup of the framework in the configure method of the owner of this sender.protected SendGridSender.GridMailSession
boolean
boolean
boolean
void
sendEmail
(AbstractMailSender.MailSessionBase mailSession) void
setAllowSelfSignedCertificates
(boolean testModeNoCertificatorCheck) Iftrue
, self signed certificates are acceptedvoid
setFollowRedirects
(boolean b) void
setIgnoreCertificateExpiredException
(boolean ignoreCertificateExpiredException) Iftrue
, CertificateExpiredExceptions are ignoredvoid
setKeyManagerAlgorithm
(String keyManagerAlgorithm) Key manager algorithm.void
setKeystore
(String keystore) Resource url to keystore or certificate.void
setKeystoreAlias
(String keystoreAlias) Alias to obtain specific certificate or key in keystorevoid
setKeystoreAliasAuthAlias
(String keystoreAliasAuthAlias) Authentication alias to authenticate access to certificate or key indicated bykeystoreAlias
void
setKeystoreAliasPassword
(String keystoreAliasPassword) Default password to authenticate access to certificate or key indicated bykeystoreAlias
void
setKeystoreAuthAlias
(String keystoreAuthAlias) Authentication alias used to obtain keystore passwordvoid
setKeystorePassword
(String keystorePassword) Default password to access keystorevoid
setKeystoreType
(KeystoreType keystoreType) Type of keystorevoid
setMaxConnections
(int i) void
setMaxExecuteRetries
(int i) void
setProtocol
(String protocol) void
setProxyAuthAlias
(String string) void
setProxyHost
(String string) void
setProxyPassword
(String string) void
setProxyPort
(int i) void
setProxyRealm
(String string) void
setProxyUsername
(String string) void
setStaleChecking
(boolean b) void
setStaleTimeout
(int timeout) void
setTimeout
(int i) Timeout in milliseconds for socket connection timeout and socket i/o timeoutsvoid
setTrustManagerAlgorithm
(String trustManagerAlgorithm) Trust manager algorithm.void
setTruststore
(String truststore) Resource url to truststore.void
setTruststoreAuthAlias
(String truststoreAuthAlias) Authentication alias used to obtain truststore passwordvoid
setTruststorePassword
(String truststorePassword) Default password to access truststorevoid
setTruststoreType
(KeystoreType truststoreType) Type of truststorevoid
setVerifyHostname
(boolean verifyHostname) Iftrue
, the hostname in the certificate will be checked against the actual hostname of the peervoid
start()
This method will be called to start the sender.void
stop()
Stop/close the sender and deallocate resources.Methods inherited from class org.frankframework.senders.AbstractMailSender
extract, getAuthAlias, getBounceAddress, getCredentialFactory, getDefaultAttachmentName, getDefaultFrom, getDefaultMessageType, getDefaultSubject, getDomainWhitelist, getPassword, getTimeout, getUserId, isDefaultMessageBase64, isSynchronous, sendMessage, setAuthAlias, setBounceAddress, setDefaultAttachmentName, setDefaultFrom, setDefaultMessageBase64, setDefaultMessageType, setDefaultSubject, setDomainWhitelist, setPassword, setUserId
Methods inherited from class org.frankframework.senders.AbstractSenderWithParameters
addParameter, checkStringAttributeOrParameter, consumesSessionVariable, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueList
Methods inherited from class org.frankframework.senders.AbstractSender
createBean, getApplicationContext, getConfigurationClassLoader, getLogPrefix, getName, setApplicationContext, setName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.IConfigurationAware
getApplicationContext, getName
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.IScopeProvider
getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.ISender
sendMessageOrThrow
-
Constructor Details
-
SendGridSender
public SendGridSender()
-
-
Method Details
-
configure
Description copied from interface:ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender. Purpose of this method is to check whether the static configuration of the sender is correct. As much as possible class-instantiating should take place in theconfigure()
oropen()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classAbstractMailSender
- Throws:
ConfigurationException
-
start
public void start()Description copied from interface:ISender
This method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in thesendMessage()
method.- Specified by:
start
in interfaceISender
- Overrides:
start
in classAbstractSender
-
stop
public void stop()Description copied from interface:ISender
Stop/close the sender and deallocate resources.- Specified by:
stop
in interfaceISender
- Overrides:
stop
in classAbstractSender
-
sendEmail
- Specified by:
sendEmail
in classAbstractMailSender
- Throws:
SenderException
-
createMailSession
- Specified by:
createMailSession
in classAbstractMailSender
- Throws:
SenderException
-
setTimeout
Description copied from class:AbstractMailSender
Timeout in milliseconds for socket connection timeout and socket i/o timeouts- Overrides:
setTimeout
in classAbstractMailSender
-
setMaxConnections
-
setMaxExecuteRetries
-
setProxyHost
-
setProxyPort
-
setProxyAuthAlias
-
setProxyUsername
-
setProxyPassword
-
setProxyRealm
-
setKeystore
Description copied from interface:HasKeystore
Resource url to keystore or certificate. If none specified, the JVMs default keystore will be used.- Specified by:
setKeystore
in interfaceHasKeystore
-
getKeystore
- Specified by:
getKeystore
in interfaceHasKeystore
-
setKeystoreType
Description copied from interface:HasKeystore
Type of keystore- Specified by:
setKeystoreType
in interfaceHasKeystore
-
getKeystoreType
- Specified by:
getKeystoreType
in interfaceHasKeystore
-
setKeystoreAuthAlias
Description copied from interface:HasKeystore
Authentication alias used to obtain keystore password- Specified by:
setKeystoreAuthAlias
in interfaceHasKeystore
-
getKeystoreAuthAlias
- Specified by:
getKeystoreAuthAlias
in interfaceHasKeystore
-
setKeystorePassword
Description copied from interface:HasKeystore
Default password to access keystore- Specified by:
setKeystorePassword
in interfaceHasKeystore
-
getKeystorePassword
- Specified by:
getKeystorePassword
in interfaceHasKeystore
-
setKeystoreAlias
Description copied from interface:HasKeystore
Alias to obtain specific certificate or key in keystore- Specified by:
setKeystoreAlias
in interfaceHasKeystore
-
getKeystoreAlias
- Specified by:
getKeystoreAlias
in interfaceHasKeystore
-
setKeystoreAliasAuthAlias
@ReferTo(AbstractHttpSession.class) public void setKeystoreAliasAuthAlias(String keystoreAliasAuthAlias) Description copied from interface:HasKeystore
Authentication alias to authenticate access to certificate or key indicated bykeystoreAlias
- Specified by:
setKeystoreAliasAuthAlias
in interfaceHasKeystore
-
getKeystoreAliasAuthAlias
- Specified by:
getKeystoreAliasAuthAlias
in interfaceHasKeystore
-
setKeystoreAliasPassword
@ReferTo(AbstractHttpSession.class) public void setKeystoreAliasPassword(String keystoreAliasPassword) Description copied from interface:HasKeystore
Default password to authenticate access to certificate or key indicated bykeystoreAlias
- Specified by:
setKeystoreAliasPassword
in interfaceHasKeystore
-
getKeystoreAliasPassword
- Specified by:
getKeystoreAliasPassword
in interfaceHasKeystore
-
setKeyManagerAlgorithm
Description copied from interface:HasKeystore
Key manager algorithm. Can be left empty to use the servers default algorithm- Specified by:
setKeyManagerAlgorithm
in interfaceHasKeystore
-
getKeyManagerAlgorithm
- Specified by:
getKeyManagerAlgorithm
in interfaceHasKeystore
-
setTruststore
Description copied from interface:HasTruststore
Resource url to truststore. If none specified, the JVMs default truststore will be used.- Specified by:
setTruststore
in interfaceHasTruststore
-
getTruststore
- Specified by:
getTruststore
in interfaceHasTruststore
-
setTruststoreType
Description copied from interface:HasTruststore
Type of truststore- Specified by:
setTruststoreType
in interfaceHasTruststore
-
getTruststoreType
- Specified by:
getTruststoreType
in interfaceHasTruststore
-
setTruststoreAuthAlias
Description copied from interface:HasTruststore
Authentication alias used to obtain truststore password- Specified by:
setTruststoreAuthAlias
in interfaceHasTruststore
-
getTruststoreAuthAlias
- Specified by:
getTruststoreAuthAlias
in interfaceHasTruststore
-
setTruststorePassword
Description copied from interface:HasTruststore
Default password to access truststore- Specified by:
setTruststorePassword
in interfaceHasTruststore
-
getTruststorePassword
- Specified by:
getTruststorePassword
in interfaceHasTruststore
-
setTrustManagerAlgorithm
@ReferTo(AbstractHttpSession.class) public void setTrustManagerAlgorithm(String trustManagerAlgorithm) Description copied from interface:HasTruststore
Trust manager algorithm. Can be left empty to use the servers default algorithm- Specified by:
setTrustManagerAlgorithm
in interfaceHasTruststore
-
getTrustManagerAlgorithm
- Specified by:
getTrustManagerAlgorithm
in interfaceHasTruststore
-
setVerifyHostname
Description copied from interface:HasTruststore
Iftrue
, the hostname in the certificate will be checked against the actual hostname of the peer- Specified by:
setVerifyHostname
in interfaceHasTruststore
-
isVerifyHostname
public boolean isVerifyHostname()- Specified by:
isVerifyHostname
in interfaceHasTruststore
-
setAllowSelfSignedCertificates
@ReferTo(AbstractHttpSession.class) public void setAllowSelfSignedCertificates(boolean testModeNoCertificatorCheck) Description copied from interface:HasTruststore
Iftrue
, self signed certificates are accepted- Specified by:
setAllowSelfSignedCertificates
in interfaceHasTruststore
-
isAllowSelfSignedCertificates
public boolean isAllowSelfSignedCertificates()- Specified by:
isAllowSelfSignedCertificates
in interfaceHasTruststore
-
setIgnoreCertificateExpiredException
@ReferTo(AbstractHttpSession.class) public void setIgnoreCertificateExpiredException(boolean ignoreCertificateExpiredException) Description copied from interface:HasTruststore
Iftrue
, CertificateExpiredExceptions are ignored- Specified by:
setIgnoreCertificateExpiredException
in interfaceHasTruststore
-
isIgnoreCertificateExpiredException
public boolean isIgnoreCertificateExpiredException()- Specified by:
isIgnoreCertificateExpiredException
in interfaceHasTruststore
-
setFollowRedirects
-
setStaleChecking
-
setStaleTimeout
-
setProtocol
-