Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.lucane.server
Class DBTableAccess  view DBTableAccess download DBTableAccess.java

java.lang.Object
  extended byorg.lucane.server.DBTableAccess
Direct Known Subclasses:
GroupManager, PluginManager, ServiceManager, UserManager

public abstract class DBTableAccess
extends java.lang.Object

Base class for Server's Managers


Field Summary
protected  java.sql.Connection conn
           
private  java.util.Vector fields
           
private  boolean isValid
           
protected  org.lucane.server.database.DatabaseLayer layer
           
private  boolean linkExist
           
protected  Server parent
           
protected  java.lang.String request
           
protected  java.sql.ResultSet res
           
protected  java.sql.Statement st
           
private  boolean tableExist
           
private  java.lang.String tablename
           
 
Constructor Summary
DBTableAccess(Server parent)
          Constructor
 
Method Summary
 int addEntry(java.lang.String key, java.util.Vector values)
          Add a line to the table
protected  int addEntryValidation(java.lang.String key, java.util.Vector values)
          Used to validate a new entry.
 void addLink(java.lang.String key, java.lang.String link)
          Add an entry in the link table
 void createTable(boolean init)
          Create the tables associated with the manager
 java.util.Vector getAllEntryKey()
          Get the first field for each line of the manager's table
 java.util.Vector getAllKeyForLink(java.lang.String link)
          Get all entries associated with a link
 java.util.Vector getAllLinks(java.lang.String key)
          Get all the links associated with an entry
 java.util.Vector getAllValues(java.lang.String key, java.lang.String field)
          Get the value of a field for all entries with the key given in parameter
 java.util.Vector getColumns()
          Get the list of columns
 java.lang.String getFirstValue(java.lang.String key, java.lang.String field)
          Get a value from an entry identified by its key
protected  void initManager(java.lang.String tablename, java.util.Vector fields)
          Check the exsitance and validity of the table given in parameter.
protected  void initTable()
          Initialize a table after its creation
 boolean isExistinglink(java.lang.String key, java.lang.String link)
          Check wether a link is already existing
 void removeEntry(java.lang.String key)
          Remove a line from the table
 void removeLink(java.lang.String key, java.lang.String link)
          Remove an entry in the link table
 void removeTable()
          Delete associated tables
 int setValue(java.lang.String key, java.lang.String field, java.lang.String value)
          Modify an entry
protected  int setValueValidation(java.lang.String key, java.lang.String field, java.lang.String value)
          Used to validate a new value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected Server parent

conn

protected java.sql.Connection conn

layer

protected org.lucane.server.database.DatabaseLayer layer

st

protected java.sql.Statement st

res

protected java.sql.ResultSet res

request

protected java.lang.String request

tablename

private java.lang.String tablename

fields

private java.util.Vector fields

isValid

private boolean isValid

tableExist

private boolean tableExist

linkExist

private boolean linkExist
Constructor Detail

DBTableAccess

public DBTableAccess(Server parent)
Constructor

Method Detail

initManager

protected void initManager(java.lang.String tablename,
                           java.util.Vector fields)
Check the exsitance and validity of the table given in parameter. This method must be called in subclasses' constructors


createTable

public void createTable(boolean init)
Create the tables associated with the manager


removeTable

public void removeTable()
Delete associated tables


getColumns

public java.util.Vector getColumns()
Get the list of columns


addEntry

public int addEntry(java.lang.String key,
                    java.util.Vector values)
Add a line to the table


removeEntry

public void removeEntry(java.lang.String key)
Remove a line from the table


getAllEntryKey

public java.util.Vector getAllEntryKey()
Get the first field for each line of the manager's table


setValue

public int setValue(java.lang.String key,
                    java.lang.String field,
                    java.lang.String value)
Modify an entry


getFirstValue

public java.lang.String getFirstValue(java.lang.String key,
                                      java.lang.String field)
Get a value from an entry identified by its key


getAllValues

public java.util.Vector getAllValues(java.lang.String key,
                                     java.lang.String field)
Get the value of a field for all entries with the key given in parameter


addLink

public void addLink(java.lang.String key,
                    java.lang.String link)
Add an entry in the link table


removeLink

public void removeLink(java.lang.String key,
                       java.lang.String link)
Remove an entry in the link table


getAllLinks

public java.util.Vector getAllLinks(java.lang.String key)
Get all the links associated with an entry


getAllKeyForLink

public java.util.Vector getAllKeyForLink(java.lang.String link)
Get all entries associated with a link


isExistinglink

public boolean isExistinglink(java.lang.String key,
                              java.lang.String link)
Check wether a link is already existing


initTable

protected void initTable()
Initialize a table after its creation


addEntryValidation

protected int addEntryValidation(java.lang.String key,
                                 java.util.Vector values)
Used to validate a new entry. This methods has to be redefined in subclasses


setValueValidation

protected int setValueValidation(java.lang.String key,
                                 java.lang.String field,
                                 java.lang.String value)
Used to validate a new value. This method has to be redefined in subclasses