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


java.lang.Object
   org.apache.mailet.GenericMailet
      org.apache.james.transport.mailets.CommandListservManager

CommandListservManager
public class CommandListservManager extends GenericMailet implements ICommandListservManager(Code)
CommandListservManager is the default implementation of ICommandListservManager . It loads all the configured IListServCommand s and delegates to them at runtime.
It isn't responsible for procesing messages sent to the main mailing list, but is responsible for individual commands sent by users, such as: info, subscribe, etc...
Requests sent to the CommandListservManager take the form of:
 <listName>-<commandName>@domain
 
If the command isn't recognized an error will be sent using CommandListservManager.onError .

The configuration for this mailet sould be in the 'root' processor block.
 <mailet match="CommandListservMatcher=announce@localhost" class="CommandListservManager">
 <listName>announce</listName>
 <displayName>Announce mailing list</displayName>
 <listOwner>owner@localhost</listOwner>
 <repositoryName>list-announce</repositoryName>
 <listDomain>localhost</listDomain>
 <commandpackages>
 <commandpackage>org.apache.james.transport.mailets.listservcommands</commandpackage>
 </commandpackages>
 <commands>
 <command name="subscribe" class="Subscribe"/>
 <command name="subscribe-confirm" class="SubscribeConfirm"/>
 <command name="unsubscribe" class="UnSubscribe"/>
 <command name="unsubscribe-confirm" class="UnSubscribeConfirm"/>
 <command name="error" class="ErrorCommand"/>
 <command name="owner" class="Owner"/>
 <command name="info" class="Info"/>
 </commands>
 </mailet>
 


Todo: refine the command matching so we can have more sophistciated commands such as:
 <listName>-<commandName>-<optCommandParam>@domain
 

version:
   CVS $Revision: 430699 $ $Date: 2006-08-11 09:02:35 +0200 (Fr, 11 Aug 2006) $
since:
   2.2.0


Field Summary
protected  MapcommandMap
    
protected  ListcommandPackages
    
protected  StringdisplayName
    
protected  StringlistDomain
    
protected  StringlistName
    
protected  StringlistOwner
    
protected  UsersRepositoryusersRepository
    
protected  XMLResourcesxmlResources
    


Method Summary
public  IListServCommandgetCommand(String name)
     Get a specific command specified by the 'commands' configuration block.
protected  StringgetCommandName(MailAddress mailAddress)
    
public  IListServCommandgetCommandTarget(MailAddress mailAddress)
    
public  MapgetCommands()
    
protected static  ObjectgetField(Object instance, String name)
     Retrieves a data field, potentially defined by a super class.
public  StringgetListDomain()
     Get the domain of the list specified by the config param: 'listDomain'.
public  StringgetListName(boolean displayFormat)
     Get the name of this list specified by the config param: 'listName'.
public  StringgetListOwner()
     Gets the owner of this list specified by the config param: 'listOwner'.
public  StringgetResourcesFile()
    
public  PropertiesgetStandardProperties()
    
public  UsersRepositorygetUsersRepository()
    
public  voidinit()
    
protected  voidinitUsersRepository()
    
public  XMLResources[]initXMLResources(String[] names)
     Initializes an array of resources
Parameters:
  names - such as 'header, footer' etc...
protected  voidinitializeResources()
    
protected  voidloadCommand(String commandName, String className, Configuration configuration)
    
protected  voidloadCommandPackages(Configuration configuration)
    
protected  voidloadCommands(Configuration configuration)
    
public  voidonError(Mail mail, String subject, String errorMessage)
    
public  voidservice(Mail mail)
    

Field Detail
commandMap
protected Map commandMap(Code)



commandPackages
protected List commandPackages(Code)



displayName
protected String displayName(Code)



listDomain
protected String listDomain(Code)



listName
protected String listName(Code)



listOwner
protected String listOwner(Code)



usersRepository
protected UsersRepository usersRepository(Code)



xmlResources
protected XMLResources xmlResources(Code)





Method Detail
getCommand
public IListServCommand getCommand(String name)(Code)
Get a specific command specified by the 'commands' configuration block. For instance:
 <commands>
 <command name="subscribe" class="Subscribe"/>
 <command name="subscribe-confirm" class="SubscribeConfirm"/>
 <command name="unsubscribe" class="UnSubscribe"/>
 <command name="unsubscribe-confirm" class="UnSubscribeConfirm"/>
 <command name="error" class="ErrorCommand"/>
 <command name="owner" class="Owner"/>
 <command name="info" class="Info"/>
 </commands>
 

