Java Doc for MailetContext.java in  » Web-Mail » james-2.3.1 » org » apache » mailet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Mail » james 2.3.1 » org.apache.mailet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.mailet.MailetContext

All known Subclasses:   org.apache.james.James,  org.apache.james.test.mock.mailet.MockMailContext,
MailetContext
public interface MailetContext (Code)
Defines a set of methods that a mailet or matcher uses to communicate with its mailet container, for example, to send a new message, to deliver a message locally, or write to a log file. The MailetContext object is contained within the MailetConfig and MatcherConfig objects, which the mailet container provides to the mailets and matchers when they are initialized.
version:
   1.0.0, 24/04/1999




Method Summary
 voidbounce(Mail mail, String message)
     Bounces the message using a standard format with the given message.
 voidbounce(Mail mail, String message, MailAddress bouncer)
     Bounces the email message using the provided email address as the sender of the bounce.
 ObjectgetAttribute(String name)
     Returns the mailet container attribute with the given name, or null if there is no attribute by that name.
 IteratorgetAttributeNames()
     Returns an Iterator containing the attribute names available within this mailet context.
 CollectiongetMailServers(String host)
     Returns a Collection of Strings of hostnames or ip addresses that are specified as mail server listeners for the given hostname.
 intgetMajorVersion()
     Returns the major version of the Mailet API that this mailet container supports.
 intgetMinorVersion()
     Returns the minor version of the Mailet API that this mailet container supports.
 MailAddressgetPostmaster()
     Returns the postmaster's address for this mailet context.
 IteratorgetSMTPHostAddresses(String domainName)
     Returns an Iterator over HostAddress, a specialized subclass of javax.mail.URLName, which provides location information for servers that are specified as mail handlers for the given hostname.
 StringgetServerInfo()
     Returns the name and version of the mailet container on which the mailet is running.

The form of the returned string is servername/versionnumber.

 booleanisLocalServer(String serverName)
     Checks if a server is serviced by mail context
Parameters:
  serverName - - name of server.
 booleanisLocalUser(String userAccount)
     Checks if a user account is exists in the mail context.
Parameters:
  userAccount - - user identifier.
 voidlog(String message)
     Writes the specified message to a mailet log file, usually an event log.
 voidlog(String message, Throwable t)
     Writes an explanatory message and a stack trace for a given Throwable exception to the mailet log file.
 voidremoveAttribute(String name)
     Removes the attribute with the given name from the mailet context.
 voidsendMail(MimeMessage msg)
     Send an outgoing message to the top of this mailet container's root queue.
 voidsendMail(MailAddress sender, Collection recipients, MimeMessage msg)
     Send an outgoing message to the top of this mailet container's root queue.
 voidsendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state)
     Send an outgoing message to the top of this mailet container queue for the appropriate processor that is specified.
 voidsendMail(Mail mail)
     Send an outgoing message to the top of this mailet container's root queue.
 voidsetAttribute(String name, Object object)
     Binds an object to a given attribute name in this mailet context.
 voidstoreMail(MailAddress sender, MailAddress recipient, MimeMessage msg)
     Stores the message is in the local repository associated with recipient for later retrieval, e.g., by a POP3 or IMAP service.



Method Detail
bounce
void bounce(Mail mail, String message) throws MessagingException(Code)
Bounces the message using a standard format with the given message. The message will be sent back to the sender from the postmaster as specified for this mailet context, adding message to top of mail server queue using sendMail().
Parameters:
  mail - - the message that is to be bounced and sender to whom to return the message
Parameters:
  message - - a descriptive message as to why the message bounced



bounce
void bounce(Mail mail, String message, MailAddress bouncer) throws MessagingException(Code)
Bounces the email message using the provided email address as the sender of the bounce.
Parameters:
  mail - - the message that is to be bounced and sender to whom to return the message
Parameters:
  message - - a descriptive message as to why the message bounced
Parameters:
  bouncer - - the address to give as the sender of the bounced message



getAttribute
Object getAttribute(String name)(Code)
Returns the mailet container attribute with the given name, or null if there is no attribute by that name. An attribute allows a mailet container to give the mailet additional information not already provided by this interface. See your server documentation for information about its attributes. A list of supported attributes can be retrieved using getAttributeNames.

The attribute is returned as a java.lang.Object or some subclass. Attribute names should follow the same convention as package names. The Java Mailet API specification reserves names matching java.*, javax.*, and sun.*
Parameters:
  name - - a String specifying the name of the attribute an Object containing the value of the attribute, or null if no attributeexists matching the given name




getAttributeNames
Iterator getAttributeNames()(Code)
Returns an Iterator containing the attribute names available within this mailet context. Use the getAttribute(java.lang.String) method with an attribute name to get the value of an attribute. an Iterator of attribute names



getMailServers
Collection getMailServers(String host)(Code)
Returns a Collection of Strings of hostnames or ip addresses that are specified as mail server listeners for the given hostname. This is done using MX records, and the hostnames or ip addresses are returned sorted by MX priority.
Parameters:
  host - - the domain name for which to find mail servers a Collection of Strings of hostnames, sorted by priority



