org.jasen.config
Class JasenConfiguration

java.lang.Object
  extended byorg.jasen.config.JasenConfiguration
All Implemented Interfaces:
Serializable

public class JasenConfiguration
extends Object
implements Serializable

Holds the configuration for the engine.

By default, the configuration file used is the internal configuration located in the jasen-config folder which MUST be in the classpath

An alternate configuration can be loaded by specifying an alternal InputStream in the init method of the core Jasen class

Author:
Jason Polites
See Also:
Jasen.init(InputStream), Jasen.init(String), Serialized Form

Field Summary
static String DEFAULT_CONFIG_PATH
           
 
Constructor Summary
JasenConfiguration()
          Constructs a new configuration instance
 
Method Summary
 void addPluginConfiguration(JasenPluginConfiguration config)
          Adds a plugin configuration
 String getAutoUpdateCheckOnStartup()
          Gets the value of the auto update check-on-startup configuration.
 String getAutoUpdateEnabled()
          Gets the value of the auto update enabled configuration.
 String getAutoUpdateErrorHandler()
          Gets the class name of the error handler to use in the auto update engine.
 String getAutoUpdateFrequency()
          Gets the frequency of the auto-update engine in minutes
 String getAutoUpdateParcel()
          Gets the name of the (XML) file which resides on the update server and which contains the update parcel information
 String getAutoUpdateReadBuffer()
          Gets the size (in bytes) of the buffer to use when downloading updates
 String getAutoUpdateReadTimout()
          Gets the timeout (in milliseconds) to be used when reading update information from the update server
 String getAutoUpdateUrl()
          Gets the URL from which updates are downloaded
 String getBoundary()
          Gets the "boundary" condition for the scanner.
 String getCalculator()
          Gets the FQCN of the calculator used to compute the results of a scan
 String getConfidence()
          Gets the "confidence" rating for the engine.
 String getDnsResolver()
          Gets the FQCN of the DNS Resolver used to resolve DNS records
 String getErrorHandler()
          Gets the FQCN of the error handler used to handle errors which are otherwise unable to be handled
 String getEsf()
          Returns the Effective Size Factor.
 String getFtt()
          Gets the Few Token Threshold for the scanner
The Few Token Threshold refers to the threshold below which an alternate algorithm is used by the RobinsonScanner to determine the internal Chi Square value
 String getGuess()
          The guess is the value ascribed to result when no definative information about the nature of the email could be deduced
 String getHeaderParser()
          Gets the FQCN of the parser used to parse received headers
 String getInetResolver()
          Gets the FQCN of the Inet Resolver used to resolve InetAddress records
 String getLibPath()
          Gets the classpath-relative path to the primary library repository.
 String getMimeParser()
          Gets the FQCN of the parser used to parse MimeMessages
 JasenParserConfiguration getParserConfiguration()
          Gets the configuration for the native HTML parser.
 List getPluginConfigurations()
          Gets the list of configurations which pertain to the plugins used by the engine
 String getResult()
          Gets the FQCN of the result class returned by a call to scan
 String getTokenizer()
          Gets the FQCN of the tokenizer used to reduce the email to a set of tokens (words)
 String getTokenLimit()
          Gets the max number of tokens extracted from a message
 void setAutoUpdateCheckOnStartup(String autoUpdateCheckOnStartup)
          Sets the value of the auto update check-on-startup configuration.
 void setAutoUpdateEnabled(String autoUpdateEnabled)
          Sets the value of the auto update enabled configuration.
 void setAutoUpdateErrorHandler(String autoUpdateErrorHandler)
          Sets the class name of the error handler to use in the auto update engine.
 void setAutoUpdateFrequency(String autoUpdateFrequency)
          Sets the frequency of the auto-update engine in minutes
 void setAutoUpdateParcel(String autoUpdateParcel)
          Gets the name of the (XML) file which resides on the update server and which contains the update parcel information
 void setAutoUpdateReadBuffer(String autoUpdateReadBuffer)
          Sets the size (in bytes) of the buffer to use when downloading updates
 void setAutoUpdateReadTimout(String autoUpdateReadTimout)
          Sets the timeout (in milliseconds) to be used when reading update information from the update server
 void setAutoUpdateUrl(String autoUpdateUrl)
          Sets the URL from which updates are downloaded
 void setBoundary(String boundary)
          Sets the "boundary" condition for the scanner.
 void setCalculator(String probabilityCalculatorClass)
          Sets the FQCN of the calculator used to compute the results of a scan
 void setConfidence(String confidence)
          Gets the "confidence" rating for the engine.
 void setDnsResolver(String dnsResolver)
          Sets the FQCN of the DNS Resolver used to resolve DNS records
 void setErrorHandler(String errorHandler)
          Sets the FQCN of the error handler used to handle errors which are otherwise unable to be handled
 void setEsf(String esf)
          Sets the Effective Size Factor.
 void setFtt(String ftt)
          Gets the Few Token Threshold for the scanner
The Few Token Threshold refers to the threshold below which an alternate algorithm is used by the RobinsonScanner to determine the internal Chi Square value
 void setGuess(String guess)
          The guess is the value ascribed to result when no definative information about the nature of the email could be deduced
 void setHeaderParser(String headerParserClass)
          Sets the FQCN of the parser used to parse received headers
 void setInetResolver(String inetResolver)
          Sets the FQCN of the Inet Resolver used to resolve InetAddress records
 void setLibPath(String libPath)
          Sets the classpath-relative path to the primary library repository.
 void setMimeParser(String mimeParserClass)
          Sets the FQCN of the parser used to parse MimeMessages
 void setParserConfiguration(JasenParserConfiguration parserConfiguration)
          Sets the configuration for the native HTML parser
 void setPluginConfigurations(List pluginConfigurations)
          Sets the list of configurations which pertain to the plugins used by the engine
 void setResult(String result)
          Sets the FQCN of the result class returned by a call to scan
 void setTokenizer(String textTokenizerClass)
          Sets the FQCN of the tokenizer used to reduce the email to a set of tokens (words)
 void setTokenLimit(String tokenLimit)
          Sets the max number of tokens extracted from a message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONFIG_PATH

public static final String DEFAULT_CONFIG_PATH
See Also:
Constant Field Values
Constructor Detail

JasenConfiguration

public JasenConfiguration()
Constructs a new configuration instance

Method Detail

getHeaderParser

public String getHeaderParser()
Gets the FQCN of the parser used to parse received headers

Returns:
The class name of the header parser in use

setHeaderParser

public void setHeaderParser(String headerParserClass)
Sets the FQCN of the parser used to parse received headers

Parameters:
headerParserClass -

getMimeParser

public String getMimeParser()
Gets the FQCN of the parser used to parse MimeMessages

Returns:
The class name of the Mime Parser in use

setMimeParser

public void setMimeParser(String mimeParserClass)
Sets the FQCN of the parser used to parse MimeMessages

Parameters:
mimeParserClass -

getPluginConfigurations

public List getPluginConfigurations()
Gets the list of configurations which pertain to the plugins used by the engine

Returns:
A List of JasenPluginConfiguration objects
See Also:
JasenPluginConfiguration

setPluginConfigurations

public void setPluginConfigurations(List pluginConfigurations)
Sets the list of configurations which pertain to the plugins used by the engine

Parameters:
pluginConfigurations -
See Also:
JasenPluginConfiguration

addPluginConfiguration

public void addPluginConfiguration(JasenPluginConfiguration config)
Adds a plugin configuration

Parameters:
config -
See Also:
JasenPluginConfiguration

getCalculator

public String getCalculator()
Gets the FQCN of the calculator used to compute the results of a scan

Returns:
The class name of the calculator in use
See Also:
ProbabilityCalculator

setCalculator

public void setCalculator(String probabilityCalculatorClass)
Sets the FQCN of the calculator used to compute the results of a scan

Parameters:
probabilityCalculatorClass -
See Also:
ProbabilityCalculator

getTokenizer

public String getTokenizer()
Gets the FQCN of the tokenizer used to reduce the email to a set of tokens (words)

Returns:

setTokenizer

public void setTokenizer(String textTokenizerClass)
Sets the FQCN of the tokenizer used to reduce the email to a set of tokens (words)

Parameters:
textTokenizerClass -

getResult

public String getResult()
Gets the FQCN of the result class returned by a call to scan

Returns:
See Also:
org.jasen.core.engine.Jasen#scan(MimeMessage)

setResult

public void setResult(String result)
Sets the FQCN of the result class returned by a call to scan

Parameters:
result -
See Also:
JasenScanner.scan(MimeMessage)

getConfidence

public String getConfidence()
Gets the "confidence" rating for the engine.
Confidence refers to the degree to which we "trust" the results produced by the engine, specifically the RobinsonScanner

Returns:
String
See Also:
RobinsonScanner

setConfidence

public void setConfidence(String confidence)
Gets the "confidence" rating for the engine.
Confidence refers to the degree to which we "trust" the results produced by the engine, specifically the RobinsonScanner

Parameters:
confidence - A value between 0.0 and 1.0
See Also:
RobinsonScanner

getEsf

public String getEsf()
Returns the Effective Size Factor. This is an internal configuration used by the RobinsonScanner

Returns:
The Effective Size Factor
See Also:
RobinsonScanner

setEsf

public void setEsf(String esf)
Sets the Effective Size Factor. This is an internal configuration used by the RobinsonScanner

Parameters:
esf - A value between 0.0 and 1.0
See Also:
RobinsonScanner

getGuess

public String getGuess()
The guess is the value ascribed to result when no definative information about the nature of the email could be deduced

Returns:
The guess value

setGuess

public void setGuess(String guess)
The guess is the value ascribed to result when no definative information about the nature of the email could be deduced

Parameters:
guess - A value between 0.0 and 1.0

getFtt

public String getFtt()
Gets the Few Token Threshold for the scanner
The Few Token Threshold refers to the threshold below which an alternate algorithm is used by the RobinsonScanner to determine the internal Chi Square value

Returns:
Returns the ftt.
See Also:
RobinsonScanner

setFtt

public void setFtt(String ftt)
Gets the Few Token Threshold for the scanner
The Few Token Threshold refers to the threshold below which an alternate algorithm is used by the RobinsonScanner to determine the internal Chi Square value

Parameters:
ftt - Must be > 0
See Also:
RobinsonScanner

getTokenLimit

public String getTokenLimit()
Gets the max number of tokens extracted from a message

Returns:

setTokenLimit

public void setTokenLimit(String tokenLimit)
Sets the max number of tokens extracted from a message

Parameters:
tokenLimit -

getDnsResolver

public String getDnsResolver()
Gets the FQCN of the DNS Resolver used to resolve DNS records

Returns:
The class name of the DNS Resolver in use

setDnsResolver

public void setDnsResolver(String dnsResolver)
Sets the FQCN of the DNS Resolver used to resolve DNS records

Parameters:
dnsResolver -

getInetResolver

public String getInetResolver()
Gets the FQCN of the Inet Resolver used to resolve InetAddress records

Returns:
The class name of the Inet Resolver in use

setInetResolver

public void setInetResolver(String inetResolver)
Sets the FQCN of the Inet Resolver used to resolve InetAddress records


getErrorHandler

public String getErrorHandler()
Gets the FQCN of the error handler used to handle errors which are otherwise unable to be handled

Returns:
The class name of the error handler in use

setErrorHandler

public void setErrorHandler(String errorHandler)
Sets the FQCN of the error handler used to handle errors which are otherwise unable to be handled

Parameters:
errorHandler -

getBoundary

public String getBoundary()
Gets the "boundary" condition for the scanner. Scan results from any plugin with be normalized to be within the boundary
For example: If the boundary is set to 0.01, all plugin results will be normalized to 0.01 <= result <= 0.09

Returns:
The boundary for all scans

setBoundary

public void setBoundary(String boundary)
Sets the "boundary" condition for the scanner. Scan results from any plugin with be normalized to be within the boundary
For example: If the boundary is set to 0.01, all plugin results will be normalized to 0.01 <= result <= 0.09

Parameters:
boundary - A value between 0.0 and 1.0

getAutoUpdateFrequency

public String getAutoUpdateFrequency()
Gets the frequency of the auto-update engine in minutes

