Package de.xima.fc.mail.impl.context
Class MSGraphMailContext
- java.lang.Object
-
- de.xima.fc.mail.impl.context.DefaultMailContext
-
- de.xima.fc.mail.impl.context.MSGraphMailContext
-
- All Implemented Interfaces:
IMailContext
public class MSGraphMailContext extends DefaultMailContext implements IMailContext
Mail context for sending MIME mails via the ms graph api- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_CLIENT_ID
Name of theauthentication attribute
for the client ID.static String
ATTR_CLIENT_SECRET
Name of theauthentication attribute
for the client secret.static String
ATTR_TANENT_ID
Deprecated.UseATTR_TENANT_ID
static String
ATTR_TENANT_ID
Name of theauthentication attribute
for the tenant ID-
Fields inherited from class de.xima.fc.mail.impl.context.DefaultMailContext
addressFilter, serverData
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.microsoft.graph.authentication.IAuthenticationProvider
buildAuthenticationProvider()
protected String
buildMessage(javax.mail.internet.MimeMessage msg, Mandant client)
protected Properties
buildProperties()
protected javax.mail.internet.MimeMessage
createMimeMessage(IBaseMailData mail, Mandant client)
protected com.microsoft.graph.models.User
searchUser(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, IBaseMailData mail)
protected ISentMailData
send(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, javax.mail.internet.MimeMessage msg, IBaseMailData mail, Mandant client)
ISendMailReport
sendWithReport(IBaseMailData mail)
Sends a mail based on the given dataISendMailReport
sendWithReport(IBaseMailData mailData, Mandant client)
Sends a mail based on the given data-
Methods inherited from class de.xima.fc.mail.impl.context.DefaultMailContext
archive, buildAndSendMessage, buildAuthenticator, buildBodyPart, buildContent, buildFilePart, createMimeMessage, enforceSenderAddress, filterAddresses, getServerData, setAddressFilter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.mail.interfaces.IMailContext
archive, getServerData, send, send, setAddressFilter, setAddressFilter
-
-
-
-
Field Detail
-
ATTR_TENANT_ID
public static final String ATTR_TENANT_ID
Name of theauthentication attribute
for the tenant ID- See Also:
- Constant Field Values
-
ATTR_TANENT_ID
public static final String ATTR_TANENT_ID
Deprecated.UseATTR_TENANT_ID
- See Also:
- Constant Field Values
-
ATTR_CLIENT_SECRET
public static final String ATTR_CLIENT_SECRET
Name of theauthentication attribute
for the client secret.- See Also:
- Constant Field Values
-
ATTR_CLIENT_ID
public static final String ATTR_CLIENT_ID
Name of theauthentication attribute
for the client ID.- See Also:
- Constant Field Values
-
-
Method Detail
-
sendWithReport
public ISendMailReport sendWithReport(IBaseMailData mail) throws Exception
Description copied from interface:IMailContext
Sends a mail based on the given data- Specified by:
sendWithReport
in interfaceIMailContext
- Overrides:
sendWithReport
in classDefaultMailContext
- Parameters:
mail
- Data with the mail or mails to sent.- Returns:
- Information about the mails that were actually sent.
- Throws:
Exception
- When the mail could not be sent, e.g. due to network errors or invalid mail addresses.
-
sendWithReport
public ISendMailReport sendWithReport(IBaseMailData mailData, Mandant client) throws Exception
Description copied from interface:IMailContext
Sends a mail based on the given data- Specified by:
sendWithReport
in interfaceIMailContext
- Overrides:
sendWithReport
in classDefaultMailContext
- Parameters:
mailData
- Data with the mail or mails to sent.client
- The client scope to use for placeholder replacements- Returns:
- Information about the mails that were actually sent.
- Throws:
Exception
- When the mail could not be sent, e.g. due to network errors or invalid mail addresses.
-
buildMessage
protected String buildMessage(javax.mail.internet.MimeMessage msg, Mandant client) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
send
protected ISentMailData send(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, javax.mail.internet.MimeMessage msg, IBaseMailData mail, Mandant client) throws com.microsoft.graph.core.ClientException, javax.mail.MessagingException
- Throws:
com.microsoft.graph.core.ClientException
javax.mail.MessagingException
-
buildProperties
protected Properties buildProperties()
- Overrides:
buildProperties
in classDefaultMailContext
-
createMimeMessage
protected javax.mail.internet.MimeMessage createMimeMessage(IBaseMailData mail, Mandant client) throws javax.mail.MessagingException
- Overrides:
createMimeMessage
in classDefaultMailContext
- Throws:
javax.mail.MessagingException
-
buildAuthenticationProvider
protected com.microsoft.graph.authentication.IAuthenticationProvider buildAuthenticationProvider()
-
searchUser
protected com.microsoft.graph.models.User searchUser(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, IBaseMailData mail)
-
-