|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.journal.TransactionLogHeader
public class TransactionLogHeader
Used to control a log file's header.
The physical data is read when this object is created then cached. Calling setter methods sets the header field then moves the file pointer back to the previous location.
Field Summary | |
---|---|
static byte |
CLEAN_LOG_STATE
State of the log file when it has been closed properly. |
static int |
CURRENT_POSITION_HEADER
Position of the current log position in the header. |
static int |
FORMAT_ID_HEADER
Position of the format ID in the header (see BitronixXid.FORMAT_ID ). |
static int |
HEADER_LENGTH
Total length of the header. |
static int |
STATE_HEADER
Position of the log file state in the header. |
static int |
TIMESTAMP_HEADER
Position of the timestamp in the header. |
static byte |
UNCLEAN_LOG_STATE
State of the log file when it hasn't been closed properly or it is still open. |
Constructor Summary | |
---|---|
TransactionLogHeader(java.io.RandomAccessFile randomAccessFile,
long maxFileLength)
TransactionLogHeader are used to control headers of the specified RandomAccessFile. |
Method Summary | |
---|---|
int |
getFormatId()
Get FORMAT_ID_HEADER. |
long |
getPosition()
Get CURRENT_POSITION_HEADER. |
byte |
getState()
Get STATE_HEADER. |
long |
getTimestamp()
Get TIMESTAMP_HEADER. |
void |
goAhead(long distance)
Advance CURRENT_POSITION_HEADER. |
void |
rewind()
Rewind CURRENT_POSITION_HEADER back to the beginning of the file. |
void |
setFormatId(int formatId)
Set FORMAT_ID_HEADER. |
void |
setPosition(long position)
Set CURRENT_POSITION_HEADER. |
void |
setState(byte state)
Set STATE_HEADER. |
void |
setTimestamp(long timestamp)
Set TIMESTAMP_HEADER. |
java.lang.String |
toString()
Create human-readable String representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FORMAT_ID_HEADER
BitronixXid.FORMAT_ID
).
public static final int TIMESTAMP_HEADER
public static final int STATE_HEADER
public static final int CURRENT_POSITION_HEADER
public static final int HEADER_LENGTH
public static final byte CLEAN_LOG_STATE
public static final byte UNCLEAN_LOG_STATE
Constructor Detail |
---|
public TransactionLogHeader(java.io.RandomAccessFile randomAccessFile, long maxFileLength) throws java.io.IOException
randomAccessFile
- maxFileLength
-
java.io.IOException
Method Detail |
---|
public int getFormatId()
FORMAT_ID_HEADER
public long getTimestamp()
TIMESTAMP_HEADER
public byte getState()
STATE_HEADER
public long getPosition()
CURRENT_POSITION_HEADER
public void setFormatId(int formatId) throws java.io.IOException
formatId
- the FORMAT_ID_HEADER value.
java.io.IOException
FORMAT_ID_HEADER
public void setTimestamp(long timestamp) throws java.io.IOException
timestamp
- the TIMESTAMP_HEADER value.
java.io.IOException
TIMESTAMP_HEADER
public void setState(byte state) throws java.io.IOException
state
- the STATE_HEADER value.
java.io.IOException
STATE_HEADER
public void setPosition(long position) throws java.io.IOException
position
- the CURRENT_POSITION_HEADER value.
java.io.IOException
CURRENT_POSITION_HEADER
public void goAhead(long distance) throws java.io.IOException
distance
- the value to add to the current position.
java.io.IOException
setPosition(long)
public void rewind() throws java.io.IOException
java.io.IOException
setPosition(long)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |