fedora.server.utilities.status
Class ServerStatusFile

java.lang.Object
  extended by fedora.server.utilities.status.ServerStatusFile

public class ServerStatusFile
extends java.lang.Object

The file consists of one or more serialized ServerStatusMessages. The format of the file is simple:

 [STATUS]
 State
 Date
 [/STATUS]
 [STATUS]
 State
 Date
 DetailLine1
 DetailLine2
 [/STATUS]
 


Field Summary
static java.lang.String BEGIN_LINE
           
static java.lang.String END_LINE
           
static java.lang.String FILENAME
           
 
Constructor Summary
ServerStatusFile(java.io.File serverHome)
           
 
Method Summary
 void append(ServerState state, java.lang.String detail)
           
 void appendError(ServerState state, java.lang.Throwable detail)
           
 void clear()
           
 boolean exists()
           
 ServerStatusMessage[] getMessages(ServerStatusMessage afterMessage)
          Get all messages in the status file, or only those after the given message if it is non-null.
 java.lang.String getPath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILENAME

public static final java.lang.String FILENAME
See Also:
Constant Field Values

BEGIN_LINE

public static final java.lang.String BEGIN_LINE
See Also:
Constant Field Values

END_LINE

public static final java.lang.String END_LINE
See Also:
Constant Field Values
Constructor Detail

ServerStatusFile

public ServerStatusFile(java.io.File serverHome)
                 throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getPath

public java.lang.String getPath()

clear

public void clear()
           throws java.lang.Exception
Throws:
java.lang.Exception

exists

public boolean exists()

appendError

public void appendError(ServerState state,
                        java.lang.Throwable detail)
                 throws java.lang.Exception
Throws:
java.lang.Exception

append

public void append(ServerState state,
                   java.lang.String detail)
            throws java.lang.Exception
Throws:
java.lang.Exception

getMessages

public ServerStatusMessage[] getMessages(ServerStatusMessage afterMessage)
                                  throws java.lang.Exception
Get all messages in the status file, or only those after the given message if it is non-null. If the status file doesn't exist or can't be parsed, throw an exception.

Throws:
java.lang.Exception