iiitAccessServer 1.0

de.iiit.access.server.util.db.admindb
Class ToDoList

java.lang.Object
  |
  +--de.iiit.access.server.util.db.admindb.ToDoList

public class ToDoList
extends Object

Implements a wrapper for the database table "todolist" This table holds names of expression or group definition which have changed in the LDAP database and therefore must be updated in the cache database.


Constructor Summary
ToDoList(String expression, long touchTime, boolean locked)
          Creates a new instance of ToDoList
 
Method Summary
static boolean createToDoList(JdbcConnectionPool pool)
          Creates a new database table todolist.
 void deleteToDo(JdbcConnectionPool pool)
          Deletes the current object from the database.
static void fillToDoList(JdbcConnectionPool pool, Set values)
          Inserts a list of names into the database
 String getExpression()
          Retrieves the expression field of the current object
 boolean getLocked()
          Retrieves the lock field of the current object
 long getTouchTime()
          Retrieves the touchtime field of the current object
 void insertToDo(JdbcConnectionPool pool)
          Inserts a the current object into the database
static boolean searchToDo(JdbcConnectionPool pool, String cn)
          Searches for a name
static ToDoList selectToDo(JdbcConnectionPool pool)
          Reads and returns the first record out of the todolist.
 void setExpression(String expression)
          Sets the expression field of the current object
 void setLocked(boolean locked)
          Sets the lock field of the current object
 void setTouchTime(long touchTime)
          Sets the touchtime field of the current object
 void updateToDo(JdbcConnectionPool pool)
          Writes the content of the current object back to the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToDoList

public ToDoList(String expression,
                long touchTime,
                boolean locked)
Creates a new instance of ToDoList

Parameters:
expression - The name of the expression or group definition
touchTime - The time when the change was recognized in milliseconds since January, 1st 1970
locked - Before the update of the cache db starts this field will be set to '1'. This flag is used for optimization. If another change of the same expression or group is recognized, it will not be added to the todolist if this flag is still zero.
Method Detail

createToDoList

public static boolean createToDoList(JdbcConnectionPool pool)
                              throws JdbcException
Creates a new database table todolist.

Parameters:
pool - The database handle to use
Returns:
true if the table was created, false if it was already there.
Throws:
JdbcException - if a JDBC error occurs

fillToDoList

public static void fillToDoList(JdbcConnectionPool pool,
                                Set values)
                         throws JdbcException
Inserts a list of names into the database

Parameters:
pool - The database handle to use
values - The names to insert
Throws:
JdbcException - if a JDBC error occurs

searchToDo

public static boolean searchToDo(JdbcConnectionPool pool,
                                 String cn)
                          throws JdbcException
Searches for a name

Parameters:
pool - The database handle to use
cn - the name to search for
Returns:
true if such a record was found, false if not.
Throws:
JdbcException - if a JDBC error occurs

insertToDo

public void insertToDo(JdbcConnectionPool pool)
                throws JdbcException
Inserts a the current object into the database

Parameters:
pool - The database handle to use
Throws:
JdbcException - if a JDBC error occurs

selectToDo

public static ToDoList selectToDo(JdbcConnectionPool pool)
                           throws JdbcException
Reads and returns the first record out of the todolist.

Parameters:
pool - The database handle to use
Returns:
The read record or null if there is no one to read.
Throws:
JdbcException - if a JDBC error occurs

updateToDo

public void updateToDo(JdbcConnectionPool pool)
                throws JdbcException
Writes the content of the current object back to the database

Parameters:
pool - The database handle to use
Throws:
JdbcException - if a JDBC error occurs

deleteToDo

public void deleteToDo(JdbcConnectionPool pool)
                throws JdbcException
Deletes the current object from the database.

Parameters:
pool - The database handle to use
Throws:
JdbcException - if a JDBC error occurs

setExpression

public void setExpression(String expression)
Sets the expression field of the current object

Parameters:
expression - the expression

setTouchTime

public void setTouchTime(long touchTime)
Sets the touchtime field of the current object

Parameters:
touchTime - the time in milliseconds since January, 1st 1970

setLocked

public void setLocked(boolean locked)
Sets the lock field of the current object

Parameters:
locked - true if the record should be locked, false otherwise

getExpression

public String getExpression()
Retrieves the expression field of the current object

Returns:
the expression

getTouchTime

public long getTouchTime()
Retrieves the touchtime field of the current object

Returns:
the time in milliseconds since January, 1st 1970

getLocked

public boolean getLocked()
Retrieves the lock field of the current object

Returns:
true if the record is locked, false otherwise

iiitAccessServer 1.0

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