com.tivoli.twg.log
Class TWGLogBookmark

java.lang.Object
  extended bycom.tivoli.twg.log.TWGLogBookmark

public class TWGLogBookmark
extends java.lang.Object

This class is used as a cursor or bookmark to retrieve part of or updates to a log file.


Constructor Summary
TWGLogBookmark()
           
 
Method Summary
 byte[] flatten()
          Flatten a bookmark to a byte array so it can be sent as part of an IPC command.
 long getLastServiced()
          Get the last serviced time from this bookmark.
 long getLastValidTimestamp()
          Get the timestamp of the last message read using this bookmark.
 long getLastWrapped()
          Get the last wrapped time from this bookmark.
 long getOffset()
          Get the offset of where the last message was read using this bookmark.
 boolean isForBak()
           
 boolean isForLog()
           
 boolean isFullyRead()
           
 boolean isUndefined()
           
 void setForLog(boolean forLog)
           
 void setFullyRead()
           
 void startLog()
          Set up this book mark to indicate the beginning of the the .log file.
 java.lang.String toString()
           
 void unflatten(byte[] bytes)
          Set up a bookmark from a byte array as it would be received from an IPC command.
 void update(long lastServiced, long lastWrapped)
          Update the bookmark's time stamps for log engine activities.
 void update(TWGLogMsg msg, long offset, boolean forLog)
          Update the bookmark's place holding information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGLogBookmark

public TWGLogBookmark()
Method Detail

unflatten

public void unflatten(byte[] bytes)
Set up a bookmark from a byte array as it would be received from an IPC command.

Parameters:
bytes - an array of bytes containing the bookmark data

flatten

public final byte[] flatten()
Flatten a bookmark to a byte array so it can be sent as part of an IPC command.

Returns:
byte[] containing this bookmark's data

update

public void update(long lastServiced,
                   long lastWrapped)
Update the bookmark's time stamps for log engine activities.

Parameters:
lastServiced - new time for when log engine serviced log
lastWrapped - new time for when log engine wrapped log

update

public void update(TWGLogMsg msg,
                   long offset,
                   boolean forLog)
Update the bookmark's place holding information.

Parameters:
msg - a TWGLogMsg to get the message timestamp from
offset - the offset at which msg was read
forLog - true means set bookmark to represent .log; false means set bookmark to represent .bak

startLog

public void startLog()
Set up this book mark to indicate the beginning of the the .log file.


getLastServiced

public final long getLastServiced()
Get the last serviced time from this bookmark.

Returns:
int containing a C-style time stamp of when the log engine last serviced the log

getLastWrapped

public final long getLastWrapped()
Get the last wrapped time from this bookmark.

Returns:
int containing a C-style time stamp of when the log engine last wrapped the log

getLastValidTimestamp

public final long getLastValidTimestamp()
Get the timestamp of the last message read using this bookmark.

Returns:
long containing a Java-style timestamp from the last message read using this bookmark.

getOffset

public final long getOffset()
Get the offset of where the last message was read using this bookmark.

Returns:
long zero based offset into a .log or .bak file

setForLog

public final void setForLog(boolean forLog)

isUndefined

public final boolean isUndefined()

isForBak

public final boolean isForBak()

isForLog

public final boolean isForLog()

setFullyRead

public final void setFullyRead()

isFullyRead

public final boolean isFullyRead()

toString

public final java.lang.String toString()