universe.server.database
Class DatabaseDiskbased

java.lang.Object
  |
  +--universe.server.database.Database
        |
        +--universe.server.database.DatabaseDiskbased

public class DatabaseDiskbased
extends Database

This database type is completely disk based. All objects are stored on disk using the HashStore object.

Version:
$Id: DatabaseDiskbased.java,v 1.17 2002/05/19 18:17:03 brianrater Exp $
Author:
Sean Starkey

Field Summary
private  java.util.Hashtable currentGalaxies
           
private  java.util.Hashtable currentPlanets
           
private  java.util.Hashtable currentPlayers
           
private  java.util.Hashtable currentSystems
           
private  java.util.Hashtable galaxiesToBeDeleted
           
private  java.util.Hashtable galaxiesToBeSaved
           
private  com.equitysoft.hashstore.SyncDiskHashtable GalaxyDB
           
private  com.equitysoft.hashstore.SyncDiskHashtable PlanetDB
           
private  java.util.Hashtable planetsToBeDeleted
           
private  java.util.Hashtable planetsToBeSaved
           
private  com.equitysoft.hashstore.SyncDiskHashtable PlayerDB
           
private  java.util.Hashtable playersToBeDeleted
           
private  java.util.Hashtable playersToBeSaved
           
private  com.equitysoft.hashstore.SyncDiskHashtable SystemDB
           
private  java.util.Hashtable systemsToBeDeleted
           
private  java.util.Hashtable systemsToBeSaved
           
 
Constructor Summary
DatabaseDiskbased(java.lang.String directory)
          Constructor
 
Method Summary
 void delete(DBItem item)
          The delete method is used to remove an item from the database.
 DBItem get(Index index)
          The get method is used to retrieve specific data from the database.
 java.util.Enumeration query(Query query)
          The query method is used to retrieve a set of data elements from the database.
private  Index save_item(DBItem item)
           
 void save()
          The save method is used to store the current state of the database in permanent storage.
 Index store(DBItem item)
          The store method is used to change the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PlayerDB

private com.equitysoft.hashstore.SyncDiskHashtable PlayerDB

GalaxyDB

private com.equitysoft.hashstore.SyncDiskHashtable GalaxyDB

SystemDB

private com.equitysoft.hashstore.SyncDiskHashtable SystemDB

PlanetDB

private com.equitysoft.hashstore.SyncDiskHashtable PlanetDB

currentPlayers

private java.util.Hashtable currentPlayers

playersToBeSaved

private java.util.Hashtable playersToBeSaved

playersToBeDeleted

private java.util.Hashtable playersToBeDeleted

currentGalaxies

private java.util.Hashtable currentGalaxies

galaxiesToBeSaved

private java.util.Hashtable galaxiesToBeSaved

galaxiesToBeDeleted

private java.util.Hashtable galaxiesToBeDeleted

currentSystems

private java.util.Hashtable currentSystems

systemsToBeSaved

private java.util.Hashtable systemsToBeSaved

systemsToBeDeleted

private java.util.Hashtable systemsToBeDeleted

currentPlanets

private java.util.Hashtable currentPlanets

planetsToBeSaved

private java.util.Hashtable planetsToBeSaved

planetsToBeDeleted

private java.util.Hashtable planetsToBeDeleted
Constructor Detail

DatabaseDiskbased

public DatabaseDiskbased(java.lang.String directory)
Constructor

Parameters:
directory - Where to store the database files.
Method Detail

store

public Index store(DBItem item)
Description copied from class: Database
The store method is used to change the database. Whenever an object (DBItem) is changed, this function must be stored to commit the changes to the database.

Specified by:
store in class Database

save_item

private Index save_item(DBItem item)

get

public DBItem get(Index index)
Description copied from class: Database
The get method is used to retrieve specific data from the database. More than likely, the index used is from a query statement.

Specified by:
get in class Database

query

public java.util.Enumeration query(Query query)
Description copied from class: Database
The query method is used to retrieve a set of data elements from the database. To get specific information about an individual item, the get method should be used after the Index is found.

Specified by:
query in class Database

delete

public void delete(DBItem item)
Description copied from class: Database
The delete method is used to remove an item from the database.

Specified by:
delete in class Database

save

public void save()
Description copied from class: Database
The save method is used to store the current state of the database in permanent storage.

Specified by:
save in class Database


Copyright © 2001 Universe Dev Team All Rights Reserved.