getMajorVersion
int getMajorVersion()(Code)
Returns the major version of the Mailet API that this mailet container supports. All implementations that comply with Version 1.2 must have this method return the integer 1. 1



getMinorVersion
int getMinorVersion()(Code)
Returns the minor version of the Mailet API that this mailet container supports. All implementations that comply with Version 1.2 must have this method return the integer 2. 2



getPostmaster
MailAddress getPostmaster()(Code)
Returns the postmaster's address for this mailet context. a MailAddress of the Postmaster's address



getSMTPHostAddresses
Iterator getSMTPHostAddresses(String domainName)(Code)
Returns an Iterator over HostAddress, a specialized subclass of javax.mail.URLName, which provides location information for servers that are specified as mail handlers for the given hostname. This is done using MX records, and the HostAddress instances are returned sorted by MX priority. If no host is found for domainName, the Iterator returned will be empty and the first call to hasNext() will return false.
since:
   Mailet API v2.2.0a16-unstable
Parameters:
  domainName - - the domain for which to find mail servers an Iterator over HostAddress instances, sorted by priority



getServerInfo
String getServerInfo()(Code)
Returns the name and version of the mailet container on which the mailet is running.

The form of the returned string is servername/versionnumber. For example, JAMES may return the string JAMES/1.2.

The mailet container may return other optional information after the primary string in parentheses, for example, JAMES/1.2 (JDK 1.3.0; Windows NT 4.0 x86). a String containing at least the mailet container name and version number




isLocalServer
boolean isLocalServer(String serverName)(Code)
Checks if a server is serviced by mail context
Parameters:
  serverName - - name of server. true if server is local, i.e. serviced by this mail context



isLocalUser
boolean isLocalUser(String userAccount)(Code)
Checks if a user account is exists in the mail context.
Parameters:
  userAccount - - user identifier. true if the acount is a local account



log
void log(String message)(Code)
Writes the specified message to a mailet log file, usually an event log. The name and type of the mailet log file is specific to the mailet container.
Parameters:
  message - - a String specifying the message to be written to the log file



log
void log(String message, Throwable t)(Code)
Writes an explanatory message and a stack trace for a given Throwable exception to the mailet log file.
Parameters:
  message - - a String that describes the error or exception
Parameters:
  throwable - - the Throwable error or exception



removeAttribute
void removeAttribute(String name)(Code)
Removes the attribute with the given name from the mailet context. After removal, subsequent calls to getAttribute(java.lang.String) to retrieve the attribute's value will return null.
Parameters:
  name - - a String specifying the name of the attribute to be removed



sendMail
void sendMail(MimeMessage msg) throws MessagingException(Code)
Send an outgoing message to the top of this mailet container's root queue. This is the equivalent of opening an SMTP session to localhost. This uses sender and recipients as specified in the message itself.
Parameters:
  msg - - the MimeMessage of the headers and body content of the outgoing message
throws:
  MessagingException - - if the message fails to parse



sendMail
void sendMail(MailAddress sender, Collection recipients, MimeMessage msg) throws MessagingException(Code)
Send an outgoing message to the top of this mailet container's root queue. This is the equivalent of opening an SMTP session to localhost.
Parameters:
  sender - - the sender of the message
Parameters:
  recipients - - a Collection of MailAddress objects of recipients
Parameters:
  msg - - the MimeMessage of the headers and body content of the outgoing message
throws:
  MessagingException - - if the message fails to parse



sendMail
void sendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state) throws MessagingException(Code)
Send an outgoing message to the top of this mailet container queue for the appropriate processor that is specified.
Parameters:
  sender - - the sender of the message
Parameters:
  recipients - - a Collection of MailAddress objects of recipients
Parameters:
  msg - - the MimeMessage of the headers and body content of the outgoing message
Parameters:
  state - - the state of the message, indicates which processor to useThis is a String that names a processor for which the message will be queued
throws:
  MessagingException - - if the message fails to parse



sendMail
void sendMail(Mail mail) throws MessagingException(Code)
Send an outgoing message to the top of this mailet container's root queue. This is the equivalent of opening an SMTP session to localhost. The Mail object provides all envelope and content information
Parameters:
  mail - - the message that is to sent
throws:
  MessagingException - - if the message fails to spool



setAttribute
void setAttribute(String name, Object object)(Code)
Binds an object to a given attribute name in this mailet context. If the name specified is already used for an attribute, this method will remove the old attribute and bind the name to the new attribute.

Attribute names should follow the same convention as package names. The Java Mailet API specification reserves names matching java.*, javax.*, and sun.*.
Parameters:
  name - - a String specifying the name of the attribute
Parameters:
  object - - an Object representing the attribute to be bound




storeMail
void storeMail(MailAddress sender, MailAddress recipient, MimeMessage msg) throws MessagingException(Code)
Stores the message is in the local repository associated with recipient for later retrieval, e.g., by a POP3 or IMAP service.
Parameters:
  sender - - the sender of the incoming message
Parameters:
  recipient - - the user who is receiving this message (as a complete email address)
Parameters:
  msg - - the MimeMessage to store in a local mailbox
throws:
  MessagingException - - if the message fails to parse



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.