gov.nasa.gsfc.drl.rtstps.server
Class ServerState

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.server.ServerState

final class ServerState
extends java.lang.Object

This class is the current server state: unloaded, loaded, stopped, or go. Normally I would keep this information as a single state integer in the server itself, but I also need to maintain the time of each event as well as maintain a server status block.


Field Summary
private  LongStatusItem clockItem
           
private  TextStatusItem configurationItem
           
private  LongStatusItem goClockItem
           
private  TextStatusItem goItem
           
private  LongStatusItem loadClockItem
           
private static int LOADED_GO
           
private static int LOADED_STOPPED
           
private  int state
           
private  StatusBlock statusBlock
           
private  LongStatusItem stopClockItem
           
private  LongStatusItem unloadClockItem
           
private static int UNLOADED
           
 
Constructor Summary
ServerState()
           
 
Method Summary
(package private)  void advanceClock()
          Set the current time status item to the current time.
(package private)  StatusBlock getStatusBlock()
          Get the status block that is associated with the server state.
(package private)  void go()
          Set the server to the enabled state.
(package private)  boolean isEnabled()
          Determine if the server is enabled to process data.
(package private)  boolean isLoaded()
          Determine if the server is loaded with a configuration.
(package private)  void load(java.lang.String configurationFileName)
          Change the server state so that it shows a loaded configuration.
(package private)  void stop()
          Set the server to the disabled state.
(package private)  void unload()
          Set the server state to be unloaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

statusBlock

private StatusBlock statusBlock

clockItem

private LongStatusItem clockItem

stopClockItem

private LongStatusItem stopClockItem

goClockItem

private LongStatusItem goClockItem

loadClockItem

private LongStatusItem loadClockItem

unloadClockItem

private LongStatusItem unloadClockItem

configurationItem

private TextStatusItem configurationItem

goItem

private TextStatusItem goItem

LOADED_GO

private static final int LOADED_GO
See Also:
Constant Field Values

LOADED_STOPPED

private static final int LOADED_STOPPED
See Also:
Constant Field Values

UNLOADED

private static final int UNLOADED
See Also:
Constant Field Values

state

private int state
Constructor Detail

ServerState

ServerState()
Method Detail

isLoaded

final boolean isLoaded()
Determine if the server is loaded with a configuration.


isEnabled

final boolean isEnabled()
Determine if the server is enabled to process data.


getStatusBlock

final StatusBlock getStatusBlock()
Get the status block that is associated with the server state.


advanceClock

final void advanceClock()
Set the current time status item to the current time.


go

void go()
  throws java.rmi.RemoteException
Set the server to the enabled state.

Throws:
java.rmi.RemoteException

stop

void stop()
    throws java.rmi.RemoteException
Set the server to the disabled state.

Throws:
java.rmi.RemoteException

load

void load(java.lang.String configurationFileName)
    throws java.rmi.RemoteException
Change the server state so that it shows a loaded configuration.

Throws:
java.rmi.RemoteException

unload

void unload()
Set the server state to be unloaded.