arlut.csd.ganymede
Class Ganymede

java.lang.Object
  |
  +--arlut.csd.ganymede.Ganymede

public class Ganymede
extends java.lang.Object

This class is the main server module, providing the static main() method executed to start the server. This class is never instantiated, but instead provides a bunch of static variables and convenience methods in addition to the main() start method.

When started, the Ganymede server creates a DBStore object, which in turn creates and loads a set of DBObjectBase objects, one for each type of object held in the ganymede.db file. Each DBObjectBase contains DBObject objects which hold the DBField's which ultimately hold the actual data from the database.

The ganymede.db file may define a number of task classes that are to be run by the server at defined times. The server's main() method starts a background GanymedeScheduler thread to handle background tasks.

When the database has been loaded from disk, the main() method creates a GanymedeServer object. GanymedeServer implements the Server RMI remote interface, and is published in the RMI registry.

Clients and admin consoles may then connect to the published GanymedeServer object via RMI to establish a connection to the server.

The GanymedeServer's login method is used to create a GanymedeSession object to manage permissions and communications with an individual client. The client communicates with the GanymedeSession object through the Session RMI remote interface.

While the GanymedeServer's login method is used to handle client connections, the GanymedeServer's admin method is used to create a GanymedeAdmin object to handle the admin console's communications with the server. The admin console communicates with the GanymedeAdmin object through the adminSession RMI remote interface.

Most of the server's database logic is handled by the DBStore object and its related classes (DBObject, DBEditSet, DBNameSpace, and DBJournal).

All client permissions and communications are handled by the GanymedeSession class.


Field Summary
static BaseListTransport baseTransport
          A cached reference to a master base list serialization object.
static java.util.Vector builderTasks
          A vector of GanymedeBuilderTask objects initialized on database load.
static CategoryTransport catTransport
          A cached reference to a master category tree serialization object.
static DBStore db
          The Ganymede object store.
static java.lang.String dbFilename
           
static boolean debug
           
static java.lang.String debugFilename
          If the server is started with debug=<filename> on the command line, debugFilename will hold the name of the file to write our RMI debug log to.
static java.lang.String defaultmonitorpassProperty
           
static java.lang.String defaultrootpassProperty
           
static boolean firstrun
          This flag is true if the server was started with no pre-existing ganymede.db file.
static boolean forcelocalhost
          This flag is true if the server was started with a -forcelocalhost command line argument, which will allow the server to run even if it will only be accessible to localhost.
static java.lang.String helpbaseProperty
           
static java.lang.String htmlProperty
           
static GanymedeSession internalSession
          A number of operations in the Ganymede server require 'root' access to the database.
static java.lang.String journalProperty
           
static DBLog log
          This object provides access to the Ganymede log file, providing logging, email, and search services.
static boolean logErrorDialogs
          If true, Ganymede.createErrorDialog() will print the content of error dialogs to the server's stderr.
static java.lang.String logHelperProperty
           
static java.lang.String logProperty
           
static java.lang.String mailHostProperty
           
static java.lang.String messageDirectoryProperty
           
static java.lang.String monitornameProperty
           
static int registryPortProperty
           
static boolean remotelyAccessible
          If true, GanymedeSession will export any objects being viewed, edited, or created before returning it to the client.
static boolean resetadmin
          If the server is started with the -resetadmin command line flag, this field will be set to true and the server's startupHook() will reset the supergash password to that specified in the server's ganymede.properties file.
static java.lang.String returnaddrProperty
           
static java.lang.String rootname
           
static GanymedeScheduler scheduler
          The background task scheduler.
static java.lang.String schemaDirectoryProperty
           
static GanymedeServer server
          Once the server is started and able to accept RMI clients, this field will hold the GanymedeServer object which clients talk to in order to login to the server.
static java.lang.String serverHostProperty
           
static java.lang.String signatureFileProperty
           
static boolean softtimeout
           
static java.util.Date startTime
          We keep the server's start time for display in the admin console.
static int timeoutIdleNoObjs
           
static int timeoutIdleWithObjs
           
 
Constructor Summary
Ganymede()
           
 
Method Summary
static ReturnVal createErrorDialog(java.lang.String title, java.lang.String body)
          This is a convenience method used by the server to return a standard error dialog.
static ReturnVal createInfoDialog(java.lang.String title, java.lang.String body)
          This is a convenience method used by the server to return a standard informative dialog.
static void debug(java.lang.String string)
          This is a convenience method used by server-side code to send debug output to stdout and to any attached admin consoles.
static GanymedeServer directInit(java.lang.String dbFilename)
          This method is used to initialize the Ganymede system when it is being driven by a direct-linked loader main() entry point, as a single process.
(package private) static void forceBuilderTasks()
          This method schedules all registered builder tasks for execution, with an option set that will cause all builder tasks to consider object bases as changed since the last build, thus triggering a full external rebuild.
static boolean loadProperties(java.lang.String filename)
          This method loads properties from the ganymede.properties file.
static void main(java.lang.String[] argv)
          The Ganymede server start point.
(package private) static void registerBuilderTask(java.lang.String taskName)
           
private static void registerTasks()
          This method scans the database for valid BuilderTask entries and adds them to the builderTasks vector.
(package private) static void runBuilderTasks()
          This method schedules all registered builder tasks for execution.
static java.lang.String stackTrace(java.lang.Throwable thing)
          This is a convenience method used by the server to get a stack trace from a throwable object in String form.
static void startupHook()
          This method is provided to allow us to hook in creation of new objects with specified invid's that the server code references.
(package private) static void unregisterBuilderTask(java.lang.String taskName)
           
(package private) static void updateBuildStatus()
          This method is called by the GanymedeBuilderTask base class to record that the server is processing a build.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug

logErrorDialogs

public static boolean logErrorDialogs

If true, Ganymede.createErrorDialog() will print the content of error dialogs to the server's stderr.


startTime

public static java.util.Date startTime

We keep the server's start time for display in the admin console.


debugFilename

public static java.lang.String debugFilename

If the server is started with debug=<filename> on the command line, debugFilename will hold the name of the file to write our RMI debug log to.


remotelyAccessible

public static boolean remotelyAccessible

If true, GanymedeSession will export any objects being viewed, edited, or created before returning it to the client. This will be false during direct loading, which should double load speed.


server

public static GanymedeServer server

Once the server is started and able to accept RMI clients, this field will hold the GanymedeServer object which clients talk to in order to login to the server.


internalSession

public static GanymedeSession internalSession

A number of operations in the Ganymede server require 'root' access to the database. This GanymedeSession object is provided for system database operations.


scheduler

public static GanymedeScheduler scheduler

The background task scheduler.


db

public static DBStore db
The Ganymede object store.

log

public static DBLog log

This object provides access to the Ganymede log file, providing logging, email, and search services.


catTransport

public static CategoryTransport catTransport

A cached reference to a master category tree serialization object. Initialized the first time a user logs on to the server, and re-initialized when the schema is edited. This object is provided to clients when they call GanymedeSession.getCategoryTree().


baseTransport

public static BaseListTransport baseTransport

A cached reference to a master base list serialization object. Initialized on server start up and re-initialized when the schema is edited. This object is provided to clients when they call GanymedeSession.getBaseList().


builderTasks

public static java.util.Vector builderTasks

A vector of GanymedeBuilderTask objects initialized on database load.


dbFilename

public static java.lang.String dbFilename

journalProperty

public static java.lang.String journalProperty

logProperty

public static java.lang.String logProperty

htmlProperty

public static java.lang.String htmlProperty

serverHostProperty

public static java.lang.String serverHostProperty

rootname

public static java.lang.String rootname

defaultrootpassProperty

public static java.lang.String defaultrootpassProperty

mailHostProperty

public static java.lang.String mailHostProperty

returnaddrProperty

public static java.lang.String returnaddrProperty

signatureFileProperty

public static java.lang.String signatureFileProperty

helpbaseProperty

public static java.lang.String helpbaseProperty

monitornameProperty

public static java.lang.String monitornameProperty

defaultmonitorpassProperty

public static java.lang.String defaultmonitorpassProperty

messageDirectoryProperty

public static java.lang.String messageDirectoryProperty

schemaDirectoryProperty

public static java.lang.String schemaDirectoryProperty

registryPortProperty

public static int registryPortProperty

logHelperProperty

public static java.lang.String logHelperProperty

softtimeout

public static boolean softtimeout

timeoutIdleNoObjs

public static int timeoutIdleNoObjs

timeoutIdleWithObjs

public static int timeoutIdleWithObjs

resetadmin

public static boolean resetadmin

If the server is started with the -resetadmin command line flag, this field will be set to true and the server's startupHook() will reset the supergash password to that specified in the server's ganymede.properties file.


firstrun

public static boolean firstrun

This flag is true if the server was started with no pre-existing ganymede.db file. This will be true when the server code is run from a schema kit's runDirectLoader script. If true, the GanymedeSession class will not worry about not finding the default permissions role in the database.


forcelocalhost

public static boolean forcelocalhost

This flag is true if the server was started with a -forcelocalhost command line argument, which will allow the server to run even if it will only be accessible to localhost.

Constructor Detail

Ganymede

public Ganymede()
Method Detail

main

public static void main(java.lang.String[] argv)
The Ganymede server start point.

directInit

public static GanymedeServer directInit(java.lang.String dbFilename)

This method is used to initialize the Ganymede system when it is being driven by a direct-linked loader main() entry point, as a single process. This method is not used when the server is started up normally.


debug

public static void debug(java.lang.String string)
This is a convenience method used by server-side code to send debug output to stdout and to any attached admin consoles.

stackTrace

public static java.lang.String stackTrace(java.lang.Throwable thing)
This is a convenience method used by the server to get a stack trace from a throwable object in String form.

createInfoDialog

public static ReturnVal createInfoDialog(java.lang.String title,
                                         java.lang.String body)
This is a convenience method used by the server to return a standard informative dialog.

createErrorDialog

public static ReturnVal createErrorDialog(java.lang.String title,
                                          java.lang.String body)
This is a convenience method used by the server to return a standard error dialog.

startupHook

public static void startupHook()

This method is provided to allow us to hook in creation of new objects with specified invid's that the server code references.

It's intended for use during server development as we evolve the schema.


registerTasks

private static void registerTasks()
This method scans the database for valid BuilderTask entries and adds them to the builderTasks vector.

registerBuilderTask

static void registerBuilderTask(java.lang.String taskName)

unregisterBuilderTask

static void unregisterBuilderTask(java.lang.String taskName)

runBuilderTasks

static void runBuilderTasks()
This method schedules all registered builder tasks for execution. This method will be called when a user commits a transaction.

forceBuilderTasks

static void forceBuilderTasks()
This method schedules all registered builder tasks for execution, with an option set that will cause all builder tasks to consider object bases as changed since the last build, thus triggering a full external rebuild.

updateBuildStatus

static void updateBuildStatus()

This method is called by the GanymedeBuilderTask base class to record that the server is processing a build.


loadProperties

public static boolean loadProperties(java.lang.String filename)

This method loads properties from the ganymede.properties file.

This method is public so that loader code linked with the Ganymede server code can initialize the properties without going through Ganymede.main().