Package com.logviewer.data2
Class Log
java.lang.Object
com.logviewer.data2.Log
- All Implemented Interfaces:
LogView
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChangeListener(Consumer<FileAttributes> changeListener) createRecordSearcher(Position start, boolean backward, RecordPredicate recordPredicate, String hash, int recordCount, SearchPattern searchPattern, Consumer<SearchResult> listener) getFile()getId()getPath()booleanloadContent(long offset, int length) Reads a piece of the log.loadRecords(RecordPredicate filter, int recordCountLimit, Position start, boolean backward, String hash, long sizeLimit, LogDataListener loadListener) readRecordAt(long offset) static voidsetLogIdGenerator(Function<String, String> logIdGenerator) VisibleForTestingtoString()tryRead()
-
Field Details
-
UNPACK_GZ_ARCHIVES
- See Also:
-
DEFAULT_ID_GENERATOR
-
LOG_ID_GENERATOR
-
CHANGE_NOTIFICATION_TIMEOUT
public static final long CHANGE_NOTIFICATION_TIMEOUT- See Also:
-
-
Constructor Details
-
Log
-
-
Method Details
-
getId
-
getFile
-
getPath
-
getHostname
- Specified by:
getHostnamein interfaceLogView
-
getFormat
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceLogView
-
createSnapshot
-
loadRecords
public LogProcess loadRecords(@Nullable RecordPredicate filter, int recordCountLimit, @Nullable Position start, boolean backward, String hash, long sizeLimit, @NonNull LogDataListener loadListener) - Specified by:
loadRecordsin interfaceLogView
-
createRecordSearcher
public LogProcess createRecordSearcher(@NonNull Position start, boolean backward, RecordPredicate recordPredicate, @Nullable String hash, int recordCount, @NonNull SearchPattern searchPattern, @NonNull Consumer<SearchResult> listener) - Specified by:
createRecordSearcherin interfaceLogView
-
addChangeListener
- Specified by:
addChangeListenerin interfaceLogView
-
tryRead
-
readRecordAt
- Specified by:
readRecordAtin interfaceLogView
-
loadContent
Description copied from interface:LogViewReads a piece of the log.- Specified by:
loadContentin interfaceLogView- Parameters:
offset- The offset in the log.length- The number of bytes to read. The actual read piece may be less than 'length'.- Returns:
- A pair of the read text and the actual size of the text in bytes.
-
toString
-
setLogIdGenerator
VisibleForTesting
-