|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasen.JasenScanner
JasenScanner is a singleton scanner class for safe scanning of email messages using the jASEN engine.
All message scanning should be done through this class to guarantee thread safety and in particular to allow for correct behaviour during auto updates.
It is not, however, mandatory that this class be used exclusively for scanning, merely recommended.
For direct (non-singleton) access to the engine, use the org.jasen.core.engine.Jasen class
Jasen
Method Summary | |
void |
destroy()
Destroys the engine and all registered plugins |
boolean |
forceUpdate()
Forces the engine to run an update check |
JasenAutoUpdateListener |
getAutoUpdateListener()
Gets the listener registered for auto update events if one has been set. |
Jasen |
getEngine()
Gets the reference to the internal scan engine |
static JasenScanner |
getInstance()
Gets the current instance of the JasenScanner |
List |
getPlugins()
Returns a read-only list of the plugins registered in the engine. |
JasenScanListener |
getScanListener()
Gets the listener registered for scan events if one has been set. |
void |
init()
Initialises the engine with the default configuration |
void |
init(InputStream in)
Deprecated. |
void |
init(JasenConfigurationLoader loader)
Initialises the engine using the configuration loader provided |
void |
init(String config)
Deprecated. |
boolean |
isAlive()
Returns true IFF the engine is initialised and ready for scans. |
boolean |
notifyPendingUpdate(JasenAutoUpdateParcel parcel)
Called by the AutoUpdateManager if there is an update pending to signal a pause in scanning |
void |
notifyScan()
Records the occurrance of a scan |
void |
notifyScanComplete()
Records the completion of a scan |
void |
notifyUpdateComplete(JasenAutoUpdateReport report)
Called by the AutoUpdateManager when the update has completed |
void |
notifyUpdateDownload(long bytes)
|
JasenScanResult |
scan(javax.mail.internet.MimeMessage mm)
Scans the given message. |
JasenScanResult |
scan(javax.mail.internet.MimeMessage mm,
float threshold)
Scans the given message. |
JasenScanResult |
scan(javax.mail.internet.MimeMessage mm,
float threshold,
String[] ignored)
Scans the given message. |
JasenScanResult |
scan(javax.mail.internet.MimeMessage mm,
JasenMessage message)
Scans the message without a threshold specified |
JasenScanResult |
scan(javax.mail.internet.MimeMessage mm,
JasenMessage message,
float threshold)
Scans the given mime message using the already mime-parsed JasenMessage. |
JasenScanResult |
scan(javax.mail.internet.MimeMessage mm,
JasenMessage message,
float threshold,
String[] ignored)
Scans the given mime message using the already mime-parsed JasenMessage. |
JasenScanResult |
scan(javax.mail.internet.MimeMessage mm,
JasenMessage message,
String[] ignored)
Scans the message without a threshold specified |
JasenScanResult |
scan(javax.mail.internet.MimeMessage mm,
String[] ignored)
Scans the given message. |
void |
setAutoUpdateListener(JasenAutoUpdateListener autoUpdateListener)
Sets the listener which will record update completion events. |
void |
setScanListener(JasenScanListener scanListener)
Sets the listener which will record scan events. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final JasenScanner getInstance()
public Jasen getEngine()
public void init() throws JasenException
JasenException
Jasen.init()
public void init(JasenConfigurationLoader loader) throws JasenException
loader
-
JasenException
Jasen.init(JasenConfigurationLoader)
public void init(String config) throws JasenException
config
- The absolute path to the configuration file
JasenException
Jasen.init(String)
public void init(InputStream in) throws JasenException
in
-
JasenException
Jasen.init(InputStream)
public void destroy()
public JasenScanResult scan(javax.mail.internet.MimeMessage mm) throws JasenException
All plugins will execute regardless of the probability (or computed total probability) discovered from any single plugin or combination thereof
mm
- The MimeMessage to be scanned
JasenException
public JasenScanResult scan(javax.mail.internet.MimeMessage mm, float threshold) throws JasenException
The threshold value indicates the value at which we know the message is spam without continuing
If the engine computes this threshold prior to all plugins executing, tests are stopped and the result is returned immediately
mm
- The MimeMessage to be scannedthreshold
- The marker above which scanning ceases
JasenException
scan(MimeMessage, JasenMessage, float)
public JasenScanResult scan(javax.mail.internet.MimeMessage mm, JasenMessage message) throws JasenException
mm
- The MimeMessage to be scannedmessage
- A pre-parsed JasenMessage
JasenException
scan(MimeMessage, JasenMessage, float)
public JasenScanResult scan(javax.mail.internet.MimeMessage mm, JasenMessage message, float threshold) throws JasenException
This implementation allows calling applications to implement their own JasenMessage by passing it to the scan engine.
mm
- The MimeMessage to be scannedmessage
- A pre-parsed JasenMessagethreshold
- The thresholds. If any one plugin yields a result >= threshold, scanning is ceased and the result returned immediately
JasenException
scan(MimeMessage, float)
public JasenScanResult scan(javax.mail.internet.MimeMessage mm, String[] ignored) throws JasenException
All plugins will execute regardless of the probability (or computed total probability) discovered from any single plugin or combination thereof
mm
- The MimeMessage to be scannedignored
- A list of plugin names which will be ignored during the scan. May be null
JasenException
public JasenScanResult scan(javax.mail.internet.MimeMessage mm, float threshold, String[] ignored) throws JasenException
The threshold value indicates the value at which we know the message is spam without continuing
If the engine computes this threshold prior to all plugins executing, tests are stopped and the result is returned immediately
mm
- The MimeMessage to be scannedthreshold
- The marker above which scanning ceasesignored
- A list of plugin names which will be ignored during the scan. May be null
JasenException
scan(MimeMessage, JasenMessage, float)
public JasenScanResult scan(javax.mail.internet.MimeMessage mm, JasenMessage message, String[] ignored) throws JasenException
mm
- The MimeMessage to be scannedmessage
- A pre-parsed JasenMessageignored
- A list of plugin names which will be ignored during the scan. May be null
JasenException
scan(MimeMessage, JasenMessage, float)
public JasenScanResult scan(javax.mail.internet.MimeMessage mm, JasenMessage message, float threshold, String[] ignored) throws JasenException
This implementation allows calling applications to implement their own JasenMessage by passing it to the scan engine.
mm
- The MimeMessage to be scannedmessage
- A pre-parsed JasenMessagethreshold
- The thresholds. If any one plugin yields a result >= threshold, scanning is ceased and the result returned immediatelyignored
- A list of plugin names which will be ignored during the scan. May be null
JasenException
scan(MimeMessage, JasenMessage, float)
public void notifyScan() throws JasenException
JasenException
public void notifyScanComplete() throws JasenException
JasenException
public boolean notifyPendingUpdate(JasenAutoUpdateParcel parcel)
public void notifyUpdateComplete(JasenAutoUpdateReport report) throws JasenException
report
- A report of the results of an update
JasenException
public void notifyUpdateDownload(long bytes)
public boolean isAlive()
public JasenScanListener getScanListener()
public void setScanListener(JasenScanListener scanListener)
scanListener
- public JasenAutoUpdateListener getAutoUpdateListener()
public void setAutoUpdateListener(JasenAutoUpdateListener autoUpdateListener)
autoUpdateListener
- public boolean forceUpdate() throws JasenException
JasenException
public List getPlugins()
PluginContainer
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |