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:
FrankElement,HasApplicationContext,HasName,IConfigurable,IScopeProvider,ISender,ISenderWithParameters,IWithParameters,NameAware,HasKeystore,HasTruststore,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle
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 ClassesNested 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, paramListFields inherited from class org.frankframework.senders.AbstractSender
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigure this component.protected SendGridSender.GridMailSessionbooleanbooleanbooleanvoidsendEmail(AbstractMailSender.MailSessionBase mailSession) voidsetAllowSelfSignedCertificates(boolean testModeNoCertificatorCheck) Iftrue, self signed certificates are acceptedvoidsetFollowRedirects(boolean b) voidsetIgnoreCertificateExpiredException(boolean ignoreCertificateExpiredException) Iftrue, CertificateExpiredExceptions are ignoredvoidsetKeyManagerAlgorithm(String keyManagerAlgorithm) Key manager algorithm.voidsetKeystore(String keystore) Resource url to keystore or certificate.voidsetKeystoreAlias(String keystoreAlias) Alias to obtain specific certificate or key in keystorevoidsetKeystoreAliasAuthAlias(String keystoreAliasAuthAlias) Authentication alias to authenticate access to certificate or key indicated bykeystoreAliasvoidsetKeystoreAliasPassword(String keystoreAliasPassword) Default password to authenticate access to certificate or key indicated bykeystoreAliasvoidsetKeystoreAuthAlias(String keystoreAuthAlias) Authentication alias used to obtain keystore passwordvoidsetKeystorePassword(String keystorePassword) Default password to access keystorevoidsetKeystoreType(KeystoreType keystoreType) Type of keystorevoidsetMaxConnections(int i) voidsetMaxExecuteRetries(int i) voidsetProtocol(String protocol) voidsetProxyAuthAlias(String string) voidsetProxyHost(String string) voidsetProxyPassword(String string) voidsetProxyPort(int i) voidsetProxyRealm(String string) voidsetProxyUsername(String string) voidsetStaleChecking(boolean b) voidsetStaleTimeout(int timeout) voidsetTimeout(int i) Timeout in milliseconds for socket connection timeout and socket i/o timeoutsvoidsetTrustManagerAlgorithm(String trustManagerAlgorithm) Trust manager algorithm.voidsetTruststore(String truststore) Resource url to truststore.voidsetTruststoreAuthAlias(String truststoreAuthAlias) Authentication alias used to obtain truststore passwordvoidsetTruststorePassword(String truststorePassword) Default password to access truststorevoidsetTruststoreType(KeystoreType truststoreType) Type of truststorevoidsetVerifyHostname(boolean verifyHostname) Iftrue, the hostname in the certificate will be checked against the actual hostname of the peervoidstart()This method will be called to start the sender.voidstop()Stop/close the sender and deallocate resources.Methods inherited from class org.frankframework.senders.AbstractMailSender
extract, isSynchronous, sendMessage, setAuthAlias, setBounceAddress, setDefaultAttachmentName, setDefaultFrom, setDefaultMessageBase64, setDefaultMessageType, setDefaultSubject, setDomainWhitelist, setPassword, setUserIdMethods inherited from class org.frankframework.senders.AbstractSenderWithParameters
addParameter, checkStringAttributeOrParameter, consumesSessionVariable, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueListMethods inherited from class org.frankframework.senders.AbstractSender
createBean, getLogPrefix, getName, isRunning, setApplicationContext, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.core.ISender
sendMessageOrThrow
-
Constructor Details
-
SendGridSender
public SendGridSender()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classAbstractMailSender- Throws:
ConfigurationException- in case it was not able to configure the component.
-
start
public void start()Description copied from interface:ISenderThis 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:
startin interfaceISender- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Overrides:
startin classAbstractSender
-
stop
public void stop()Description copied from interface:ISenderStop/close the sender and deallocate resources.- Specified by:
stopin interfaceISender- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Overrides:
stopin classAbstractSender
-
sendEmail
- Specified by:
sendEmailin classAbstractMailSender- Throws:
SenderException
-
createMailSession
- Specified by:
createMailSessionin classAbstractMailSender- Throws:
SenderException
-
setTimeout
Description copied from class:AbstractMailSenderTimeout in milliseconds for socket connection timeout and socket i/o timeouts- Overrides:
setTimeoutin classAbstractMailSender
-
setMaxConnections
-
setMaxExecuteRetries
-
setProxyHost
-
setProxyPort
-
setProxyAuthAlias
-
setProxyUsername
-
setProxyPassword
-
setProxyRealm
-
setKeystore
Description copied from interface:HasKeystoreResource url to keystore or certificate. If none specified, the JVMs default keystore will be used.- Specified by:
setKeystorein interfaceHasKeystore
-
getKeystore
- Specified by:
getKeystorein interfaceHasKeystore
-
setKeystoreType
Description copied from interface:HasKeystoreType of keystore- Specified by:
setKeystoreTypein interfaceHasKeystore
-
getKeystoreType
- Specified by:
getKeystoreTypein interfaceHasKeystore
-
setKeystoreAuthAlias
Description copied from interface:HasKeystoreAuthentication alias used to obtain keystore password- Specified by:
setKeystoreAuthAliasin interfaceHasKeystore
-
getKeystoreAuthAlias
- Specified by:
getKeystoreAuthAliasin interfaceHasKeystore
-
setKeystorePassword
Description copied from interface:HasKeystoreDefault password to access keystore- Specified by:
setKeystorePasswordin interfaceHasKeystore
-
getKeystorePassword
- Specified by:
getKeystorePasswordin interfaceHasKeystore
-
setKeystoreAlias
Description copied from interface:HasKeystoreAlias to obtain specific certificate or key in keystore- Specified by:
setKeystoreAliasin interfaceHasKeystore
-
getKeystoreAlias
- Specified by:
getKeystoreAliasin interfaceHasKeystore
-
setKeystoreAliasAuthAlias
@ReferTo(AbstractHttpSession.class) public void setKeystoreAliasAuthAlias(String keystoreAliasAuthAlias) Description copied from interface:HasKeystoreAuthentication alias to authenticate access to certificate or key indicated bykeystoreAlias- Specified by:
setKeystoreAliasAuthAliasin interfaceHasKeystore
-
getKeystoreAliasAuthAlias
- Specified by:
getKeystoreAliasAuthAliasin interfaceHasKeystore
-
setKeystoreAliasPassword
@ReferTo(AbstractHttpSession.class) public void setKeystoreAliasPassword(String keystoreAliasPassword) Description copied from interface:HasKeystoreDefault password to authenticate access to certificate or key indicated bykeystoreAlias- Specified by:
setKeystoreAliasPasswordin interfaceHasKeystore
-
getKeystoreAliasPassword
- Specified by:
getKeystoreAliasPasswordin interfaceHasKeystore
-
setKeyManagerAlgorithm
Description copied from interface:HasKeystoreKey manager algorithm. Can be left empty to use the servers default algorithm- Specified by:
setKeyManagerAlgorithmin interfaceHasKeystore
-
getKeyManagerAlgorithm
- Specified by:
getKeyManagerAlgorithmin interfaceHasKeystore
-
setTruststore
Description copied from interface:HasTruststoreResource url to truststore. If none specified, the JVMs default truststore will be used.- Specified by:
setTruststorein interfaceHasTruststore
-
getTruststore
- Specified by:
getTruststorein interfaceHasTruststore
-
setTruststoreType
Description copied from interface:HasTruststoreType of truststore- Specified by:
setTruststoreTypein interfaceHasTruststore
-
getTruststoreType
- Specified by:
getTruststoreTypein interfaceHasTruststore
-
setTruststoreAuthAlias
Description copied from interface:HasTruststoreAuthentication alias used to obtain truststore password- Specified by:
setTruststoreAuthAliasin interfaceHasTruststore
-
getTruststoreAuthAlias
- Specified by:
getTruststoreAuthAliasin interfaceHasTruststore
-
setTruststorePassword
Description copied from interface:HasTruststoreDefault password to access truststore- Specified by:
setTruststorePasswordin interfaceHasTruststore
-
getTruststorePassword
- Specified by:
getTruststorePasswordin interfaceHasTruststore
-
setTrustManagerAlgorithm
@ReferTo(AbstractHttpSession.class) public void setTrustManagerAlgorithm(String trustManagerAlgorithm) Description copied from interface:HasTruststoreTrust manager algorithm. Can be left empty to use the servers default algorithm- Specified by:
setTrustManagerAlgorithmin interfaceHasTruststore
-
getTrustManagerAlgorithm
- Specified by:
getTrustManagerAlgorithmin interfaceHasTruststore
-
setVerifyHostname
Description copied from interface:HasTruststoreIftrue, the hostname in the certificate will be checked against the actual hostname of the peer- Specified by:
setVerifyHostnamein interfaceHasTruststore
-
isVerifyHostname
public boolean isVerifyHostname()- Specified by:
isVerifyHostnamein interfaceHasTruststore
-
setAllowSelfSignedCertificates
@ReferTo(AbstractHttpSession.class) public void setAllowSelfSignedCertificates(boolean testModeNoCertificatorCheck) Description copied from interface:HasTruststoreIftrue, self signed certificates are accepted- Specified by:
setAllowSelfSignedCertificatesin interfaceHasTruststore
-
isAllowSelfSignedCertificates
public boolean isAllowSelfSignedCertificates()- Specified by:
isAllowSelfSignedCertificatesin interfaceHasTruststore
-
setIgnoreCertificateExpiredException
@ReferTo(AbstractHttpSession.class) public void setIgnoreCertificateExpiredException(boolean ignoreCertificateExpiredException) Description copied from interface:HasTruststoreIftrue, CertificateExpiredExceptions are ignored- Specified by:
setIgnoreCertificateExpiredExceptionin interfaceHasTruststore
-
isIgnoreCertificateExpiredException
public boolean isIgnoreCertificateExpiredException()- Specified by:
isIgnoreCertificateExpiredExceptionin interfaceHasTruststore
-
setFollowRedirects
-
setStaleChecking
-
setStaleTimeout
-
setProtocol
-