|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jsieve.util.check.ScriptCheckMailAdapter
public class ScriptCheckMailAdapter
Checks script execution for an email. The wrapped email is set by called
setMail(javax.mail.Message)
. Actions are recorded on executedActions
and can
be retrieved by getExecutedActions()
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.jsieve.mail.MailAdapter |
---|
MailAdapter.Address |
Constructor Summary | |
---|---|
ScriptCheckMailAdapter()
|
Method Summary | |
---|---|
void |
addAction(Action action)
Method addAction adds an Action to the List of Actions to be performed by the receiver. |
void |
executeActions()
Method executeActions. |
java.util.List<Action> |
getActions()
Method getActions answers the List of Actions accumulated by the receiver. |
java.lang.String |
getContentType()
Method getContentType returns string/mime representation of the message type. |
java.util.List<Action> |
getExecutedActions()
Gets the actions accumulated when executedActions was last
called. |
java.util.List<java.lang.String> |
getHeader(java.lang.String name)
Method getHeader answers a List of all of the headers in the receiver whose name is equal to the passed name. |
java.util.List<java.lang.String> |
getHeaderNames()
Method getHeaderNames answers a List of all of the headers in the receiver. |
javax.mail.Message |
getMail()
Gets the wrapped email. |
java.util.List<java.lang.String> |
getMatchingHeader(java.lang.String name)
Method getMatchingHeader answers a List of all of the headers in the receiver with the passed name. |
int |
getSize()
Method getSize answers the receiver's message size in octets. |
boolean |
isInBodyText(java.lang.String phraseCaseInsensitive)
|
MailAdapter.Address[] |
parseAddresses(java.lang.String headerName)
|
MailAdapter.Address[] |
parseAddresses(java.lang.String headerName,
javax.mail.Message message)
Parses the value from the given message into addresses. |
void |
reset()
Resets executed and accumlated actions. |
void |
setContext(SieveContext context)
|
void |
setMail(javax.mail.Message mail)
Sets the wrapped email and reset() s the adapter ready for another
execution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptCheckMailAdapter()
Method Detail |
---|
public javax.mail.Message getMail()
Message
, possibly nullpublic void setMail(javax.mail.Message mail)
reset()
s the adapter ready for another
execution.
mail
- Message
, possibly nullpublic void addAction(Action action)
addAction
in interface MailAdapter
action
- public void executeActions() throws SieveException
executeActions
in interface MailAdapter
SieveException
public java.util.List<Action> getExecutedActions()
executedActions
was last
called.
List
of Action
s, not null. This list is a
modifiable copypublic java.util.List<Action> getActions()
getActions
in interface MailAdapter
List
of Action
's, not null, possibly
unmodifiablepublic void reset()
public java.util.List<java.lang.String> getHeader(java.lang.String name) throws SieveMailException
getHeader
in interface MailAdapter
name
-
List
not null, possibly empty
SieveMailException
public java.util.List<java.lang.String> getHeaderNames() throws SieveMailException
getHeaderNames
in interface MailAdapter
List
, not null possible empty, possible
unmodifiable
SieveMailException
public java.util.List<java.lang.String> getMatchingHeader(java.lang.String name) throws SieveMailException
Method getMatchingHeader answers a List of all of the headers in the receiver with the passed name. If no headers are found an empty List is returned.
This method differs from getHeader(String) in that it ignores case and the whitespace prefixes and suffixes of a header name when performing the match, as required by RFC 3028. Thus "From", "from ", " From" and " from " are considered equal.
getMatchingHeader
in interface MailAdapter
name
-
List
, not null possibly empty
SieveMailException
public int getSize() throws SieveMailException
getSize
in interface MailAdapter
SieveMailException
public java.lang.String getContentType() throws SieveMailException
getContentType
in interface MailAdapter
SieveMailException
public MailAdapter.Address[] parseAddresses(java.lang.String headerName) throws SieveMailException
parseAddresses
in interface MailAdapter
SieveMailException
public MailAdapter.Address[] parseAddresses(java.lang.String headerName, javax.mail.Message message) throws SieveMailException
headerName
- header name, to be matched case insensitivelymessage
- Message
, not null
Address
array, not null possibly empty
SieveMailException
public boolean isInBodyText(java.lang.String phraseCaseInsensitive) throws SieveMailException
isInBodyText
in interface MailAdapter
SieveMailException
public void setContext(SieveContext context)
setContext
in interface MailAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |