@Component @Named(value="mailstorage") @Singleton public class MailStorageScriptService extends AbstractMailScriptService
componentManagerProvider, execution, mailSender, senderConfiguration, sessionFactory
Constructor and Description |
---|
MailStorageScriptService() |
Modifier and Type | Method and Description |
---|---|
long |
count(Map<String,Object> filterMap)
Count the number of message statuses matching the passed filters.
|
void |
delete(String batchId)
Delete all messages from a batch (both the statuses in the database and the serialized messages on the file
system).
|
void |
delete(String batchId,
String uniqueMessageId)
Delete a message (both the status in the database and the serialized messages on the file system).
|
void |
deleteAll()
Delete all messages having a status in the database and their serialized messages on the file system.
|
MailStorageConfiguration |
getConfiguration() |
protected String |
getErrorKey() |
List<MailStatus> |
load(Map<String,Object> filterMap,
int offset,
int count,
String sortField,
boolean sortAscending)
Loads all message statuses matching the passed filters.
|
MailStatus |
load(String uniqueMessageId)
Load message status for the message matching the given message Id.
|
ScriptMailResult |
resend(String batchId,
String uniqueMessageId)
Resend the serialized MimeMessage synchronously.
|
List<ScriptMailResult> |
resendAsynchronously(Map<String,Object> filterMap,
int offset,
int count)
Resends all mails matching the passed filter map.
|
ScriptMailResult |
resendAsynchronously(String batchId,
String uniqueMessageId)
Resend the serialized MimeMessage asynchronously.
|
getLastError, sendAsynchronously, setError
public ScriptMailResult resend(String batchId, String uniqueMessageId)
batchId
- the name of the directory that contains serialized MimeMessageuniqueMessageId
- the unique id of the serialized MimeMessage@Unstable public ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId)
batchId
- the name of the directory that contains serialized MimeMessageuniqueMessageId
- the unique id of the serialized MimeMessage@Unstable public List<ScriptMailResult> resendAsynchronously(Map<String,Object> filterMap, int offset, int count)
filterMap
- the map of Mail Status parameters to match (e.g. "state", "wiki", "batchId", etc)offset
- the number of rows to skip (0 means don't skip any row)count
- the number of rows to return. If 0 then all rows are returnedpublic MailStatus load(String uniqueMessageId)
uniqueMessageId
- the unique identifier of the message.MailStatus
or null if not allowed or an error happenspublic List<MailStatus> load(Map<String,Object> filterMap, int offset, int count, String sortField, boolean sortAscending)
filterMap
- the map of Mail Status parameters to match (e.g. "status", "wiki", "batchId", etc)offset
- the number of rows to skip (0 means don't skip any row)count
- the number of rows to return. If 0 then all rows are returnedsortField
- the name of the field used to order returned statussortAscending
- when true, sort is done in ascending order of sortField, else in descending orderMailStatus
instances or null if not allowed or an error happenspublic long count(Map<String,Object> filterMap)
filterMap
- the map of Mail Status parameters to match (e.g. "status", "wiki", "batchId", etc)public void delete(String batchId)
batchId
- the id of the batch for which to delete all messages@Unstable public void deleteAll()
public void delete(String batchId, String uniqueMessageId)
batchId
- the id of the batch for the message to deleteuniqueMessageId
- the unique id of the message to deletepublic MailStorageConfiguration getConfiguration()
protected String getErrorKey()
getErrorKey
in class AbstractMailScriptService
Copyright © 2004–2017 XWiki. All rights reserved.