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
-
Maintainer(OutputStream, Connection)
-
-
addType(Item, int)
- Creates a table for an Item and associates a default loan period and registers it
-
addType(StdLibraryObject)
- Creates a table for the object and registers it
-
createDefaultDatabase(String, String)
- Does most of the default setup and creation for a new database
-
getInfo(String)
- Gets a value from the info table
-
getName()
- Gets the name of the library
-
getRegisteredTypes()
- Gets an array of class names for all registered types
-
isTypeRegistered(StdLibraryObject)
- Checks to see if the type is registered
-
main(String[])
-
-
removeType(StdLibraryObject)
- Removes the table for the object and unregisters it
-
setInfo(String, String)
- Sets a value in the info table
-
setLoanPeriod(Item, int)
- Associates a default loan period with an Item
-
setName(String)
- Sets the name of the library
Maintainer
public Maintainer(OutputStream out,
Connection con)
- Parameters:
- out - The
OutputStream
that log messages are sent to.
- con - The connection to the database.
main
public static void main(String args[])
getName
public String getName()
- Gets the name of the library
setName
public boolean setName(String name)
- Sets the name of the library
- Returns:
- success
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
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
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
getRegisteredTypes
public String[] getRegisteredTypes()
- Gets an array of class names for all registered types
isTypeRegistered
public boolean isTypeRegistered(StdLibraryObject obj)
- Checks to see if the type is registered
getInfo
public String getInfo(String key)
- Gets a value from the info table
setInfo
public boolean setInfo(String key,
String value)
- Sets a value in the info table
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
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