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 StringATTR_CLIENT_IDName of theauthentication attributefor the client ID.static StringATTR_CLIENT_SECRETName of theauthentication attributefor the client secret.static StringATTR_TANENT_IDDeprecated.UseATTR_TENANT_IDstatic StringATTR_TENANT_IDName of theauthentication attributefor 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.IAuthenticationProviderbuildAuthenticationProvider()protected StringbuildMessage(javax.mail.internet.MimeMessage msg, Mandant client)protected PropertiesbuildProperties()protected javax.mail.internet.MimeMessagecreateMimeMessage(IBaseMailData mail, Mandant client)protected com.microsoft.graph.models.UsersearchUser(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, IBaseMailData mail)protected ISentMailDatasend(com.microsoft.graph.requests.GraphServiceClient<okhttp3.Request> graphClient, javax.mail.internet.MimeMessage msg, IBaseMailData mail, Mandant client)ISendMailReportsendWithReport(IBaseMailData mail)Sends a mail based on the given dataISendMailReportsendWithReport(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 attributefor 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 attributefor the client secret.- See Also:
 - Constant Field Values
 
 
- 
ATTR_CLIENT_ID
public static final String ATTR_CLIENT_ID
Name of theauthentication attributefor the client ID.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
sendWithReport
public ISendMailReport sendWithReport(IBaseMailData mail) throws Exception
Description copied from interface:IMailContextSends a mail based on the given data- Specified by:
 sendWithReportin interfaceIMailContext- Overrides:
 sendWithReportin 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:IMailContextSends a mail based on the given data- Specified by:
 sendWithReportin interfaceIMailContext- Overrides:
 sendWithReportin 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.ClientExceptionjavax.mail.MessagingException
 
- 
buildProperties
protected Properties buildProperties()
- Overrides:
 buildPropertiesin classDefaultMailContext
 
- 
createMimeMessage
protected javax.mail.internet.MimeMessage createMimeMessage(IBaseMailData mail, Mandant client) throws javax.mail.MessagingException
- Overrides:
 createMimeMessagein 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) 
 - 
 
 -