public static class LogReceiver.DelayedLogEntry
extends java.lang.Object
implements java.util.concurrent.Delayed
ILogEntry for storage in a DelayQueue.
The delayTimeMillis parameter in the constructor sets the buffer time during which log entries
are not yet available for the consumer, so that late arriving records get a chance
to be sorted in according to timestamp.
As of ACS 7.0.1 the issue of timestamps that lie in the future (e.g. logs from a different machine with unsync'd time)
is addressed in the way that "future" log records will become available to the consumer before
the local system time has reached the timestamp.
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.util.concurrent.Delayed other)
This method is used by the queue for sorting,
comparing timestamps and arrival order.
|
static LogReceiver.DelayedLogEntry |
createQueuePoison(long delayTimeMillis) |
boolean |
equals(java.lang.Object other)
Equals method, just to be consistent with
compareTo. |
long |
getDelay(java.util.concurrent.TimeUnit unit)
This method is used by the queue to determine whether the log record may
leave the queue already.
|
ILogEntry |
getLogEntry()
Deprecated.
use
getLogRecord() to avoid dealing with jlog-internal log level (=severity) number ranges. |
LogReceiver.ReceivedLogRecord |
getLogRecord()
Returns the log record that was wrapped for sorting inside the queue.
|
int |
hashCode()
hashCode method, since we already have equals.
|
boolean |
isQueuePoison()
True if this entry designates the end of the queue.
|
public static LogReceiver.DelayedLogEntry createQueuePoison(long delayTimeMillis)
public boolean isQueuePoison()
BlockingQueue, this element is called the "poison".createQueuePoison(long)public ILogEntry getLogEntry()
getLogRecord() to avoid dealing with jlog-internal log level (=severity) number ranges.ILogEntry class that was wrapped for sorting inside the queue.
That class represents the log record as it was received from the logging service.
Beware that the log level you get from this ILogEntry is not an ACS log level, but
comes from some level representation internally used by the jlog application whose code got reused here!
To get an ACS level, you must convert it using LogTypeHelper#getAcsCoreLevel(Integer)public LogReceiver.ReceivedLogRecord getLogRecord()
public long getDelay(java.util.concurrent.TimeUnit unit)
getDelay in interface java.util.concurrent.Delayedpublic int compareTo(java.util.concurrent.Delayed other)
compareTo in interface java.lang.Comparable<java.util.concurrent.Delayed>public boolean equals(java.lang.Object other)
compareTo.equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object