com.sleepycat.je.log.entry
Enum DbOperationType

java.lang.Object
  extended by java.lang.Enum<DbOperationType>
      extended by com.sleepycat.je.log.entry.DbOperationType
All Implemented Interfaces:
Loggable, java.io.Serializable, java.lang.Comparable<DbOperationType>

public enum DbOperationType
extends java.lang.Enum<DbOperationType>
implements Loggable

DbOperationType is a persistent enum used in NameLNLogEntries. It supports replication of database operations by documenting the type of api operation which instigated the logging of a NameLN.


Enum Constant Summary
CREATE
           
NONE
           
REMOVE
           
RENAME
           
TRUNCATE
           
 
Method Summary
 void dumpLog(java.lang.StringBuffer sb, boolean verbose)
          Write the object into the string buffer for log dumping.
 int getLogSize()
           
 long getTransactionId()
           
 boolean logicalEquals(Loggable other)
           
 void readFromLog(java.nio.ByteBuffer itemBuffer, byte entryVersion)
          Initialize this object from the data in itemBuf.
static DbOperationType readTypeFromLog(java.nio.ByteBuffer entryBuffer, byte entryVersion)
           
static DbOperationType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DbOperationType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 void writeToLog(java.nio.ByteBuffer logBuffer)
          Serialize this object into the buffer.
 
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

NONE

public static final DbOperationType NONE

CREATE

public static final DbOperationType CREATE

REMOVE

public static final DbOperationType REMOVE

TRUNCATE

public static final DbOperationType TRUNCATE

RENAME

public static final DbOperationType RENAME
Method Detail

values

public static DbOperationType[] 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 (DbOperationType c : DbOperationType.values())
    System.out.println(c);

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

valueOf

public static DbOperationType valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

readTypeFromLog

public static DbOperationType readTypeFromLog(java.nio.ByteBuffer entryBuffer,
                                              byte entryVersion)

getLogSize

public int getLogSize()
Specified by:
getLogSize in interface Loggable
Returns:
number of bytes used to store this object.
See Also:
Loggable.getLogSize()

writeToLog

public void writeToLog(java.nio.ByteBuffer logBuffer)
Description copied from interface: Loggable
Serialize this object into the buffer.

Specified by:
writeToLog in interface Loggable
Parameters:
logBuffer - is the destination buffer
See Also:
Loggable.writeToLog(java.nio.ByteBuffer)

readFromLog

public void readFromLog(java.nio.ByteBuffer itemBuffer,
                        byte entryVersion)
Description copied from interface: Loggable
Initialize this object from the data in itemBuf.

Specified by:
readFromLog in interface Loggable
See Also:
Loggable.readFromLog(java.nio.ByteBuffer, byte)

dumpLog

public void dumpLog(java.lang.StringBuffer sb,
                    boolean verbose)
Description copied from interface: Loggable
Write the object into the string buffer for log dumping. Each object should be dumped without indentation or new lines and should be valid XML.

Specified by:
dumpLog in interface Loggable
Parameters:
sb - destination string buffer
verbose - if true, dump the full, verbose version
See Also:
Loggable.dumpLog(java.lang.StringBuffer, boolean)

getTransactionId

public long getTransactionId()
Specified by:
getTransactionId in interface Loggable
Returns:
the transaction id embedded within this loggable object. Objects that have no transaction id should return 0.
See Also:
Loggable.getTransactionId()

logicalEquals

public boolean logicalEquals(Loggable other)
Specified by:
logicalEquals in interface Loggable
Returns:
true if these two loggable items are logically the same. Used for replication testing.
See Also:
Loggable.logicalEquals(com.sleepycat.je.log.Loggable)