net.sf.bloof
Class Bloof

java.lang.Object
  |
  +--net.sf.bloof.Bloof

public class Bloof
extends java.lang.Object

Central controlling class for the Bloof system. Any client that want to use the Bloof API mainly uses the static functions provided by this class.

Version:
$Id: Bloof.java,v 1.25 2003/09/13 12:22:45 pekacki Exp $
Author:
Lukasz Pekacki

Field Summary
static DbAccess INTERNAL_DATABASE
          CvsAccess to internal McKoi Database
static java.lang.String LOCAL_BLOOF_DIR
          Bloof local dir
 
Constructor Summary
Bloof()
           
 
Method Summary
static void addBloofEventListener(BloofEventListener aListener)
          Adds a Listener to the Bloof event dispatching list
static void addBloofExceptionListener(BloofExceptionListener aListener)
          Registers a new ExceptionListener to Bloof.
static void addProgressListener(ProgressListener aProgressListener)
          Registers a new ProgressListener to Bloof.
static void closeProject()
          Closes the current project
static void collectGarbage()
          Runs the garbage collector and finalizers in order to free memory.
static void exit()
          This method is called on exit of Bloof
static void exportResult(Metric aMetric, java.lang.String aFileName)
          Exports the result of a metric to a XML file
static void fail(java.lang.String aFailReason)
          This method is called if a serious error has occured during processing.
static Database getDatabase()
          Returns the current database
static void importProject(ScmAccess aScmAccess, DbAccess aDbAccess)
          Fills a new database with the data stored in the scm accessd by scmAccess
static void openProject(DbAccess aDbAccess)
          Opens the project in the specified database connection
static void propagateBloofEvent(BloofEvent aPe)
          Notifies the registered ProgessEventListeners about a new Bloof Event
static void propagateBloofException(BloofException aBloofException)
          Notifies the registered BloofExecptionListeners about a new Exception
static void propagateProgressEvent(ProgressEvent aPe)
          Notifies the registered ProgessEventListeners about a new Progress
static void runMetric(Metric aMetric)
          Runs a metric
static void setDatabase(Database aDatabase)
           
static void updateProject(ScmAccess aScmAccess, DbAccess aDbAccess)
          Fills a new database with the data stored in the scm accessd by scmAccess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_BLOOF_DIR

public static final java.lang.String LOCAL_BLOOF_DIR
Bloof local dir


INTERNAL_DATABASE

public static final DbAccess INTERNAL_DATABASE
CvsAccess to internal McKoi Database

Constructor Detail

Bloof

public Bloof()
Method Detail

addBloofEventListener

public static void addBloofEventListener(BloofEventListener aListener)
Adds a Listener to the Bloof event dispatching list

Parameters:
aListener - Listener to add

addBloofExceptionListener

public static void addBloofExceptionListener(BloofExceptionListener aListener)
Registers a new ExceptionListener to Bloof.

Parameters:
aListener - receives progress events

addProgressListener

public static void addProgressListener(ProgressListener aProgressListener)
Registers a new ProgressListener to Bloof.

Parameters:
aProgressListener - receives progress events

closeProject

public static void closeProject()
                         throws java.sql.SQLException,
                                java.io.IOException
Closes the current project

Throws:
java.sql.SQLException - if the database could not be found or started
java.io.IOException - if the database could not be found or started

collectGarbage

public static void collectGarbage()
Runs the garbage collector and finalizers in order to free memory.


exit

public static void exit()
This method is called on exit of Bloof


exportResult

public static void exportResult(Metric aMetric,
                                java.lang.String aFileName)
Exports the result of a metric to a XML file

Parameters:
aMetric - the result of which is to be exported
aFileName - name of the XML file

fail

public static void fail(java.lang.String aFailReason)
This method is called if a serious error has occured during processing. The client that

Parameters:
aFailReason - reason for exit.

getDatabase

public static Database getDatabase()
Returns the current database

Returns:
current database

importProject

public static void importProject(ScmAccess aScmAccess,
                                 DbAccess aDbAccess)
                          throws java.sql.SQLException,
                                 ScmAccessException,
                                 java.io.IOException
Fills a new database with the data stored in the scm accessd by scmAccess

Parameters:
aScmAccess - access object
aDbAccess - access object for the database to be used
Throws:
java.sql.SQLException - on database error
java.io.IOException - on database script error
ScmAccessException - on scm access error

openProject

public static void openProject(DbAccess aDbAccess)
                        throws java.sql.SQLException
Opens the project in the specified database connection

Parameters:
aDbAccess - access object for the database to be used
Throws:
java.sql.SQLException - if the database could not be found or started

propagateBloofEvent

public static void propagateBloofEvent(BloofEvent aPe)
Notifies the registered ProgessEventListeners about a new Bloof Event

Parameters:
aPe - BloofEvent that had happend

propagateBloofException

public static void propagateBloofException(BloofException aBloofException)
Notifies the registered BloofExecptionListeners about a new Exception

Parameters:
aBloofException - Exception that has happend

propagateProgressEvent

public static void propagateProgressEvent(ProgressEvent aPe)
Notifies the registered ProgessEventListeners about a new Progress

Parameters:
aPe - Progress that had happend

runMetric

public static void runMetric(Metric aMetric)
Runs a metric

Parameters:
aMetric - metric to run

setDatabase

public static void setDatabase(Database aDatabase)
Parameters:
aDatabase - new database

updateProject

public static void updateProject(ScmAccess aScmAccess,
                                 DbAccess aDbAccess)
                          throws java.sql.SQLException,
                                 ScmAccessException,
                                 java.io.IOException
Fills a new database with the data stored in the scm accessd by scmAccess

Parameters:
aScmAccess - access object
aDbAccess - access object for the database to be used
Throws:
java.sql.SQLException - on database error
java.io.IOException - on database script error
ScmAccessException - on scm access error


Copyright © 2003 bloof@Sourceforge. All Rights Reserved.