TPTP 4.4.0 Monitoring Tools Project
Public API Specification

org.eclipse.hyades.sdb.analysis
Class AnalysisEngine

java.lang.Object
  extended byorg.eclipse.hyades.sdb.analysis.AnalysisEngine
All Implemented Interfaces:
org.eclipse.hyades.analysis.engine.IAnalysisEngine

public final class AnalysisEngine
extends java.lang.Object
implements org.eclipse.hyades.analysis.engine.IAnalysisEngine

Implementation of the IAnalysisEngine interface.

This class provides a static API to retrieve a new instance of an AnalysisEngine.

An Analysis Engine instance uses one symptom database to search for zero or more Directive(s) based on zero or more Incident matches.

The symptom database is loaded into an EMF model structure from a predefined formatted XML file. The symptom database may be reloaded/merged/removed/replaced.

Usage:

 AnalysisEngine analysisEngine = AnalysisEngine.getInstance(symptomDBPath)
 Object[] analysis = analysisEngine.analyze(incident);
 


Method Summary
 java.lang.Object[] analyze(org.eclipse.hyades.analysis.engine.Incident incident)
          The current symptom database is searched for Incident matches.
 org.eclipse.hyades.analysis.engine.Solution[] analyzeForSolutions(org.eclipse.hyades.analysis.engine.Incident incident)
          The current symptom database is searched for Incident matches.
static AnalysisEngine getInstance()
          Static API to retrieve a new instance of an AnalysisEngine without an associated symptom database.
static AnalysisEngine getInstance(java.lang.String symptomDbPath)
          Static API to retrieve a new instance of an AnalysisEngine.
 java.lang.String getSymptomDatabasePath()
          Returns the XMI file path of the base symptom database.
 boolean mergeSymptomDatabase(java.lang.String symptomDbPath)
          Loads a new symptom database XMI file denoted by the parameter path and merges any unique records with the base symptom database
 boolean reloadSymptomDatabase()
          Reloads the base symptom database from the base symptom database XMI file.
 boolean removeSymptomDatabase()
          Removes the base symptom database.
 boolean replaceSymptomDatabase(java.lang.String symptomDbPath)
          A new XMISymptomDB symptom database is created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AnalysisEngine getInstance()
Static API to retrieve a new instance of an AnalysisEngine without an associated symptom database.

NOTE: A base symptom database may be added using replaceSymptomDatabase(symptomDbPath).

Returns:
the newly created AnalysisEngine instance
See Also:
replaceSymptomDatabase(String)

getInstance

public static AnalysisEngine getInstance(java.lang.String symptomDbPath)
Static API to retrieve a new instance of an AnalysisEngine.

Parameters:
symptomDbPath - the path to the symptom database XMI file
Returns:
the newly created AnalysisEngine instance

reloadSymptomDatabase

public boolean reloadSymptomDatabase()
Reloads the base symptom database from the base symptom database XMI file.

Specified by:
reloadSymptomDatabase in interface org.eclipse.hyades.analysis.engine.IAnalysisEngine
Returns:
true if the symptom database has been successfully reloaded

mergeSymptomDatabase

public boolean mergeSymptomDatabase(java.lang.String symptomDbPath)
Loads a new symptom database XMI file denoted by the parameter path and merges any unique records with the base symptom database

Specified by:
mergeSymptomDatabase in interface org.eclipse.hyades.analysis.engine.IAnalysisEngine
Parameters:
symptomDbPath - the path to the merged symptom database XMI file
Returns:
true if the new symptom database has been successfully merged

removeSymptomDatabase

public boolean removeSymptomDatabase()
Removes the base symptom database.

NOTE: A base symptom database may be added using replaceSymptomDatabase(symptomDbPath).

Specified by:
removeSymptomDatabase in interface org.eclipse.hyades.analysis.engine.IAnalysisEngine
Returns:
true if the symptom database has been successfully removed
See Also:
replaceSymptomDatabase(String)

replaceSymptomDatabase

public boolean replaceSymptomDatabase(java.lang.String symptomDbPath)
A new XMISymptomDB symptom database is created. and the symptom database XMI file denoted by the parameter path is attempted to be loaded.

If the new symptom database XMI file was successfully loaded, it replaces the base symptom database.

Specified by:
replaceSymptomDatabase in interface org.eclipse.hyades.analysis.engine.IAnalysisEngine
Parameters:
symptomDbPath - the path to the symptom database XMI file
Returns:
true if the new symptom database has been successfully replaced

getSymptomDatabasePath

public java.lang.String getSymptomDatabasePath()
Returns the XMI file path of the base symptom database.

If no base symptom database is loaded, null is returned.

Specified by:
getSymptomDatabasePath in interface org.eclipse.hyades.analysis.engine.IAnalysisEngine
Returns:
the file path of the base symptom database, otherwise null

analyze

public java.lang.Object[] analyze(org.eclipse.hyades.analysis.engine.Incident incident)
The current symptom database is searched for Incident matches.

All Directive(s) from successful Incident matches are returned in an array structure.

Incident matches are based on a lexicographical String comparison between the messageId in the parameter Incident and the value attribute of the matchPattern Node in the base symptom database.

Specified by:
analyze in interface org.eclipse.hyades.analysis.engine.IAnalysisEngine
Parameters:
incident - the search criteria used for possible matches
Returns:
an array of Directive from successful Incident matches
See Also:
Directive, Incident

analyzeForSolutions

public org.eclipse.hyades.analysis.engine.Solution[] analyzeForSolutions(org.eclipse.hyades.analysis.engine.Incident incident)
The current symptom database is searched for Incident matches.

All Solution(s) from successful Incident matches are returned in an array structure.

Incident matches are based on a lexicographical String comparison between the messageId and rawData array in the parameter Incident and the value attribute of the matchPattern Node in the base symptom database.

Specified by:
analyzeForSolutions in interface org.eclipse.hyades.analysis.engine.IAnalysisEngine
Parameters:
incident - the search criteria used for possible matches
Returns:
an array of Solution from successful Incident matches
See Also:
Solution, Incident

TPTP 4.4.0 Monitoring Tools Project
Public API Specification