|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--arlut.csd.ganymede.GanymedeAdmin
GanymedeAdmin is the server-side implementation of the
adminSession
interface; GanymedeAdmin provides the means by which privileged users
can carry out privileged operations on the Ganymede server, including
status monitoring and administrative activities.
GanymedeAdmin is actually a dual purpose class. One the one hand,
GanymedeAdmin implements adminSession,
providing a hook for the admin console to talk to. On the other,
GanymedeAdmin contains a lot of static fields and methods which the
server code uses to communicate information to any admin consoles
that are attached to the server at any given time.
| Field Summary | |
private java.lang.String |
adminName
The name that the admin console authenticated with. |
private static java.util.Vector |
badConsoles
Static vector of GanymedeAdmin instances for which remote exceptions were caught in the static update methods. |
private java.lang.String |
clientHost
The name or ip address of the system that this admin console is attached from. |
private static java.util.Vector |
consoles
Static vector of GanymedeAdmin instances, used to keep track of the attached admin consoles. |
private static boolean |
debug
|
private static long |
freeMem
Free memory statistic that the server sends to admin consoles |
private boolean |
fullprivs
If true, the admin console is attached with full privileges to run tasks, shut down the server, and so on. |
private static java.util.Date |
lastDumpDate
Timestamp that the Ganymede server last consolidated its journal file and dumped its database to disk. |
private arlut.csd.ganymede.serverAdminProxy |
proxy
A server-side proxy that maintains an event queue for the admin console attached to this GanymedeAdmin object. |
private static java.lang.String |
state
The overall server state.. |
private static long |
totalMem
Total memory statistic that the server sends to admin consoles |
| Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
| Fields inherited from class java.rmi.server.RemoteServer |
|
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
GanymedeAdmin(arlut.csd.ganymede.Admin admin,
boolean fullprivs,
java.lang.String adminName,
java.lang.String clientHost)
This is the GanymedeAdmin constructor, used to create a new server-side admin console attachment. |
|
| Method Summary | |
static void |
closeAllConsoles(java.lang.String reason)
This static method handles sending disconnect messages to all attached consoles and cleaning up the GanymedeAdmin.consoles Vector. |
private static void |
detachBadConsoles()
This private static method is called to remove any consoles that have experienced RMI failures from the static GanymedeAdmin.consoles vector. |
arlut.csd.ganymede.ReturnVal |
disableTask(java.lang.String name)
Causes a registered task to be made ineligible for execution until enableTask()
is called. |
private void |
doRefreshTasks(java.util.Vector scheduleHandles)
This private method updates the task status table on this admin console |
private void |
doRefreshUsers(java.util.Vector entries)
This private method updates the user status table on this admin console |
private void |
doSetState()
This private method updates the server state display on this admin console |
private void |
doUpdateCheckedOut()
This private method updates the objects checked out display on this admin console |
private void |
doUpdateLastDump()
This private method updates the last dump time on this admin console |
private void |
doUpdateLocksHeld()
This private method updates the number of locks held display on this admin console |
private void |
doUpdateMemState()
This private method updates the memory statistics display on this admin console |
private void |
doUpdateTransCount()
This private method is used to update this admin console handle's transaction count. |
arlut.csd.ganymede.ReturnVal |
dumpDB()
dump the current state of the db to disk |
arlut.csd.ganymede.SchemaEdit |
editSchema()
Lock the server to prevent client logins and edit the server schema. |
arlut.csd.ganymede.ReturnVal |
enableTask(java.lang.String name)
Causes a task that was temporarily disabled by disableTask()
to be available for execution again. |
arlut.csd.ganymede.ReturnVal |
forceBuild()
This method is called by admin console code to force a complete rebuild of all external builds. |
void |
forceDisconnect(java.lang.String reason)
This public method forces a disconnect of the remote admin console and cleans up the proxy. |
private static void |
handleConsoleRMIFailure(arlut.csd.ganymede.GanymedeAdmin console,
java.rmi.RemoteException ex)
This private static method handles communications link failures. |
arlut.csd.ganymede.ReturnVal |
kill(java.lang.String user)
Kick a user off of the Ganymede server on behalf of this admin console |
arlut.csd.ganymede.ReturnVal |
killAll()
Kick all users off of the Ganymede server on behalf of this admin console |
void |
logout()
Disconnect the remote admin console associated with this object |
void |
logout(java.lang.String reason)
Disconnect the remote admin console associated with this object |
void |
refreshMe()
This method lets the admin console explicitly request a refresh. |
static void |
refreshTasks()
This static method is used to update the list of connnected users that appears in any admin consoles attached to the Ganymede server. |
static void |
refreshUsers()
This static method is used to update the list of connnected users that appears in any admin consoles attached to the Ganymede server. |
arlut.csd.ganymede.ReturnVal |
runEmbeddedSweep()
Removes any embedded objects which do not have containers. |
arlut.csd.ganymede.ReturnVal |
runEmbeddedTest()
run a verification on the integrity of embedded objects and their containers |
arlut.csd.ganymede.ReturnVal |
runInvidSweep()
run a long-running verification and repair operation on the Ganymede server's invid database links |
arlut.csd.ganymede.ReturnVal |
runInvidTest()
run a long-running verification suite on the Ganymede server database's invid links |
arlut.csd.ganymede.ReturnVal |
runTaskNow(java.lang.String name)
Causes a pre-registered task in the Ganymede server to be executed as soon as possible. |
static void |
setConsoleCount()
This static method sends an updated console count figure to all of the attached admin consoles. |
static void |
setState(java.lang.String state)
This static method changes the system state and sends it out to the consoles |
static void |
setStatus(java.lang.String status)
This static method is used to send debug log info to the consoles. |
arlut.csd.ganymede.ReturnVal |
shutdown(boolean waitForUsers)
shutdown the server cleanly, on behalf of this admin console. |
arlut.csd.ganymede.ReturnVal |
stopTask(java.lang.String name)
Causes a running task to be interrupted as soon as possible. |
java.lang.String |
toString()
|
void |
unreferenced()
This method is called when the Java RMI system detects that this remote object is no longer referenced by any remote objects. |
static void |
updateCheckedOut()
This static method updates the objects checked out count on all consoles. |
static void |
updateLastDump()
This static method updates the last dump time to all consoles. |
static void |
updateLastDump(java.util.Date date)
This static method is used to send the last dump time to the consoles. |
static void |
updateLocksHeld()
This static method updates the locks held count on all consoles. |
static void |
updateMemState()
This static method is used to send the server's memory status to all connected admin consoles. |
static void |
updateMemState(long freeMem,
long totalMem)
This static method is used to update and transmit the server's memory status to the consoles. |
static void |
updateTransCount()
This static method is used to send the current transcount to the consoles. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toStub |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static final boolean debug
private static java.util.Vector consoles
private static java.util.Vector badConsoles
detachBadConsoles()
to remove consoles that we were not able to communicate with.
private static java.lang.String state
private static java.util.Date lastDumpDate
private static long freeMem
private static long totalMem
private java.lang.String adminName
private java.lang.String clientHost
private boolean fullprivs
private arlut.csd.ganymede.serverAdminProxy proxy
A server-side proxy that maintains an event queue for the admin console attached to this GanymedeAdmin object.
| Constructor Detail |
public GanymedeAdmin(arlut.csd.ganymede.Admin admin,
boolean fullprivs,
java.lang.String adminName,
java.lang.String clientHost)
throws java.rmi.RemoteException
This is the GanymedeAdmin constructor, used to create a new server-side admin console attachment.
Admin is an RMI remote object exported by the client in the form of a callback.
This constructor is called from
admin(),
which is responsible for authenticating the name and password before
calling this constructor.
| Method Detail |
public static void closeAllConsoles(java.lang.String reason)
This static method handles sending disconnect messages to all attached consoles and cleaning up the GanymedeAdmin.consoles Vector.
public static void setStatus(java.lang.String status)
This static method is used to send debug log info to
the consoles. It is used by
Ganymede.debug()
to append information to the console logs.
public static void setConsoleCount()
This static method sends an updated console count figure to all of the attached admin consoles.
public static void updateTransCount()
public static void updateLastDump(java.util.Date date)
public static void updateLastDump()
public static void updateMemState(long freeMem,
long totalMem)
public static void updateMemState()
public static void updateCheckedOut()
public static void updateLocksHeld()
public static void setState(java.lang.String state)
public static void refreshUsers()
This static method is used to update the list of connnected users that appears in any admin consoles attached to the Ganymede server.
public static void refreshTasks()
This static method is used to update the list of connnected users that appears in any admin consoles attached to the Ganymede server.
private static final void handleConsoleRMIFailure(arlut.csd.ganymede.GanymedeAdmin console,
java.rmi.RemoteException ex)
This private static method handles communications link failures. Note that the serverAdminProxy will handle single instances of admin console RemoteExceptions so that only two RemoteExceptions in sequence will raise a RemoteException.
Any code that calls this method should call detachBadConsoles() once it has exited any loops over the static consoles vector to actually expunge any failed consoles from our consoles vector.
private static void detachBadConsoles()
This private static method is called to remove any consoles that have experienced RMI failures from the static GanymedeAdmin.consoles vector. This method should never be called from within a loop over GanymedeAdmin.consoles.
private void doUpdateTransCount()
throws java.rmi.RemoteException
This private method is used to update this admin console handle's transaction count.
java.rmi.RemoteException
private void doUpdateLastDump()
throws java.rmi.RemoteException
java.rmi.RemoteException
private void doUpdateMemState()
throws java.rmi.RemoteException
java.rmi.RemoteException
private void doUpdateCheckedOut()
throws java.rmi.RemoteException
java.rmi.RemoteException
private void doUpdateLocksHeld()
throws java.rmi.RemoteException
java.rmi.RemoteException
private void doSetState()
throws java.rmi.RemoteException
java.rmi.RemoteException
private void doRefreshUsers(java.util.Vector entries)
throws java.rmi.RemoteException
java.rmi.RemoteException
private void doRefreshTasks(java.util.Vector scheduleHandles)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void forceDisconnect(java.lang.String reason)
throws java.rmi.RemoteException
This public method forces a disconnect of the remote admin console and cleans up the proxy.
This method *does not* handle removing this GanymedeAdmin console object from the static GanymedeAdmin.consoles Vector, so that it can safely be called from a loop over GanymedeAdmin.consoles in closeAllConsoles() when the server is being shut down.
java.rmi.RemoteExceptionpublic java.lang.String toString()
toString in class java.rmi.server.RemoteObjectpublic void logout()
Disconnect the remote admin console associated with this object
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
No server-side code should call this method from a thread that is looping over the static GanymedeAdmin.consoles Vector, or else the Vector will be changed from within the loop, possibly resulting in an exception being thrown.
logout in interface adminSessionpublic void logout(java.lang.String reason)
Disconnect the remote admin console associated with this object
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
No server-side code should call this method from a thread that is looping over the static GanymedeAdmin.consoles Vector, or else the Vector will be changed from within the loop, possibly resulting in an exception being thrown.
public void unreferenced()
This method is called when the Java RMI system detects that this remote object is no longer referenced by any remote objects.
This method handles abnormal logouts and time outs for us. By default, the 1.1 RMI time-out is 10 minutes.
unreferenced in interface java.rmi.server.UnreferencedUnreferenced
public void refreshMe()
throws java.rmi.RemoteException
This method lets the admin console explicitly request
a refresh. Upon being called, the server will call several
methods on the admin console's Admin
interface to pass current status information to the console.
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
refreshMe in interface adminSessionjava.rmi.RemoteExceptionpublic arlut.csd.ganymede.ReturnVal forceBuild()
This method is called by admin console code to force a complete rebuild of all external builds. This means that all databases will have their last modification timestamp cleared and all builder tasks will be scheduled for immediate execution.
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
forceBuild in interface adminSessionpublic arlut.csd.ganymede.ReturnVal killAll()
Kick all users off of the Ganymede server on behalf of this admin console
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
killAll in interface adminSessionpublic arlut.csd.ganymede.ReturnVal kill(java.lang.String user)
Kick a user off of the Ganymede server on behalf of this admin console
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
kill in interface adminSessionpublic arlut.csd.ganymede.ReturnVal shutdown(boolean waitForUsers)
shutdown the server cleanly, on behalf of this admin console.
shutdown in interface adminSessionwaitForUsers - if true, shutdown will be deferred until all users are logged
out. No new users will be allowed to login.
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
public arlut.csd.ganymede.ReturnVal dumpDB()
dump the current state of the db to disk
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
dumpDB in interface adminSessionpublic arlut.csd.ganymede.ReturnVal runInvidTest()
run a long-running verification suite on the Ganymede server database's invid links
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
runInvidTest in interface adminSessionpublic arlut.csd.ganymede.ReturnVal runInvidSweep()
run a long-running verification and repair operation on the Ganymede server's invid database links
Removes any invid pointers in the Ganymede database whose targets are not properly defined. This should not ever happen unless there is a bug some place in the server.
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
runInvidSweep in interface adminSessionpublic arlut.csd.ganymede.ReturnVal runEmbeddedTest()
run a verification on the integrity of embedded objects and their containers
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
runEmbeddedTest in interface adminSessionpublic arlut.csd.ganymede.ReturnVal runEmbeddedSweep()
Removes any embedded objects which do not have containers.
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
runEmbeddedSweep in interface adminSessionpublic arlut.csd.ganymede.ReturnVal runTaskNow(java.lang.String name)
Causes a pre-registered task in the Ganymede server to be executed as soon as possible. This method call will have no effect if the task is currently running.
runTaskNow in interface adminSessionname - The name of the task to run
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
public arlut.csd.ganymede.ReturnVal stopTask(java.lang.String name)
Causes a running task to be interrupted as soon as possible. Ganymede tasks need to be specifically written to be able to respond to interruption, so it is not guaranteed that the task named will always be able to safely or immediately respond to a stopTask() command.
stopTask in interface adminSessionname - The name of the task to interrupt
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
public arlut.csd.ganymede.ReturnVal disableTask(java.lang.String name)
Causes a registered task to be made ineligible for execution
until enableTask()
is called. This method will not stop a task that is currently
running.
disableTask in interface adminSessionname - The name of the task to disable
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
public arlut.csd.ganymede.ReturnVal enableTask(java.lang.String name)
Causes a task that was temporarily disabled by
disableTask()
to be available for execution again.
enableTask in interface adminSessionname - The name of the task to enable
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
public arlut.csd.ganymede.SchemaEdit editSchema()
Lock the server to prevent client logins and edit the server
schema. This method will return a SchemaEdit remote reference to the
admin console, which will present a graphical schema editor using
this remote reference. The server will remain locked until the
admin console commits or cancels the schema editing session,
either through affirmative action or through the death of the
admin console or the network connection. The DBSchemaEdit class on the server
coordinates everything.
This method is part of the adminSession remote interface,
and may be called remotely by attached admin consoles.
editSchema in interface adminSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||