Java Doc for James.java in  » Web-Mail » james-2.3.1 » org » apache » james » 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.james 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.james.James

James
public class James extends AbstractLogEnabled implements Contextualizable,Serviceable,Configurable,JamesMBean,Initializable,MailServer,MailetContext(Code)
Core class for JAMES. Provides three primary services:
1) Instantiates resources, such as user repository, and protocol handlers
2) Handles interactions between components
3) Provides container services for Mailets
version:
   This is $Revision: 494012 $


Field Summary
protected  MailetlocalDeliveryMailet
     Currently used by storeMail to avoid code duplication (we moved store logic to that mailet).
protected  ContextmyContext
    


Method Summary
public  booleanaddUser(String userName, String password)
     Adds a user to this mail server.
public  voidbounce(Mail mail, String message)
     This generates a response to the Return-Path address, or the address of the message's sender if the Return-Path is not available.
public  voidbounce(Mail mail, String message, MailAddress bouncer)
     This generates a response to the Return-Path address, or the address of the message's sender if the Return-Path is not available.
public  voidconfigure(Configuration conf)
    
public  voidcontextualize(Context context)
    
public  ObjectgetAttribute(String key)
    
public  IteratorgetAttributeNames()
    
public  StringgetId()
     Return a new mail id.
public  CollectiongetMailServers(String host)
    
public  intgetMajorVersion()
    
public  intgetMinorVersion()
    
public  MailAddressgetPostmaster()
     Returns the address of the postmaster for this server.
public  IteratorgetSMTPHostAddresses(String domainName)
     Performs DNS lookups as needed to find servers which should or might support SMTP. 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.
public  StringgetServerInfo()
    
public synchronized  MailRepositorygetUserInbox(String userName)
    
public  voidinitialize()
    
public  booleanisLocalServer(String serverName)
     Check whether the mail domain in question is to be handled by this server.
public  booleanisLocalUser(String name)
    
public  voidlog(String message)
    
public  voidlog(String message, Throwable t)
    
public static  voidmain(String[] args)
     The main method.
public  voidremoveAttribute(String key)
    
public  voidsendMail(MimeMessage message)
    
public  voidsendMail(MailAddress sender, Collection recipients, MimeMessage message)
    
public  voidsendMail(MailAddress sender, Collection recipients, MimeMessage message, String state)
    
public  voidsendMail(MailAddress sender, Collection recipients, InputStream msg)
    
public  voidsendMail(Mail mail)
    
public  voidservice(ServiceManager comp)
    
public  voidsetAttribute(String key, Object object)
    
public  voidstoreMail(MailAddress sender, MailAddress recipient, MimeMessage msg)
     This method has been moved to LocalDelivery (the only client of the method).

Field Detail
localDeliveryMailet
protected Mailet localDeliveryMailet(Code)
Currently used by storeMail to avoid code duplication (we moved store logic to that mailet). TODO We should remove this and its initialization when we remove storeMail method.



myContext
protected Context myContext(Code)
The Avalon context used by the instance





Method Detail
addUser
public boolean addUser(String userName, String password)(Code)
Adds a user to this mail server. Currently just adds user to a UsersRepository.
Parameters:
  userName - String representing user name, that is the portion ofan email address before the '@'.
Parameters:
  password - String plaintext password boolean true if user added succesfully, else false.



bounce
public void bounce(Mail mail, String message) throws MessagingException(Code)
This generates a response to the Return-Path address, or the address of the message's sender if the Return-Path is not available. Note that this is different than a mail-client's reply, which would use the Reply-To or From header. This will send the bounce with the server's postmaster as the sender.



bounce
public void bounce(Mail mail, String message, MailAddress bouncer) throws MessagingException(Code)
This generates a response to the Return-Path address, or the address of the message's sender if the Return-Path is not available. Note that this is different than a mail-client's reply, which would use the Reply-To or From header. Bounced messages are attached in their entirety (headers and content) and the resulting MIME part type is "message/rfc822". The attachment to the subject of the original message (or "No Subject" if there is no subject in the original message) There are outstanding issues with this implementation revolving around handling of the return-path header. MIME layout of the bounce message: multipart (mixed)/ contentPartRoot (body) = mpContent (alternative)/ part (body) = message part (body) = original



configure
public void configure(Configuration conf)(Code)

See Also:   org.apache.avalon.framework.configuration.Configurable.configure(Configuration)



contextualize
public void contextualize(Context context)(Code)

See Also:   org.apache.avalon.framework.context.Contextualizable.contextualize(Context)



getAttribute
public Object getAttribute(String key)(Code)



