org.mesopotamia
Class RepositoryFactory

java.lang.Object
  extended by org.mesopotamia.RepositoryFactory

public class RepositoryFactory
extends java.lang.Object

Central class which is responsible for managing languages and repositories.

Author:
Pavel Vlasov

Constructor Summary
RepositoryFactory(SQLProcessor processor, Worker worker, java.util.Timer timer, StringStorage stringStorage, java.lang.ClassLoader clsLoader)
           
 
Method Summary
 void consume(java.lang.Object source, java.lang.Exception e)
          Override if needed.
 Repository createRepository(java.lang.String name)
           
 void deleteSourceUnit(int id)
          Deletes source unit from the database.
 MesopotamiaEngine getEngine()
           
 java.lang.Object getGlobalParameter(java.lang.String name)
           
 IdentityManager getIdentityManager()
           
 java.security.MessageDigest getMessageDigest(java.lang.String algorithm)
          Returns message digest by name.
 SQLProcessor getProcessor()
           
 Repository getRepository(int id)
           
 RepositoryLanguage getRepositoryLanguage(Language language)
           
 java.util.Collection<RepositoryLanguage> getRepositoryLanguages()
           
 Scan getScan(int id)
           
 StringStorage getStringStorage()
           
 void process(java.lang.Runnable job)
          Processes job
 int storeErrorMessage(int scanId, java.lang.Integer sourceUnitId, java.lang.String errorType, java.lang.String errorMessage)
          Helper method for loaders.
 int storeErrorMessage(int scanId, java.lang.Integer sourceUnitId, java.lang.Throwable e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryFactory

public RepositoryFactory(SQLProcessor processor,
                         Worker worker,
                         java.util.Timer timer,
                         StringStorage stringStorage,
                         java.lang.ClassLoader clsLoader)
                  throws java.sql.SQLException
Parameters:
processor -
identityManager -
timer - Timer to schedule cache cleaning tasks. If null then internal timer is created.
Throws:
java.sql.SQLException
Method Detail

getGlobalParameter

public java.lang.Object getGlobalParameter(java.lang.String name)

getEngine

public MesopotamiaEngine getEngine()

getIdentityManager

public IdentityManager getIdentityManager()

getProcessor

public SQLProcessor getProcessor()

createRepository

public Repository createRepository(java.lang.String name)
                            throws MesopotamiaException
Throws:
MesopotamiaException

getRepository

public Repository getRepository(int id)
                         throws MesopotamiaException
Throws:
MesopotamiaException

getRepositoryLanguage

public RepositoryLanguage getRepositoryLanguage(Language language)

getRepositoryLanguages

public java.util.Collection<RepositoryLanguage> getRepositoryLanguages()

getMessageDigest

public java.security.MessageDigest getMessageDigest(java.lang.String algorithm)
                                             throws MesopotamiaException
Returns message digest by name.

Parameters:
algorithm -
Returns:
Throws:
MesopotamiaException

process

public void process(java.lang.Runnable job)
Processes job

Parameters:
job -

consume

public void consume(java.lang.Object source,
                    java.lang.Exception e)
Override if needed.


getScan

public Scan getScan(int id)
             throws MesopotamiaException
Throws:
MesopotamiaException

getStringStorage

public StringStorage getStringStorage()

storeErrorMessage

public int storeErrorMessage(int scanId,
                             java.lang.Integer sourceUnitId,
                             java.lang.String errorType,
                             java.lang.String errorMessage)
Helper method for loaders.

Parameters:
scanId -
sourceUnitId -
errorType -
errorMessage -
Returns:
Message record ID.
Throws:
java.sql.SQLException

storeErrorMessage

public int storeErrorMessage(int scanId,
                             java.lang.Integer sourceUnitId,
                             java.lang.Throwable e)

deleteSourceUnit

public void deleteSourceUnit(int id)
                      throws MesopotamiaException
Deletes source unit from the database.

Parameters:
id - Source unit ID.
Throws:
MesopotamiaException


Copyright © 2005 Hammurapi Group. All Rights Reserved.