public class MailAPI extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.http.Header |
acceptJsonHeader
The accept json header.
|
protected org.apache.http.impl.client.CloseableHttpClient |
httpClient
The http client.
|
protected org.apache.http.client.protocol.HttpClientContext |
httpContext
The http context.
|
protected static org.exoplatform.services.log.Log |
LOG
The Constant LOG.
|
protected static String |
MODELS_ERROR
The Constant MODELS_ERROR.
|
protected static String |
READ_ATTACHMENT_ERROR
The Constant READ_ATTACHMENT_ERROR.
|
protected static String |
READ_MESSAGE_ERROR
The Constant READ_MESSAGE_ERROR.
|
| Constructor and Description |
|---|
MailAPI()
Instantiates a new mail API.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkError(org.apache.http.HttpResponse response,
String errorBase)
Check error.
|
void |
close()
Close.
|
org.exoplatform.ws.frameworks.json.value.JsonValue |
getAttachment(OutlookUser user,
String messageId,
String attachmentToken,
String attachmentId)
Gets the attachment.
|
org.exoplatform.ws.frameworks.json.value.JsonValue |
getMessage(OutlookUser user,
String messageId,
String messageToken)
Gets the message.
|
protected org.exoplatform.ws.frameworks.json.value.JsonValue |
readJson(InputStream content)
Read json.
|
protected String |
readText(org.apache.http.HttpEntity entity)
Read text.
|
void |
reset()
Reset.
|
protected static final org.exoplatform.services.log.Log LOG
protected static final String READ_ATTACHMENT_ERROR
protected static final String READ_MESSAGE_ERROR
protected static final String MODELS_ERROR
protected final org.apache.http.impl.client.CloseableHttpClient httpClient
protected final org.apache.http.client.protocol.HttpClientContext httpContext
protected final org.apache.http.Header acceptJsonHeader
public MailAPI()
throws MailServerException
MailServerException - the mail server exceptionpublic void close()
throws MailServerException
MailServerException - the mail server exceptionpublic void reset()
public org.exoplatform.ws.frameworks.json.value.JsonValue getAttachment(OutlookUser user, String messageId, String attachmentToken, String attachmentId) throws BadCredentialsException, ForbiddenException, MailServerException
user - the usermessageId - the message idattachmentToken - the attachment tokenattachmentId - the attachment idBadCredentialsException - the bad credentials exceptionForbiddenException - the forbidden exceptionMailServerException - the mail server exceptionpublic org.exoplatform.ws.frameworks.json.value.JsonValue getMessage(OutlookUser user, String messageId, String messageToken) throws BadCredentialsException, ForbiddenException, MailServerException
user - the usermessageId - the message idmessageToken - the message tokenBadCredentialsException - the bad credentials exceptionForbiddenException - the forbidden exceptionMailServerException - the mail server exceptionprotected org.exoplatform.ws.frameworks.json.value.JsonValue readJson(InputStream content) throws org.exoplatform.ws.frameworks.json.impl.JsonException
content - the contentorg.exoplatform.ws.frameworks.json.impl.JsonException - the json exceptionprotected String readText(org.apache.http.HttpEntity entity)
entity - the entityprotected void checkError(org.apache.http.HttpResponse response,
String errorBase)
throws BadCredentialsException,
ForbiddenException,
MailServerException
response - the responseerrorBase - the error baseBadCredentialsException - the bad credentials exceptionForbiddenException - the forbidden exceptionMailServerException - the mail server exceptionCopyright © 2003–2020 eXo Platform SAS. All rights reserved.