|
||||||||||
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 |
---|
org.apache.jsieve.mail.MailAdapter.Address |
Constructor Summary | |
---|---|
ScriptCheckMailAdapter()
|
Method Summary | |
---|---|
void |
addAction(org.apache.jsieve.mail.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<org.apache.jsieve.mail.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<org.apache.jsieve.mail.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)
|
org.apache.jsieve.mail.MailAdapter.Address[] |
parseAddresses(java.lang.String headerName)
|
org.apache.jsieve.mail.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(org.apache.jsieve.mail.Action action)
addAction
in interface org.apache.jsieve.mail.MailAdapter
action
- public void executeActions() throws org.apache.jsieve.exception.SieveException
executeActions
in interface org.apache.jsieve.mail.MailAdapter
org.apache.jsieve.exception.SieveException
public java.util.List<org.apache.jsieve.mail.Action> getExecutedActions()
executedActions
was last
called.
List
of Action
s, not null. This list is a
modifiable copypublic java.util.List<org.apache.jsieve.mail.Action> getActions()
getActions
in interface org.apache.jsieve.mail.MailAdapter
List
of Action
's, not null, possibly
unmodifiablepublic void reset()
public java.util.List<java.lang.String> getHeader(java.lang.String name) throws org.apache.jsieve.mail.SieveMailException
getHeader
in interface org.apache.jsieve.mail.MailAdapter
name
-
List
not null, possibly empty
org.apache.jsieve.mail.SieveMailException
public java.util.List<java.lang.String> getHeaderNames() throws org.apache.jsieve.mail.SieveMailException
getHeaderNames
in interface org.apache.jsieve.mail.MailAdapter
List
, not null possible empty, possible
unmodifiable
org.apache.jsieve.mail.SieveMailException
public java.util.List<java.lang.String> getMatchingHeader(java.lang.String name) throws org.apache.jsieve.mail.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 org.apache.jsieve.mail.MailAdapter
name
-
List
, not null possibly empty
org.apache.jsieve.mail.SieveMailException
public int getSize() throws org.apache.jsieve.mail.SieveMailException
getSize
in interface org.apache.jsieve.mail.MailAdapter
org.apache.jsieve.mail.SieveMailException
public java.lang.String getContentType() throws org.apache.jsieve.mail.SieveMailException
getContentType
in interface org.apache.jsieve.mail.MailAdapter
org.apache.jsieve.mail.SieveMailException
public boolean isInBodyText(java.lang.String phraseCaseInsensitive) throws org.apache.jsieve.mail.SieveMailException
isInBodyText
in interface org.apache.jsieve.mail.MailAdapter
org.apache.jsieve.mail.SieveMailException
public org.apache.jsieve.mail.MailAdapter.Address[] parseAddresses(java.lang.String headerName) throws org.apache.jsieve.mail.SieveMailException
parseAddresses
in interface org.apache.jsieve.mail.MailAdapter
org.apache.jsieve.mail.SieveMailException
public org.apache.jsieve.mail.MailAdapter.Address[] parseAddresses(java.lang.String headerName, javax.mail.Message message) throws org.apache.jsieve.mail.SieveMailException
headerName
- header name, to be matched case insensitivelymessage
- Message
, not null
Address
array, not null possibly empty
org.apache.jsieve.mail.SieveMailException
public void setContext(SieveContext context)
setContext
in interface org.apache.jsieve.mail.MailAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |