|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.management.impl.SpoolManagement
public class SpoolManagement
high-level management of spool contents like list, remove, resend
Field Summary |
---|
Fields inherited from interface org.apache.james.management.SpoolManagementService |
---|
ROLE |
Constructor Summary | |
---|---|
SpoolManagement()
|
Method Summary | |
---|---|
protected boolean |
filterMatches(org.apache.mailet.Mail mail,
SpoolFilter filter)
Return true if the given Mail match the given SpoolFilter |
java.util.List |
getSpoolItems(java.lang.String spoolRepositoryURL,
SpoolFilter filter)
Return a List which contains all mails which can accessed by given spoolRepositoryUrl and matched the given SpoolFilter |
java.lang.String[] |
listSpoolItems(java.lang.String spoolRepositoryURL,
SpoolFilter filter)
Lists all mails from the given repository matching the given filter criteria |
java.lang.String[] |
listSpoolItems(java.lang.String spoolRepositoryURL,
java.lang.String state,
java.lang.String header,
java.lang.String headerValueRegex)
Lists all mails from the given repository matching the given filter criteria |
int |
moveSpoolItems(java.lang.String srcSpoolRepositoryURL,
java.lang.String dstSpoolRepositoryURL,
java.lang.String dstState,
SpoolFilter filter)
Move all mails from the given repository to another repository matching the given filter criteria |
int |
moveSpoolItems(java.lang.String srcSpoolRepositoryURL,
java.lang.String srcState,
java.lang.String dstSpoolRepositoryURL,
java.lang.String dstState,
java.lang.String header,
java.lang.String headerValueRegex)
Move all mails from the given repository to another repository matching the given filter criteria |
int |
removeSpoolItems(java.lang.String spoolRepositoryURL,
java.lang.String key,
java.util.List lockingFailures,
SpoolFilter filter)
Removes all mails from the given repository matching the filter |
int |
removeSpoolItems(java.lang.String spoolRepositoryURL,
java.lang.String key,
SpoolFilter filter)
Removes all mails from the given repository matching the filter |
int |
removeSpoolItems(java.lang.String spoolRepositoryURL,
java.lang.String key,
java.lang.String state,
java.lang.String header,
java.lang.String headerValueRegex)
Removes one specific or all mails from the given spool repository matching the given criteria |
int |
resendSpoolItems(java.lang.String spoolRepositoryURL,
java.lang.String key,
java.util.List lockingFailures,
SpoolFilter filter)
Tries to resend all mails from the given repository matching the given filter criteria |
int |
resendSpoolItems(java.lang.String spoolRepositoryURL,
java.lang.String key,
SpoolFilter filter)
Tries to resend all mails from the given repository matching the given filter criteria |
int |
resendSpoolItems(java.lang.String spoolRepositoryURL,
java.lang.String key,
java.lang.String state,
java.lang.String header,
java.lang.String headerValueRegex)
Tries to resend all mails from the given repository matching the given filter criteria |
void |
service(org.apache.avalon.framework.service.ServiceManager serviceManager)
|
void |
setStore(org.apache.avalon.cornerstone.services.store.Store mailStore)
Set the Store |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpoolManagement()
Method Detail |
---|
public void setStore(org.apache.avalon.cornerstone.services.store.Store mailStore)
mailStore
- the storepublic void service(org.apache.avalon.framework.service.ServiceManager serviceManager) throws org.apache.avalon.framework.service.ServiceException
service
in interface org.apache.avalon.framework.service.Serviceable
org.apache.avalon.framework.service.ServiceException
Serviceable.service(ServiceManager)
public int moveSpoolItems(java.lang.String srcSpoolRepositoryURL, java.lang.String srcState, java.lang.String dstSpoolRepositoryURL, java.lang.String dstState, java.lang.String header, java.lang.String headerValueRegex) throws SpoolManagementException
moveSpoolItems
in interface SpoolManagementMBean
srcSpoolRepositoryURL
- the spool whose item are listedsrcState
- if not NULL, only mails with matching state are returneddstSpoolRepositoryURL
- the destination spooldstState
- if not NULL, the state will be changed before storing the message to the new repository.header
- if not NULL, only mails with at least one header with a value matching headerValueRegex are returnedheaderValueRegex
- the regular expression the header must match
SpoolManagementException
public int moveSpoolItems(java.lang.String srcSpoolRepositoryURL, java.lang.String dstSpoolRepositoryURL, java.lang.String dstState, SpoolFilter filter) throws javax.mail.MessagingException, SpoolManagementException
moveSpoolItems
in interface SpoolManagementService
srcSpoolRepositoryURL
- the spool whose item are listeddstSpoolRepositoryURL
- the destination spooldstState
- if not NULL, the state will be changed before storing the message to the new repository.filter
- the filter to select messages from the source repository
org.apache.avalon.framework.service.ServiceException
javax.mail.MessagingException
SpoolManagementException
public java.lang.String[] listSpoolItems(java.lang.String spoolRepositoryURL, java.lang.String state, java.lang.String header, java.lang.String headerValueRegex) throws SpoolManagementException
listSpoolItems
in interface SpoolManagementMBean
spoolRepositoryURL
- the spool whose item are listedstate
- if not NULL, only mails with matching state are returnedheader
- if not NULL, only mails with at least one header with a value matching headerValueRegex are returnedheaderValueRegex
- the regular expression the header must match
SpoolManagementException
public java.lang.String[] listSpoolItems(java.lang.String spoolRepositoryURL, SpoolFilter filter) throws SpoolManagementException
spoolRepositoryURL
- the spool whose item are listedfilter
- the criteria against which all mails are matched
SpoolManagementException
protected boolean filterMatches(org.apache.mailet.Mail mail, SpoolFilter filter) throws SpoolManagementException
mail
- the Mail which should be checkedfilter
- the SpoolFilter which should be used
SpoolManagementException
public java.util.List getSpoolItems(java.lang.String spoolRepositoryURL, SpoolFilter filter) throws javax.mail.MessagingException, SpoolManagementException
SpoolManagementService
getSpoolItems
in interface SpoolManagementService
spoolRepositoryURL
- the url under which a spool can be accessedfilter
- the SpoolFilter to use
javax.mail.MessagingException
SpoolManagementException
SpoolManagementService.getSpoolItems(String, SpoolFilter)
public int removeSpoolItems(java.lang.String spoolRepositoryURL, java.lang.String key, java.lang.String state, java.lang.String header, java.lang.String headerValueRegex) throws SpoolManagementException
SpoolManagementMBean
removeSpoolItems
in interface SpoolManagementMBean
spoolRepositoryURL
- specifies the spoolkey
- identifies the item to be removed. if NULL, all items are removedstate
- only mails in the given state are processed, or ALL if NULLheader
- the header whose value should be checkedheaderValueRegex
- regular expression matched against header value. only matching mails are processed
SpoolManagementException
SpoolManagementMBean.removeSpoolItems(String, String, String, String, String)
public int removeSpoolItems(java.lang.String spoolRepositoryURL, java.lang.String key, SpoolFilter filter) throws SpoolManagementException
spoolRepositoryURL
- the spool whose item are listedkey
- ID of the mail to be removed. if not NULL, all other filters are ignoredfilter
- the criteria against which all mails are matched. only applied if key is NULL.
SpoolManagementException
public int removeSpoolItems(java.lang.String spoolRepositoryURL, java.lang.String key, java.util.List lockingFailures, SpoolFilter filter) throws SpoolManagementException, javax.mail.MessagingException, SpoolManagementException
SpoolManagementService
removeSpoolItems
in interface SpoolManagementService
spoolRepositoryURL
- the spool whose item are listedkey
- ID of the mail to be removed. if not NULL, all other filters are ignoredlockingFailures
- is populated with a list of mails which could not be processed because
a lock could not be obtainedfilter
- the criteria against which all mails are matched. only applied if key is NULL.
SpoolManagementException
javax.mail.MessagingException
SpoolManagementService.removeSpoolItems(String, String, List, SpoolFilter)
public int resendSpoolItems(java.lang.String spoolRepositoryURL, java.lang.String key, SpoolFilter filter) throws SpoolManagementException
spoolRepositoryURL
- the spool whose item are about to be resendkey
- ID of the mail to be resend. if not NULL, all other filters are ignoredfilter
- the SpoolFilter to use
SpoolManagementException
public int resendSpoolItems(java.lang.String spoolRepositoryURL, java.lang.String key, java.lang.String state, java.lang.String header, java.lang.String headerValueRegex) throws SpoolManagementException
resendSpoolItems
in interface SpoolManagementMBean
spoolRepositoryURL
- the spool whose item are about to be resendkey
- ID of the mail to be resend. if not NULL, all other filters are ignoredstate
- if not NULL, only mails with matching state are resendheader
- if not NULL, only mails with at least one header with a value matching headerValueRegex are resendheaderValueRegex
- the regular expression the header must match
SpoolManagementException
public int resendSpoolItems(java.lang.String spoolRepositoryURL, java.lang.String key, java.util.List lockingFailures, SpoolFilter filter) throws javax.mail.MessagingException, SpoolManagementException
SpoolManagementService
resendSpoolItems
in interface SpoolManagementService
spoolRepositoryURL
- the spool whose item are about to be resendkey
- ID of the mail to be resend. if not NULL, all other filters are ignoredlockingFailures
- is populated with a list of mails which could not be processed because
a lock could not be obtainedfilter
- the criteria against which all mails are matched. only applied if key is NULL.
javax.mail.MessagingException
SpoolManagementException
SpoolManagementService.resendSpoolItems(String, String, List, SpoolFilter)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |