Class TimestampLogFileLineAccessor
- java.lang.Object
-
- hudson.plugins.timestamper.accessor.TimestampLogFileLineAccessor
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class TimestampLogFileLineAccessor extends Object implements Closeable
Abstraction for retrieving timestamps and log file lines from completed builds. Timestamp records can be stored in different files and formats for different types of builds. Consumers that wish to retrieve such records should use this interface rather than directly opening the corresponding log file.
-
-
Constructor Summary
Constructors Constructor Description TimestampLogFileLineAccessor(Run<?,?> build)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
getLineCount()
TimestampLogFileLine
readLine()
Retrieve a log file line and its associated timestamp.void
skipLine()
Skip forward one line in the associated record file(s).
-
-
-
Constructor Detail
-
TimestampLogFileLineAccessor
public TimestampLogFileLineAccessor(Run<?,?> build) throws IOException
- Throws:
IOException
-
-
Method Detail
-
skipLine
public void skipLine() throws IOException
Skip forward one line in the associated record file(s).- Throws:
IOException
-
readLine
public TimestampLogFileLine readLine() throws IOException
Retrieve a log file line and its associated timestamp. While typically both a timestamp and a log file line will be present, this API is resilient to edge cases in which one or the other is not present. In such cases, consumers have a choice as to whether to discard the record or return incomplete information to the user. When neither a timestamp nor a log file line are present, EOF has been reached and callers should stop retrieving further records.- Throws:
IOException
-
getLineCount
public int getLineCount()
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-