getAttributeNames
public Iterator getAttributeNames()(Code)



getId
public String getId()(Code)
Return a new mail id. a new mail id



getMailServers
public Collection getMailServers(String host)(Code)

Get the prioritized list of mail servers for a given host.

TODO: This needs to be made a more specific ordered subtype of Collection.


Parameters:
  host -



getMajorVersion
public int getMajorVersion()(Code)
Return the major version number for the server the major vesion number for the server



getMinorVersion
public int getMinorVersion()(Code)
Return the minor version number for the server the minor vesion number for the server



getPostmaster
public MailAddress getPostmaster()(Code)
Returns the address of the postmaster for this server. the MailAddress for the postmaster



getSMTPHostAddresses
public Iterator getSMTPHostAddresses(String domainName)(Code)
Performs DNS lookups as needed to find servers which should or might support SMTP. 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.
See Also:   org.apache.james.DNSServer.getSMTPHostAddresses(String)
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
public String getServerInfo()(Code)
Return the type of the server the type of the server



getUserInbox
public synchronized MailRepository getUserInbox(String userName)(Code)

Retrieve the mail repository for a user

For POP3 server only - at the moment.


Parameters:
  userName - the name of the user whose inbox is to be retrieved the POP3 inbox for the user



initialize
public void initialize() throws Exception(Code)

See Also:   org.apache.avalon.framework.activity.Initializable.initialize



isLocalServer
public boolean isLocalServer(String serverName)(Code)
Check whether the mail domain in question is to be handled by this server.
Parameters:
  serverName - the name of the server to check whether the server is local



isLocalUser
public boolean isLocalUser(String name)(Code)
Returns whether that account has a local inbox on this server
Parameters:
  name - the name to be checked whether the account has a local inbox



log
public void log(String message)(Code)
Log a message to the Mailet logger
Parameters:
  message - the message to pass to the Mailet logger



log
public void log(String message, Throwable t)(Code)
Log a message and a Throwable to the Mailet logger
Parameters:
  message - the message to pass to the Mailet logger
Parameters:
  t - the Throwable to be logged



main
public static void main(String[] args)(Code)
The main method. Should never be invoked, as James must be called from within an Avalon framework container.
Parameters:
  args - the command line arguments



removeAttribute
public void removeAttribute(String key)(Code)



sendMail
public void sendMail(MimeMessage message) throws MessagingException(Code)
Place a mail on the spool for processing
Parameters:
  message - the message to send
throws:
  MessagingException - if an exception is caught while placing the mailon the spool



sendMail
public void sendMail(MailAddress sender, Collection recipients, MimeMessage message) throws MessagingException(Code)
Place a mail on the spool for processing
Parameters:
  sender - the sender of the mail
Parameters:
  recipients - the recipients of the mail
Parameters:
  message - the message to send
throws:
  MessagingException - if an exception is caught while placing the mailon the spool



sendMail
public void sendMail(MailAddress sender, Collection recipients, MimeMessage message, String state) throws MessagingException(Code)
Place a mail on the spool for processing
Parameters:
  sender - the sender of the mail
Parameters:
  recipients - the recipients of the mail
Parameters:
  message - the message to send
Parameters:
  state - the state of the message
throws:
  MessagingException - if an exception is caught while placing the mailon the spool



sendMail
public void sendMail(MailAddress sender, Collection recipients, InputStream msg) throws MessagingException(Code)
Place a mail on the spool for processing
Parameters:
  sender - the sender of the mail
Parameters:
  recipients - the recipients of the mail
Parameters:
  msg - an InputStream containing the message
throws:
  MessagingException - if an exception is caught while placing the mailon the spool



sendMail
public void sendMail(Mail mail) throws MessagingException(Code)
Place a mail on the spool for processing
Parameters:
  mail - the mail to place on the spool
throws:
  MessagingException - if an exception is caught while placing the mailon the spool



service
public void service(ServiceManager comp)(Code)

See Also:   org.apache.avalon.framework.service.Serviceable.service(ServiceManager)



setAttribute
public void setAttribute(String key, Object object)(Code)



storeMail
public void storeMail(MailAddress sender, MailAddress recipient, MimeMessage msg) throws MessagingException(Code)
This method has been moved to LocalDelivery (the only client of the method). Now we can safely remove it from the Mailet API and from this implementation of MailetContext. The local field localDeliveryMailet will be removed when we remove the storeMail method.
See Also:   org.apache.mailet.MailetContext.storeMail(org.apache.mailet.MailAddressorg.apache.mailet.MailAddressjavax.mail.internet.MimeMessage)



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