org.fcrepo.server.journal
Enum JournalOperatingMode

java.lang.Object
  extended by java.lang.Enum<JournalOperatingMode>
      extended by org.fcrepo.server.journal.JournalOperatingMode
All Implemented Interfaces:
Serializable, Comparable<JournalOperatingMode>

public enum JournalOperatingMode
extends Enum<JournalOperatingMode>

Title: JournalOperatingMode.java

Description: A mechanism for kicking a server from normal (Journal-Creating) mode, to disabled (Read-Only) mode. Any CreatorJournalEntry must call enforceCurrentMode() before performing an operation that might modify the repository.

Version:
$Id: JournalOperatingMode.java,v 1.3 2007/06/01 17:21:31 jblake Exp $
Author:
jblake

Enum Constant Summary
NORMAL
           
READ_ONLY
           
 
Method Summary
static void enforceCurrentMode()
          If a modifying operation is attempted while we are in Read-Only mode, throw an exception to prevent it.
static Object getMode()
          Get the current mode.
static void setMode(JournalOperatingMode mode)
          Set the current mode.
static JournalOperatingMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JournalOperatingMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NORMAL

public static final JournalOperatingMode NORMAL

READ_ONLY

public static final JournalOperatingMode READ_ONLY
Method Detail

values

public static JournalOperatingMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (JournalOperatingMode c : JournalOperatingMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static JournalOperatingMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

setMode

public static void setMode(JournalOperatingMode mode)
Set the current mode.


getMode

public static Object getMode()
Get the current mode.


enforceCurrentMode

public static void enforceCurrentMode()
                               throws ServerException
If a modifying operation is attempted while we are in Read-Only mode, throw an exception to prevent it. In Normal mode, do nothing.

Throws:
ServerException - to prevent a modifying operation in Read-Only mode.


Copyright © 2011 DuraSpace. All Rights Reserved.