Returns:
The time in minutes between each update check

setAutoUpdateFrequency

public void setAutoUpdateFrequency(String autoUpdateFrequency)
Sets the frequency of the auto-update engine in minutes

Parameters:
autoUpdateFrequency -

getAutoUpdateUrl

public String getAutoUpdateUrl()
Gets the URL from which updates are downloaded

Returns:
The URL from which updates are downloaded

setAutoUpdateUrl

public void setAutoUpdateUrl(String autoUpdateUrl)
Sets the URL from which updates are downloaded

Parameters:
autoUpdateUrl -

getAutoUpdateEnabled

public String getAutoUpdateEnabled()
Gets the value of the auto update enabled configuration.

Returns:
A String representation of a boolean value which indicates whether the auto update engine will be enabled

setAutoUpdateEnabled

public void setAutoUpdateEnabled(String autoUpdateEnabled)
Sets the value of the auto update enabled configuration.

Parameters:
autoUpdateEnabled - A String representation of a boolean value which indicates whether the auto update engine will be enabled

getAutoUpdateCheckOnStartup

public String getAutoUpdateCheckOnStartup()
Gets the value of the auto update check-on-startup configuration.

Returns:
A String representation of a boolean value which indicates whether the auto update engine will check for updates upon engine start

setAutoUpdateCheckOnStartup

public void setAutoUpdateCheckOnStartup(String autoUpdateCheckOnStartup)
Sets the value of the auto update check-on-startup configuration.

Parameters:
autoUpdateCheckOnStartup - A String representation of a boolean value which indicates whether the auto update engine will check for updates upon engine start

getAutoUpdateErrorHandler

public String getAutoUpdateErrorHandler()
Gets the class name of the error handler to use in the auto update engine.

Returns:
The FQCN of the error handler to use in the auto update engine.

setAutoUpdateErrorHandler

public void setAutoUpdateErrorHandler(String autoUpdateErrorHandler)
Sets the class name of the error handler to use in the auto update engine.

Parameters:
autoUpdateErrorHandler - The FQCN of the error handler to use in the auto update engine.

getAutoUpdateParcel

public String getAutoUpdateParcel()
Gets the name of the (XML) file which resides on the update server and which contains the update parcel information

Returns:
The filename of the update parcel

setAutoUpdateParcel

public void setAutoUpdateParcel(String autoUpdateParcel)
Gets the name of the (XML) file which resides on the update server and which contains the update parcel information

Parameters:
autoUpdateParcel - The filename of the update parcel

getAutoUpdateReadBuffer

public String getAutoUpdateReadBuffer()
Gets the size (in bytes) of the buffer to use when downloading updates

Returns:
The size as a String representation of a long value

setAutoUpdateReadBuffer

public void setAutoUpdateReadBuffer(String autoUpdateReadBuffer)
Sets the size (in bytes) of the buffer to use when downloading updates

Parameters:
autoUpdateReadBuffer - The size as a String representation of a long value

getAutoUpdateReadTimout

public String getAutoUpdateReadTimout()
Gets the timeout (in milliseconds) to be used when reading update information from the update server

Returns:
The timeout as a String representation of a long

setAutoUpdateReadTimout

public void setAutoUpdateReadTimout(String autoUpdateReadTimout)
Sets the timeout (in milliseconds) to be used when reading update information from the update server

Parameters:
autoUpdateReadTimout - The timeout as a String representation of a long

getLibPath

public String getLibPath()
Gets the classpath-relative path to the primary library repository.

That is, the folder in which the JAR files for the engine reside

Returns:
A String representation of the lib path

setLibPath

public void setLibPath(String libPath)
Sets the classpath-relative path to the primary library repository.

That is, the folder in which the JAR files for the engine reside

Parameters:
libPath - A String representation of the lib path

getParserConfiguration

public JasenParserConfiguration getParserConfiguration()
Gets the configuration for the native HTML parser.

Returns:
The current configuration used for the native HTML parser

setParserConfiguration

public void setParserConfiguration(JasenParserConfiguration parserConfiguration)
Sets the configuration for the native HTML parser

Parameters:
parserConfiguration -