org.neodatis.odb.impl.core.transaction
Class DefaultWriteAction

java.lang.Object
  extended by org.neodatis.odb.impl.core.transaction.DefaultWriteAction
All Implemented Interfaces:
IWriteAction

public class DefaultWriteAction
extends java.lang.Object
implements IWriteAction

The WriteAction class is the description of a Write operation that will be applied to the main database file when committing. All operations(writes) that can not be written to the database file before committing , pointers (for example) are stored in WriteAction objects. The transaction keeps track of all these WriteActions. When committing, the transaction apply each WriteAction to the engine database file.

Author:
osmadja

Field Summary
static int count
           
static int DATA_WRITE_ACTION
           
static int DIRECT_WRITE_ACTION
           
static java.lang.String LOG_ID
           
static int POINTER_WRITE_ACTION
           
static int UNKNOWN_WRITE_ACTION
           
 
Constructor Summary
DefaultWriteAction(long position)
           
DefaultWriteAction(long position, byte[] bytes)
           
DefaultWriteAction(long position, byte[] bytes, java.lang.String label)
           
 
Method Summary
 void addBytes(byte[] bytes)
           
 void applyTo(IFileSystemInterface fsi, int index)
           
 void clear()
           
 byte[] getBytes(int index)
           
 long getPosition()
           
 boolean isEmpty()
           
 void persist(IFileSystemInterface fsi, int index)
           
static DefaultWriteAction read(IFileSystemInterface fsi, int index)
           
 void setPosition(long position)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

count

public static int count

UNKNOWN_WRITE_ACTION

public static final int UNKNOWN_WRITE_ACTION
See Also:
Constant Field Values

DATA_WRITE_ACTION

public static final int DATA_WRITE_ACTION
See Also:
Constant Field Values

POINTER_WRITE_ACTION

public static final int POINTER_WRITE_ACTION
See Also:
Constant Field Values

DIRECT_WRITE_ACTION

public static final int DIRECT_WRITE_ACTION
See Also:
Constant Field Values

LOG_ID

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

DefaultWriteAction

public DefaultWriteAction(long position)

DefaultWriteAction

public DefaultWriteAction(long position,
                          byte[] bytes)

DefaultWriteAction

public DefaultWriteAction(long position,
                          byte[] bytes,
                          java.lang.String label)
Method Detail

getPosition

public long getPosition()
Specified by:
getPosition in interface IWriteAction

setPosition

public void setPosition(long position)

getBytes

public byte[] getBytes(int index)
Specified by:
getBytes in interface IWriteAction

addBytes

public void addBytes(byte[] bytes)
Specified by:
addBytes in interface IWriteAction

persist

public void persist(IFileSystemInterface fsi,
                    int index)
Specified by:
persist in interface IWriteAction

read

public static DefaultWriteAction read(IFileSystemInterface fsi,
                                      int index)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

applyTo

public void applyTo(IFileSystemInterface fsi,
                    int index)
Specified by:
applyTo in interface IWriteAction

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface IWriteAction

clear

public void clear()