All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.dorm4.fls.Maintainer

java.lang.Object
   |
   +----org.dorm4.fls.Maintainer

public class Maintainer
extends Object
implements ILibraryConstants
Class to maintain tables in the library


Constructor Index

 o Maintainer(OutputStream, Connection)

Method Index

 o addType(Item, int)
Creates a table for an Item and associates a default loan period and registers it
 o addType(StdLibraryObject)
Creates a table for the object and registers it
 o createDefaultDatabase(String, String)
Does most of the default setup and creation for a new database
 o getInfo(String)
Gets a value from the info table
 o getName()
Gets the name of the library
 o getRegisteredTypes()
Gets an array of class names for all registered types
 o isTypeRegistered(StdLibraryObject)
Checks to see if the type is registered
 o main(String[])
 o removeType(StdLibraryObject)
Removes the table for the object and unregisters it
 o setInfo(String, String)
Sets a value in the info table
 o setLoanPeriod(Item, int)
Associates a default loan period with an Item
 o setName(String)
Sets the name of the library

Constructors

 o Maintainer
 public Maintainer(OutputStream out,
                   Connection con)
Parameters:
out - The OutputStream that log messages are sent to.
con - The connection to the database.

Methods

 o main
 public static void main(String args[])
 o getName
 public String getName()
Gets the name of the library

 o setName
 public boolean setName(String name)
Sets the name of the library

Returns:
success
 o addType
 public boolean addType(StdLibraryObject obj)
Creates a table for the object and registers it

Parameters:
obj - Object to model the table after
Returns:
success
Throws: IllegalArgumentException
Thrown if the object already has a table
 o addType
 public boolean addType(Item itemType,
                        int loanPeriod)
Creates a table for an Item and associates a default loan period and registers it

Parameters:
obj - Item to model the table after
loanPeriod - Default loan period for the item in days
Returns:
success
Throws: IllegalArgumentException
Thrown if the object already has a table
 o removeType
 public boolean removeType(StdLibraryObject obj)
Removes the table for the object and unregisters it

Parameters:
obj - Object the table is modelled after
Returns:
success
 o getRegisteredTypes
 public String[] getRegisteredTypes()
Gets an array of class names for all registered types

 o isTypeRegistered
 public boolean isTypeRegistered(StdLibraryObject obj)
Checks to see if the type is registered

 o getInfo
 public String getInfo(String key)
Gets a value from the info table

 o setInfo
 public boolean setInfo(String key,
                        String value)
Sets a value in the info table

 o setLoanPeriod
 public boolean setLoanPeriod(Item itemType,
                              int loanPeriod)
Associates a default loan period with an Item

Parameters:
itemType - Item set the loan period for
loanPeriod - Default loan period for the Item in days
Returns:
success
 o createDefaultDatabase
 public boolean createDefaultDatabase(String name,
                                      String altName)
Does most of the default setup and creation for a new database

Returns:
success

All Packages  Class Hierarchy  This Package  Previous  Next  Index