public abstract class LogStreamManager extends LogFileManager
LogFileManager
that reads logs from a live stream. Such Manager
cannot read backward or forward, and, most of the time, cannot read the next data until it's
available (blocking read). This typically occurs when reading through a pipe, socket, serial
port, ...LogFileManager
.ManagerSpecVersion
READ_MUTEX
Constructor and Description |
---|
LogStreamManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
deleteFile()
Method overriding parent method
LogFileManager.deleteFile() to always return false |
boolean |
flushFile()
Method overriding parent method
LogFileManager.flushFile() to always return true |
long |
getCurrentFileSize()
Method overriding parent method
LogFileManager.getCurrentFileSize() to always return -1 |
long |
getCurrentOffset()
Method overriding parent method
LogFileManager.getCurrentOffset() to always throw UnsupportedOperationException |
boolean |
isLiveStream()
Method overriding parent method
LogFileManager.isLiveStream() to always return true |
byte[] |
readFileHeader(int pNbBytes)
Method overriding parent method
LogFileManager.readFileHeader(int) to always throw UnsupportedOperationException |
AutoRefreshLineInfo |
readLineAtOffset(long pOffset)
Method overriding parent method
LogFileManager.readLineAtOffset(long) to always throw UnsupportedOperationException |
abstract void |
setHasReadTimeout(boolean pHasReadTimeout)
Called by LogMX to tell the Manager if next reads shall be
blocking calls or not.
If LogMX expects that LogFileManager.readLine() or LogFileManager.readEntry()
shall be blocking until some data is read, then the parameter pHasReadTimeout will
be false . |
boolean |
supportFileDelete()
Method overriding parent method
LogFileManager.supportFileDelete() to always return false |
boolean |
supportFileFlush()
Method overriding parent method
LogFileManager.supportFileFlush() to always return true |
boolean |
supportHeaderReading()
Method overriding parent method
LogFileManager.supportHeaderReading() to always return false |
boolean |
supportRandomAccess()
Method overriding parent method
LogFileManager.supportRandomAccess() to always return false |
canUseParser, createNewEntryForExtraction, getAutoRefreshDelay, getCompressFormat, getCompressFormatFromFileName, getConnectionTimeout, getCurrentFileInfo, getCurrentFileLastModifDate, getCurrentURL, getDecompressedStream, getDecompressedStream, getEncoding, getFileTypeIcon, getFileTypeIcon32x32, getIconFile, getLogEntriesInfoProvider, getName, getOrAskUserPassword, getProtocolName, getProxySettings, getShortFilename, getSpecificationVersion, getTemplateLogURL, getURLFromLogURL, getURLPattern, init, newEncodingDetected, prepareForReading, readEntry, readLine, releaseResources, supportLogEntriesExtraction
public abstract void setHasReadTimeout(boolean pHasReadTimeout)
LogFileManager.readLine()
or LogFileManager.readEntry()
shall be blocking until some data is read, then the parameter pHasReadTimeout
will
be false
. Otherwise, the Manager shall use a timeout mechanism
(e.g. java.net.Socket.setSoTimeout()
) with a timeout value around 100ms.pHasReadTimeout
- true
if a timeout shall be used when reading underlying resource,
or false
if next reads shall be blocking.ManagerSpecVersion
)public final boolean isLiveStream()
LogFileManager.isLiveStream()
to always return true
isLiveStream
in class LogFileManager
true
ManagerSpecVersion
)LogFileManager.isLiveStream()
public final long getCurrentFileSize()
LogFileManager.getCurrentFileSize()
to always return -1
getCurrentFileSize
in class LogFileManager
-1
(live streams don't have a size)ManagerSpecVersion
)LogFileManager.getCurrentFileSize()
public final long getCurrentOffset()
LogFileManager.getCurrentOffset()
to always throw UnsupportedOperationException
getCurrentOffset
in class LogFileManager
UnsupportedOperationException
(live streams don't have to be aware of current offset)ManagerSpecVersion
)LogFileManager.getCurrentOffset()
public final AutoRefreshLineInfo readLineAtOffset(long pOffset) throws Exception
LogFileManager.readLineAtOffset(long)
to always throw UnsupportedOperationException
readLineAtOffset
in class LogFileManager
pOffset
- Starting offsetUnsupportedOperationException
(live streams don't have to be aware of current offset)Exception
- If Manager could not read bytesManagerSpecVersion
)LogFileManager.readLineAtOffset(long)
public final byte[] readFileHeader(int pNbBytes) throws Exception
LogFileManager.readFileHeader(int)
to always throw UnsupportedOperationException
readFileHeader
in class LogFileManager
pNbBytes
- Number of bytes to read. If negative, Manager must read as much bytes as possible
(for example, up to the end of file)UnsupportedOperationException
(live streams don't have to support file header reading)Exception
- If Manager could not read bytesManagerSpecVersion
)LogFileManager.readFileHeader(int)
public final boolean supportFileDelete()
LogFileManager.supportFileDelete()
to always return false
supportFileDelete
in class LogFileManager
false
(live streams don't have to support file deletion)ManagerSpecVersion
)LogFileManager.supportFileDelete()
public final boolean supportFileFlush()
LogFileManager.supportFileFlush()
to always return true
supportFileFlush
in class LogFileManager
true
since LogMX will only flush read entries from its
GUI, and stream is not impacted (no job to be done by Manager, that's why this method is final
).ManagerSpecVersion
)LogFileManager.supportFileFlush()
public final boolean supportHeaderReading()
LogFileManager.supportHeaderReading()
to always return false
supportHeaderReading
in class LogFileManager
false
(live streams don't have to support header reading)ManagerSpecVersion
)LogFileManager.supportHeaderReading()
public final boolean supportRandomAccess()
LogFileManager.supportRandomAccess()
to always return false
supportRandomAccess
in class LogFileManager
false
(live streams don't have to support random access)ManagerSpecVersion
)LogFileManager.supportRandomAccess()
public final boolean deleteFile()
LogFileManager.deleteFile()
to always return false
deleteFile
in class LogFileManager
false
(live streams don't have to support file deletion)ManagerSpecVersion
)LogFileManager.deleteFile()
public final boolean flushFile()
LogFileManager.flushFile()
to always return true
flushFile
in class LogFileManager
true
since LogMX will only flush read entries from its
GUI, and stream is not impacted (no job to be done by Manager, that's why this method is final
).ManagerSpecVersion
)LogFileManager.flushFile()
Copyright © 2025 LightySoft. All rights reserved. [LogMX v8.4.0 (Jan 3, 2025)]