iiitAccessServer 1.0

de.iiit.access.server.plugins.cachemanager
Class CacheManager

java.lang.Object
  |
  +--de.iiit.access.server.plugins.cachemanager.CacheManager
All Implemented Interfaces:
AccessServerPluginIf, ThreadPluginIf

public class CacheManager
extends Object
implements ThreadPluginIf

The CacheManager manages the 2nd-level cache stored in databases. To do this, it reads and parses the OpenLDAP server's replication log file. If a fatal error occurs, the whole AccessServer will be aborted by a call to System.exit().


Constructor Summary
CacheManager()
          Creates a new instance of CacheDatabaseManager
 
Method Summary
protected  CacheManagerErrorHandler errorHandler()
          Retrieves an instance of the CacheMnagerErrorHandler
protected  JdbcConnectionPool getAdminPool()
          Retrieves a handle to the admin database
protected  JdbcConnectionPool getCacheConnectionPool(int dbnum)
          Retrieves one of the configured cache database handles
protected  JdbcConnectionPool getCacheConnectionPool(String md5sum)
          Retrieves the handle of cache database responsible for a distinct MD5 checksum
protected  int getCachePoolCount()
          Retrieves the number of configured cache databases.
protected  LdapUtil getLdapUtil()
          Retrieves a ready-to-use LdapUtil object.
 void initialize(Configuration config)
          Initializes the CacheManagerPlugin
protected  int refreshIntervall()
          Retrieves the configured intervall to read the LDAP replication file
protected  String replicationFile()
          Retrieves the configured name of the LDAP replication file.
 void shutdown()
          This method is called by the AccessServer when the background threads should stop because of a shutdown of the AccessServer itself.
protected  String smtpMailTo()
          Retrieves the configured address to use for error mails.
protected  String smtpPassword()
          Retrieves the configured password to use for SMTP connections
protected  int smtpPort()
          Retrieves the configured port number of the SMTP server
protected  String smtpServer()
          Retrieves the configured name of the SMTP server to use for sending error mails.
protected  String smtpUser()
          Retrieves the configured user name to use for SMTP connections
 void start()
          Starts the CacheManager's background threads.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheManager

public CacheManager()
Creates a new instance of CacheDatabaseManager

Method Detail

initialize

public void initialize(Configuration config)
Initializes the CacheManagerPlugin

Specified by:
initialize in interface AccessServerPluginIf
Parameters:
config - the configuration of the cache manager

start

public void start()
Starts the CacheManager's background threads. This method is called by the AccessServer after the initialization of all sub-moduls.

Specified by:
start in interface ThreadPluginIf

shutdown

public void shutdown()
This method is called by the AccessServer when the background threads should stop because of a shutdown of the AccessServer itself.

Specified by:
shutdown in interface ThreadPluginIf

errorHandler

protected CacheManagerErrorHandler errorHandler()
Retrieves an instance of the CacheMnagerErrorHandler

Returns:
an instance of the CacheMnagerErrorHandler

getAdminPool

protected JdbcConnectionPool getAdminPool()
Retrieves a handle to the admin database

Returns:
the handle to the admin database

getCachePoolCount

protected int getCachePoolCount()
Retrieves the number of configured cache databases.

Returns:
the number of configured cache databases

getCacheConnectionPool

protected JdbcConnectionPool getCacheConnectionPool(int dbnum)
Retrieves one of the configured cache database handles

Parameters:
dbnum - The number of the database handle
Returns:
the requested database handle

getCacheConnectionPool

protected JdbcConnectionPool getCacheConnectionPool(String md5sum)
Retrieves the handle of cache database responsible for a distinct MD5 checksum

Parameters:
md5sum - The MD5 sum for wich the database handle is needed
Returns:
the requested database handle

replicationFile

protected String replicationFile()
Retrieves the configured name of the LDAP replication file.

Returns:
the name of the LDAP replication file

refreshIntervall

protected int refreshIntervall()
Retrieves the configured intervall to read the LDAP replication file

Returns:
the configured intervall

smtpServer

protected String smtpServer()
Retrieves the configured name of the SMTP server to use for sending error mails.

Returns:
the name of the SMTP server

smtpPort

protected int smtpPort()
Retrieves the configured port number of the SMTP server

Returns:
the port number

smtpUser

protected String smtpUser()
Retrieves the configured user name to use for SMTP connections

Returns:
the user name

smtpPassword

protected String smtpPassword()
Retrieves the configured password to use for SMTP connections

Returns:
the password

smtpMailTo

protected String smtpMailTo()
Retrieves the configured address to use for error mails.

Returns:
the mail address

getLdapUtil

protected LdapUtil getLdapUtil()
Retrieves a ready-to-use LdapUtil object.

Returns:
the LdapUtil object to use for LDAP requests

iiitAccessServer 1.0

Copyright © 2002, 2003 ingeneurbuero fuer innovative informationstechnik, Dipl.-Ing. Joerg Beckmann, Dortmund, Germany. All Rights Reserved.
See Copyright statement