org.fcrepo.server.utilities.status
Class ServerStatusTool

java.lang.Object
  extended by org.fcrepo.server.utilities.status.ServerStatusTool

public class ServerStatusTool
extends Object


Field Summary
static int DEFAULT_SHUTDOWN_TIMEOUT
          Default number of seconds watch-shutdown should wait for the state to change from STOPPING to STOPPED or STOPPED_WITH_ERR before giving up.
static int DEFAULT_STARTING_TIMEOUT
          Default number of seconds watch-startup should wait for the state to change from NOT_STARTING to STARTING before giving up.
static int DEFAULT_STARTUP_TIMEOUT
          Default number of seconds watch-startup should wait for the state to change from STARTING to STARTED or STARTUP_FAILED before giving up.
static int DEFAULT_STOPPING_TIMEOUT
          Default number of seconds watch-shutdown should wait for the state to change from STARTED to STOPPING before giving up.
 
Constructor Summary
ServerStatusTool(File serverHome)
           
 
Method Summary
 void init()
          If the server appears not to be running, initialize the status file to indicate that the server is not running and has not yet indicated that it is starting (NOT_STARTING).
static void main(String[] args)
           
 void showStatus()
          Show a human-readable form of the latest message in the server status file.
 void watchShutdown(int stoppingTimeout, int shutdownTimeout)
          Watch the status file and print details to standard output until the STOPPED or STOPPED_WITH_ERR state is encountered.
 void watchStartup(int startingTimeout, int startupTimeout)
          Watch the status file and print details to standard output until the STARTED or STARTUP_FAILED state is encountered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STARTING_TIMEOUT

public static final int DEFAULT_STARTING_TIMEOUT
Default number of seconds watch-startup should wait for the state to change from NOT_STARTING to STARTING before giving up.

See Also:
Constant Field Values

DEFAULT_STARTUP_TIMEOUT

public static final int DEFAULT_STARTUP_TIMEOUT
Default number of seconds watch-startup should wait for the state to change from STARTING to STARTED or STARTUP_FAILED before giving up.

See Also:
Constant Field Values

DEFAULT_STOPPING_TIMEOUT

public static final int DEFAULT_STOPPING_TIMEOUT
Default number of seconds watch-shutdown should wait for the state to change from STARTED to STOPPING before giving up.

See Also:
Constant Field Values

DEFAULT_SHUTDOWN_TIMEOUT

public static final int DEFAULT_SHUTDOWN_TIMEOUT
Default number of seconds watch-shutdown should wait for the state to change from STOPPING to STOPPED or STOPPED_WITH_ERR before giving up.

See Also:
Constant Field Values
Constructor Detail

ServerStatusTool

public ServerStatusTool(File serverHome)
                 throws Exception
Throws:
Exception
Method Detail

init

public void init()
          throws Exception
If the server appears not to be running, initialize the status file to indicate that the server is not running and has not yet indicated that it is starting (NOT_STARTING). Otherwise, throw an exception.

Throws:
Exception

watchStartup

public void watchStartup(int startingTimeout,
                         int startupTimeout)
                  throws Exception
Watch the status file and print details to standard output until the STARTED or STARTUP_FAILED state is encountered. If there are any problems reading the status file, a timeout is reached, or STARTUP_FAILED is encountered, this will throw an exception.

Throws:
Exception

watchShutdown

public void watchShutdown(int stoppingTimeout,
                          int shutdownTimeout)
                   throws Exception
Watch the status file and print details to standard output until the STOPPED or STOPPED_WITH_ERR state is encountered. If there are any problems reading the status file, a timeout is reached, or STOPPED_WITH_ERR is encountered, this will throw an exception.

Throws:
Exception

showStatus

public void showStatus()
                throws Exception
Show a human-readable form of the latest message in the server status file. If the status file doesn't yet exist, this will print a special status message indicating the server is new. The response will have the following form.
 STATE  : Some State
 AS OF  : 2006-03-29 06:44:23AM EST
 DETAIL : Detail line 1, if it exists
 Detail line 2, if it exists
 Detail line 3, etc..
 

Throws:
Exception

main

public static void main(String[] args)


Copyright © 2012 DuraSpace. All Rights Reserved.