org.edg.security.authorization.map
Class DbMap

java.lang.Object
  |
  +--org.edg.security.authorization.map.DbMap
All Implemented Interfaces:
java.util.Map

public class DbMap
extends java.lang.Object
implements java.util.Map

Class DbMap. Interfaces an underlying SQL database table. Values associated with a key is returned in a List object.

Version:
$Id: DbMap.java,v 1.22 2003/10/27 15:58:51 gianluca Exp $
Author:
Niklas Karlsson HIP

Field Summary
protected  java.util.Map myMap
           
 
Constructor Summary
DbMap(java.lang.String db, java.lang.String driver, java.lang.String table, java.lang.String url, java.lang.String user, java.lang.String passwd, int interval)
          Constructor DbMap.
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 java.lang.Object get(java.lang.Object key)
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map t)
           
 java.lang.Object remove(java.lang.Object key)
           
static void setupDriver(java.lang.String url, java.lang.String user, java.lang.String passwd, java.lang.String db)
          Setup a pool of database connections.
 int size()
           
protected  void terminate()
          Remove the reference to the Timer object, in order to kill all threads responsible for refreshing the DbMap.
 java.util.Collection values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

myMap

protected java.util.Map myMap
Constructor Detail

DbMap

public DbMap(java.lang.String db,
             java.lang.String driver,
             java.lang.String table,
             java.lang.String url,
             java.lang.String user,
             java.lang.String passwd,
             int interval)
Constructor DbMap.

Parameters:
db - - the database
driver - - the driver
table - - the db table name
url - - url
user - - db user
passwd - - password
Method Detail

setupDriver

public static void setupDriver(java.lang.String url,
                               java.lang.String user,
                               java.lang.String passwd,
                               java.lang.String db)
Setup a pool of database connections. The pool is based on jakarta-dbcp technology.

Parameters:
url - The URL to connect to the database.
user - The username for the connection to the database.
passwd - The password for the connection to the databse.

size

public int size()
Specified by:
size in interface java.util.Map
See Also:
Map.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map
See Also:
Map.isEmpty()

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map
See Also:
Map.containsKey(Object)

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map
See Also:
Map.containsValue(Object)

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
See Also:
Map.get(Object)

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
See Also:
Map.put(Object, Object)

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
See Also:
Map.remove(Object)

putAll

public void putAll(java.util.Map t)
Specified by:
putAll in interface java.util.Map
See Also:
Map.putAll(Map)

clear

public void clear()
Specified by:
clear in interface java.util.Map
See Also:
Map.clear()

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map
See Also:
Map.keySet()

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map
See Also:
Map.values()

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map
See Also:
Map.entrySet()

terminate

protected void terminate()
Remove the reference to the Timer object, in order to kill all threads responsible for refreshing the DbMap.