## org.exist.storage.journal
Class AbstractLoggable

    java.lang.Object
      org.exist.storage.journal.AbstractLoggable

All Implemented Interfaces:
  Loggable

Direct Known Subclasses:
  AbstractBFileLoggable, AddLinkLoggable, AddValueLoggable, BTAbstractLoggable, Checkpoint, CreatePageLoggable, InsertValueLoggable, RemoveEmptyPageLoggable, RemoveOverflowLoggable, RemovePageLoggable, RemoveValueLoggable, SplitPageLoggable, TxnAbort, TxnCommit, TxnStart, UpdateHeaderLoggable, UpdateLinkLoggable, UpdateValueLoggable, WriteOverflowPageLoggable

public abstract class AbstractLoggable
extends java.lang.Object
implements Loggable

Abstract implementation of the Loggable interface.

Author:
  wolf

Constructor Summary
`AbstractLoggable(byte type, long transactionId)` Default constructor: initialize entry type and transaction id.

Method Summary
`void` `clear(long transactionId)`
`java.lang.String` `dump()` Default implementation returns the current LSN plus the class name of the Loggable instance.
`byte` `getLogType()` Returns the type id of the log entry.
`long` `getLsn()` Returns the `Lsn` of the entry.
`long` `getTransactionId()` Returns the transaction id of the transaction to which the logged operation belongs.
`void` `redo()` Redo the underlying operation.
`void` `setLsn(long lsn)` Set the `Lsn` of the entry.
`void` `undo()` Undo, i.e.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.exist.storage.journal.Loggable
`getLogSize, read, write`

Constructor Detail

### AbstractLoggable

    public AbstractLoggable(byte type,
                            long transactionId)

  Default constructor: initialize entry type and transaction id.

Parameters:
  `type` -
  `transactionId` -

Method Detail

### clear

    public void clear(long transactionId)

### getLogType

    public byte getLogType()

  Description copied from interface: `Loggable`
  Returns the type id of the log entry. This is the type registered with class `LogEntryTypes`. The returned id is used by `JournalReader` to find the correct Loggable instance that can handle the entry.

  Specified by:
    `getLogType` in interface `Loggable`
  Returns:
    Type id of the log entry

### getTransactionId

    public long getTransactionId()

  Description copied from interface: `Loggable`
  Returns the transaction id of the transaction to which the logged operation belongs.

  Specified by:
    `getTransactionId` in interface `Loggable`
  Returns:
    transaction id

### setLsn

    public void setLsn(long lsn)

  Description copied from interface: `Loggable`
  Set the `Lsn` of the entry.

  Specified by:
    `setLsn` in interface `Loggable`
  Parameters:
    `lsn` -

### getLsn

    public long getLsn()

  Description copied from interface: `Loggable`
  Returns the `Lsn` of the entry.

  Specified by:
    `getLsn` in interface `Loggable`
  Returns:
    LSN

### redo

    public void redo()
              throws LogException

  Description copied from interface: `Loggable`
  Redo the underlying operation. This method is called by `RecoveryManager`.

  Specified by:
    `redo` in interface `Loggable`
  Throws:
    `LogException`

### undo

    public void undo()
              throws LogException

  Description copied from interface: `Loggable`
  Undo, i.e. roll back, the underlying operation. The method is called by `RecoveryManager`.

  Specified by:
    `undo` in interface `Loggable`
  Throws:
    `LogException`

### dump

    public java.lang.String dump()

  Default implementation returns the current LSN plus the class name of the Loggable instance.

  Specified by:
    `dump` in interface `Loggable`
  Returns:
    description

Copyright (C) Wolfgang Meier. All rights reserved.