|
TPTP 4.4.0 Monitoring Tools Project Public API Specification |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.hyades.logging.adapter.util.BufferedPeriodicReader
BufferedPeriodicReader reads a file line by line. It holds a pointer offset to the last read byte in order to resume when the file is appended or updated.
| Field Summary | |
|---|---|
protected int |
bytesRead
|
protected boolean |
flushingMode
|
protected int |
lastOffset
|
protected byte[] |
logBuffer
|
protected int |
logBufferInitialSize
Initial size of buffer to read data from log file into. |
| Constructor Summary | |
|---|---|
BufferedPeriodicReader(java.lang.String newFilename)
Create a BufferedPeriodicReader for the specified file. |
|
BufferedPeriodicReader(java.lang.String newFilename,
java.lang.String converter)
Create a BufferedPeriodicReader for the specified file and using the specified converter command. |
|
BufferedPeriodicReader(java.lang.String newFilename,
java.lang.String[] convArray)
Create a BufferedPeriodicReader for the specified file and using the specified converter command stored as an array of tokens. |
|
BufferedPeriodicReader(java.lang.String newFilename,
java.lang.String converter,
java.lang.String shell)
Create a BufferedPeriodicReader for the specified file and using the specified converter command and shell to run the converter command in. |
|
| Method Summary | |
|---|---|
void |
close()
Close the file. |
protected java.lang.String |
getCharset()
|
int |
getConfidenceBufferSize()
Get the confidence buffer size. |
protected java.lang.String |
getConverter()
|
java.lang.String[] |
getConverterArray()
Get the converter command array. |
int |
getFileFooterSize()
Get the file footer size. |
protected java.lang.String |
getFilename()
|
long |
getFilePointer()
Get the offset within the file where the next read will be done. |
protected long |
getLastSize()
|
long |
getSize()
Returns the size of the file being read |
boolean |
isFlushingMode()
|
boolean |
isMultiFile()
Returns whether a multi-file log is being read. |
void |
prepare()
Prepare the file for reading. |
java.lang.String |
readLine()
Read a line of the file and return it. |
protected void |
runConverter()
|
void |
setCharset(java.lang.String cs)
Set the character set of file to read. |
void |
setConfidenceBufferSize(int confidenceBufferSize)
Set the confidence buffer size. |
void |
setConverter(java.lang.String converter)
Set the converter command string. |
void |
setConverter(java.lang.String[] converterArray)
Set the converter command array. |
void |
setFileFooterSize(int fileFooterSize)
Set the file footer size. |
void |
setFilename(java.lang.String filename)
Set the name of the file to read. |
void |
setFlushingMode(boolean flushingMode)
|
protected void |
setLastSize(long lastSize)
|
void |
setMultiFile(boolean multiFile)
Set the multi-file indicator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int logBufferInitialSize
protected int bytesRead
protected byte[] logBuffer
protected int lastOffset
protected boolean flushingMode
| Constructor Detail |
public BufferedPeriodicReader(java.lang.String newFilename)
newFilename - - name of the file to read.
public BufferedPeriodicReader(java.lang.String newFilename,
java.lang.String converter)
newFilename - - name of the file to read.converter - - command to do any required conversion on the file before reading it.
public BufferedPeriodicReader(java.lang.String newFilename,
java.lang.String converter,
java.lang.String shell)
newFilename - - name of the file to read.converter - - command to do any required conversion on the file before reading it.shell - - shell to run the converter command in.
public BufferedPeriodicReader(java.lang.String newFilename,
java.lang.String[] convArray)
newFilename - - name of the file to read.convArray - - command stored as an array to do any required conversion on the file before reading it.| Method Detail |
public void setCharset(java.lang.String cs)
cs - - character set of the file
protected void runConverter()
throws java.lang.Exception
java.lang.Exception
public void prepare()
throws java.lang.Exception
java.lang.Exceptionpublic void close()
public java.lang.String readLine()
throws java.io.IOException
java.io.IOExceptionpublic long getFilePointer()
public int getConfidenceBufferSize()
public void setConfidenceBufferSize(int confidenceBufferSize)
confidenceBufferSize - - the confidence buffer size to set.public int getFileFooterSize()
public void setFileFooterSize(int fileFooterSize)
fileFooterSize - The fileFooterSize to set.public boolean isMultiFile()
public void setMultiFile(boolean multiFile)
multiFile - - boolean value indicating whether the log is mult-file.public java.lang.String[] getConverterArray()
public void setConverter(java.lang.String[] converterArray)
converterArray - - the converter command array to set.public void setFilename(java.lang.String filename)
filename - - the name of the file to read.public void setConverter(java.lang.String converter)
converter - The converter to set.public long getSize()
protected java.lang.String getConverter()
protected java.lang.String getFilename()
protected long getLastSize()
protected void setLastSize(long lastSize)
protected java.lang.String getCharset()
public boolean isFlushingMode()
public void setFlushingMode(boolean flushingMode)
|
TPTP 4.4.0 Monitoring Tools Project Public API Specification |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||