Java Doc for BayesianAnalysisFeeder.java in  » Net » 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 » Net » 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.BayesianAnalysisFeeder

BayesianAnalysisFeeder
public class BayesianAnalysisFeeder extends GenericMailet (Code)

Feeds ham OR spam messages to train the BayesianAnalysis mailet.

The new token frequencies will be stored in a JDBC database.

Sample configuration:


 <processor name="root">
 <mailet match="RecipientIs=not.spam@thisdomain.com" class="BayesianAnalysisFeeder">
 <repositoryPath> db://maildb </repositoryPath>
 <feedType>ham</feedType>
 <!--
 Set this to the maximum message size (in bytes) that a message may have
 to be analyzed (default is 100000).
 -->
 <maxSize>100000</maxSize>
 </mailet>
 <mailet match="RecipientIs=spam@thisdomain.com" class="BayesianAnalysisFeeder">
 <repositoryPath> db://maildb </repositoryPath>
 <feedType>spam</feedType>
 <!--
 Set this to the maximum message size (in bytes) that a message may have
 to be analyzed (default is 100000).
 -->
 <maxSize>100000</maxSize>
 </mailet>
 <processor>
 

The previous example will allow the user to send messages to the server and use the recipient email address as the indicator for whether the message is ham or spam.

Using the example above, send good messages (ham not spam) to the email address "not.spam@thisdomain.com" to pump good messages into the feeder, and send spam messages (spam not ham) to the email address "spam@thisdomain.com" to pump spam messages into the feeder.

The bayesian database tables will be updated during the training reflecting the new data

At the end the mail will be destroyed (ghosted).

The correct approach is to send the original ham/spam message as an attachment to another message sent to the feeder; all the headers of the enveloping message will be removed and only the original message's tokens will be analyzed.

After a training session, the frequency Corpus used by BayesianAnalysis must be rebuilt from the database, in order to take advantage of the new token frequencies. Every 10 minutes a special thread in the BayesianAnalysis mailet will check if any change was made to the database, and rebuild the corpus if necessary.

Only one message at a time is scanned (the database update activity is synchronized) in order to avoid too much database locking, as thousands of rows may be updated just for one message fed.


See Also:   BayesianAnalysis
See Also:   org.apache.james.util.BayesianAnalyzer
See Also:   org.apache.james.util.JDBCBayesianAnalyzer
version:
   CVS $Revision: $ $Date: $
since:
   2.3.0




Method Summary
public  StringgetMailetInfo()
     Return a string describing this mailet.
public  intgetMaxSize()
     Getter for property maxSize.
public  voidinit()
     Mailet initialization routine.
public  voidservice(Mail mail)
     Scans the mail and updates the token frequencies in the database.
public  voidsetMaxSize(int maxSize)
     Setter for property maxSize.



Method Detail
getMailetInfo
public String getMailetInfo()(Code)
Return a string describing this mailet. a string describing this mailet



getMaxSize
public int getMaxSize()(Code)
Getter for property maxSize. Value of property maxSize.



init
public void init() throws MessagingException(Code)
Mailet initialization routine.
throws:
  MessagingException - if a problem arises



service
public void service(Mail mail)(Code)
Scans the mail and updates the token frequencies in the database. The method is synchronized in order to avoid too much database locking, as thousands of rows may be updated just for one message fed.
Parameters:
  mail - The Mail message to be scanned.



setMaxSize
public void setMaxSize(int maxSize)(Code)
Setter for property maxSize.
Parameters:
  maxSize - New value of property maxSize.



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.