org.apache.james.management.impl
Class BayesianAnalyzerManagement

java.lang.Object
  extended by org.apache.james.management.impl.BayesianAnalyzerManagement
All Implemented Interfaces:
org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.service.Serviceable, BayesianAnalyzerManagementMBean, BayesianAnalyzerManagementService

public class BayesianAnalyzerManagement
extends java.lang.Object
implements BayesianAnalyzerManagementService, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, BayesianAnalyzerManagementMBean

Management for BayesianAnalyzer


Field Summary
 
Fields inherited from interface org.apache.james.management.BayesianAnalyzerManagementService
ROLE
 
Constructor Summary
BayesianAnalyzerManagement()
           
 
Method Summary
 int addHamFromDir(java.lang.String dir)
          adds data to existing corpus by importing all the mails contained in the given dir as ham
 int addHamFromMbox(java.lang.String file)
          adds data to existing corpus by importing all the mails contained in the given mbox as ham
 int addSpamFromDir(java.lang.String dir)
          adds data to existing corpus by importing all the mails contained in the given dir as spam
 int addSpamFromMbox(java.lang.String file)
          adds data to existing corpus by importing all the mails contained in the given mbox as spam
 void configure(org.apache.avalon.framework.configuration.Configuration arg0)
           
 void exportData(java.lang.String file)
          exports the corpus to a file
 void importData(java.lang.String file)
          imports the corpus from a file
 void initialize()
           
 void resetData()
          reset trained data
 void service(org.apache.avalon.framework.service.ServiceManager arg0)
           
 void setDataSourceComponent(org.apache.avalon.excalibur.datasource.DataSourceComponent component)
          Set the DataSourceComponent
 void setDataSourceSelector(org.apache.avalon.cornerstone.services.datasources.DataSourceSelector selector)
          Set the DatasourceSekector
 void setRepositoryPath(java.lang.String repositoryPath)
          Set the repository path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BayesianAnalyzerManagement

public BayesianAnalyzerManagement()
Method Detail

service

public void service(org.apache.avalon.framework.service.ServiceManager arg0)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(ServiceManager)

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception
See Also:
Initializable.initialize()

configure

public void configure(org.apache.avalon.framework.configuration.Configuration arg0)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(Configuration)

setRepositoryPath

public void setRepositoryPath(java.lang.String repositoryPath)
Set the repository path

Parameters:
repositoryPath - Thre repositoryPath

setDataSourceSelector

public void setDataSourceSelector(org.apache.avalon.cornerstone.services.datasources.DataSourceSelector selector)
Set the DatasourceSekector

Parameters:
selector - The DataSourceSelector

setDataSourceComponent

public void setDataSourceComponent(org.apache.avalon.excalibur.datasource.DataSourceComponent component)
Set the DataSourceComponent

Parameters:
component - The DataSourceComponent

addHamFromDir

public int addHamFromDir(java.lang.String dir)
                  throws BayesianAnalyzerManagementException
Description copied from interface: BayesianAnalyzerManagementMBean
adds data to existing corpus by importing all the mails contained in the given dir as ham

Specified by:
addHamFromDir in interface BayesianAnalyzerManagementMBean
Specified by:
addHamFromDir in interface BayesianAnalyzerManagementService
Parameters:
dir - full path to the directory containing mail files
Returns:
number of processes mails
Throws:
BayesianAnalyzerManagementException - If the service is not configured
See Also:
BayesianAnalyzerManagementService.addHamFromDir(String)

addSpamFromDir

public int addSpamFromDir(java.lang.String dir)
                   throws BayesianAnalyzerManagementException
Description copied from interface: BayesianAnalyzerManagementMBean
adds data to existing corpus by importing all the mails contained in the given dir as spam

Specified by:
addSpamFromDir in interface BayesianAnalyzerManagementMBean
Specified by:
addSpamFromDir in interface BayesianAnalyzerManagementService
Parameters:
dir - full path to the directory containing mail files
Returns:
number of processes mails
Throws:
BayesianAnalyzerManagementException - If the service is not configured
See Also:
BayesianAnalyzerManagementService.addSpamFromDir(String)

addHamFromMbox

public int addHamFromMbox(java.lang.String file)
                   throws BayesianAnalyzerManagementException
Description copied from interface: BayesianAnalyzerManagementMBean
adds data to existing corpus by importing all the mails contained in the given mbox as ham

Specified by:
addHamFromMbox in interface BayesianAnalyzerManagementMBean
Specified by:
addHamFromMbox in interface BayesianAnalyzerManagementService
Parameters:
file - path to the mbox file
Returns:
number of processes mails
Throws:
BayesianAnalyzerManagementException - If the service is not configured
See Also:
BayesianAnalyzerManagementService.addHamFromMbox(String)

addSpamFromMbox

public int addSpamFromMbox(java.lang.String file)
                    throws BayesianAnalyzerManagementException
Description copied from interface: BayesianAnalyzerManagementMBean
adds data to existing corpus by importing all the mails contained in the given mbox as spam

Specified by:
addSpamFromMbox in interface BayesianAnalyzerManagementMBean
Specified by:
addSpamFromMbox in interface BayesianAnalyzerManagementService
Parameters:
file - path to the mbox file
Returns:
number of processes mails
Throws:
BayesianAnalyzerManagementException - If the service is not configured
See Also:
BayesianAnalyzerManagementService.addSpamFromMbox(String)

exportData

public void exportData(java.lang.String file)
                throws BayesianAnalyzerManagementException
Description copied from interface: BayesianAnalyzerManagementMBean
exports the corpus to a file

Specified by:
exportData in interface BayesianAnalyzerManagementMBean
Specified by:
exportData in interface BayesianAnalyzerManagementService
Parameters:
file - path to the mbox file
Throws:
BayesianAnalyzerManagementException - If the service is not configured
See Also:
BayesianAnalyzerManagementService.exportData(String)

importData

public void importData(java.lang.String file)
                throws BayesianAnalyzerManagementException
Description copied from interface: BayesianAnalyzerManagementMBean
imports the corpus from a file

Specified by:
importData in interface BayesianAnalyzerManagementMBean
Specified by:
importData in interface BayesianAnalyzerManagementService
Parameters:
file - path to the mbox file
Throws:
BayesianAnalyzerManagementException - IF the service is not configured
See Also:
BayesianAnalyzerManagementService.importData(String)

resetData

public void resetData()
               throws BayesianAnalyzerManagementException
Description copied from interface: BayesianAnalyzerManagementMBean
reset trained data

Specified by:
resetData in interface BayesianAnalyzerManagementMBean
Specified by:
resetData in interface BayesianAnalyzerManagementService
Throws:
BayesianAnalyzerManagementException
See Also:
BayesianAnalyzerManagementService.resetData()


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.