com.sleepycat.je.log.entry
Class SingleItemEntry

java.lang.Object
  extended by com.sleepycat.je.log.entry.BaseEntry
      extended by com.sleepycat.je.log.entry.SingleItemEntry
All Implemented Interfaces:
LogEntry, java.lang.Cloneable
Direct Known Subclasses:
BINDeltaLogEntry

public class SingleItemEntry
extends BaseEntry
implements LogEntry

This class embodies log entries that have a single loggable item. On disk, an entry contains:

     the Loggable item
 


Field Summary
 
Fields inherited from class com.sleepycat.je.log.entry.BaseEntry
entryType, logClass
 
Constructor Summary
SingleItemEntry(java.lang.Class logClass)
          Construct a log entry for reading.
SingleItemEntry(LogEntryType entryType, Loggable item)
          Construct a log entry for writing.
 
Method Summary
 java.lang.Object clone()
           
 java.lang.StringBuffer dumpEntry(java.lang.StringBuffer sb, boolean verbose)
          Print out the contents of an entry.
 java.lang.Object getMainItem()
           
 int getSize()
           
 long getTransactionId()
           
 void readEntry(LogEntryHeader header, java.nio.ByteBuffer entryBuffer, boolean readFullItem)
          Read in an log entry.
 void writeEntry(LogEntryHeader header, java.nio.ByteBuffer destBuffer)
          Serialize this object into the buffer.
 
Methods inherited from class com.sleepycat.je.log.entry.BaseEntry
countAsObsoleteWhenLogged, getLogType, postLogWork, setLastLoggedSize, setLogType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sleepycat.je.log.entry.LogEntry
countAsObsoleteWhenLogged, getLogType, postLogWork, setLastLoggedSize, setLogType
 

Constructor Detail

SingleItemEntry

public SingleItemEntry(java.lang.Class logClass)
Construct a log entry for reading.


SingleItemEntry

public SingleItemEntry(LogEntryType entryType,
                       Loggable item)
Construct a log entry for writing.

Method Detail

readEntry

public void readEntry(LogEntryHeader header,
                      java.nio.ByteBuffer entryBuffer,
                      boolean readFullItem)
               throws DatabaseException
Description copied from interface: LogEntry
Read in an log entry.

Specified by:
readEntry in interface LogEntry
Throws:
DatabaseException
See Also:
LogEntry.readEntry(com.sleepycat.je.log.LogEntryHeader, java.nio.ByteBuffer, boolean)

dumpEntry

public java.lang.StringBuffer dumpEntry(java.lang.StringBuffer sb,
                                        boolean verbose)
Description copied from interface: LogEntry
Print out the contents of an entry.

Specified by:
dumpEntry in interface LogEntry
See Also:
LogEntry.dumpEntry(java.lang.StringBuffer, boolean)

getMainItem

public java.lang.Object getMainItem()
Specified by:
getMainItem in interface LogEntry
Returns:
the first item of the log entry
See Also:
LogEntry.getMainItem()

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface LogEntry
Overrides:
clone in class java.lang.Object
Returns:
a shallow clone.
Throws:
java.lang.CloneNotSupportedException
See Also:
LogEntry.clone()

getTransactionId

public long getTransactionId()
Specified by:
getTransactionId in interface LogEntry
Returns:
return the transaction id if this log entry is transactional, 0 otherwise.
See Also:
LogEntry.getTransactionId()

getSize

public int getSize()
Specified by:
getSize in interface LogEntry
Returns:
size of byte buffer needed to store this entry.

writeEntry

public void writeEntry(LogEntryHeader header,
                       java.nio.ByteBuffer destBuffer)
Description copied from interface: LogEntry
Serialize this object into the buffer.

Specified by:
writeEntry in interface LogEntry
destBuffer - is the destination buffer
See Also:
LogEntry.writeEntry(com.sleepycat.je.log.LogEntryHeader, java.nio.ByteBuffer)


Copyright 2004,2008 Oracle. All rights reserved.