Parameters:
  name - case in-sensitive a IListServCommand if found, null otherwise



getCommandName
protected String getCommandName(MailAddress mailAddress)(Code)
Get the name of the command
Parameters:
  mailAddress - the name of the command



getCommandTarget
public IListServCommand getCommandTarget(MailAddress mailAddress)(Code)
Based on the to address get a valid or command or null
Parameters:
  mailAddress - IListServCommand or null



getCommands
public Map getCommands()(Code)
Get all the available commands a map of IListServCommand
See Also:   CommandListservManager.getCommand



getField
protected static Object getField(Object instance, String name) throws IllegalAccessException(Code)
Retrieves a data field, potentially defined by a super class. null if not found, the object otherwise



getListDomain
public String getListDomain()(Code)
Get the domain of the list specified by the config param: 'listDomain'.
eg:
<listDomain>localhost</listDomain>
a string like localhost



getListName
public String getListName(boolean displayFormat)(Code)
Get the name of this list specified by the config param: 'listName'.
eg:
<listName>announce</listName>

Parameters:
  displayFormat - is whether you want a display version of this or not the official display name of this list



getListOwner
public String getListOwner()(Code)
Gets the owner of this list specified by the config param: 'listOwner'.
eg:
<listOwner>owner@localhost</listOwner>
this is an address like listOwner@localhost



getResourcesFile
public String getResourcesFile()(Code)
the configuration file for the xml resources



getStandardProperties
public Properties getStandardProperties()(Code)
Use this to get standard properties for future calls to org.apache.james.util.XMLResources properties with the "LIST_NAME" and the "DOMAIN_NAME" properties



getUsersRepository
public UsersRepository getUsersRepository()(Code)
Get the current user repository for this list serv an instance of UsersRepository that is used for the member list of the list serv



init
public void init() throws MessagingException(Code)



initUsersRepository
protected void initUsersRepository()(Code)
Fetch the repository of users



initXMLResources
public XMLResources[] initXMLResources(String[] names) throws ConfigurationException(Code)
Initializes an array of resources
Parameters:
  names - such as 'header, footer' etc... an initialized array of XMLResources
throws:
  ConfigurationException -



initializeResources
protected void initializeResources() throws Exception(Code)
initialize the resources
throws:
  Exception -



loadCommand
protected void loadCommand(String commandName, String className, Configuration configuration) throws ConfigurationException, ClassNotFoundException, IllegalAccessException, InstantiationException(Code)
Loads and initializes a single command
Parameters:
  commandName -
Parameters:
  className -
Parameters:
  configuration -
throws:
  ConfigurationException -



loadCommandPackages
protected void loadCommandPackages(Configuration configuration) throws ConfigurationException(Code)
loads all of the packages for the commands
Parameters:
  configuration -
throws:
  ConfigurationException -



loadCommands
protected void loadCommands(Configuration configuration) throws Exception(Code)
Load an initialize all of the available commands
Parameters:
  configuration -
throws:
  ConfigurationException -



onError
public void onError(Mail mail, String subject, String errorMessage) throws MessagingException(Code)
An error occurred, send some sort of message
Parameters:
  subject - the subject of the message to send
Parameters:
  mail -
Parameters:
  errorMessage -



service
public void service(Mail mail) throws MessagingException(Code)

Called by the mailet container to allow the mailet to process a message.

This method is declared abstract so subclasses must override it.


Parameters:
  mail - - the Mail object that contains the MimeMessage androuting information
throws:
  MessagingException - - if an exception occurs that interferes with the mailet's normal operationoccurred



Methods inherited from org.apache.mailet.GenericMailet
public void destroy()(Code)(Java Doc)
public String getInitParameter(String name)(Code)(Java Doc)
public String getInitParameter(String name, String defValue)(Code)(Java Doc)
public Iterator getInitParameterNames()(Code)(Java Doc)
public MailetConfig getMailetConfig()(Code)(Java Doc)
public MailetContext getMailetContext()(Code)(Java Doc)
public String getMailetInfo()(Code)(Java Doc)
public String getMailetName()(Code)(Java Doc)
public void init(MailetConfig newConfig) throws MessagingException(Code)(Java Doc)
public void init() throws MessagingException(Code)(Java Doc)
public void log(String message)(Code)(Java Doc)
public void log(String message, Throwable t)(Code)(Java Doc)
abstract public void service(Mail mail) throws javax.mail.MessagingException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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