public class CallbackHistory extends Object implements DecoderCallback, EncoderCallback
Constructor and Description |
---|
CallbackHistory()
Creates an auditing callback that manages a history of indefinite length.
|
CallbackHistory(int length)
Creates an auditing callback that manages a history of fixed or
indefinite length.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the history of decoded items.
|
void |
decodeOccurred(StatefulDecoder decoder,
Object decoded)
Callback to deliver a fully decoded object.
|
void |
encodeOccurred(StatefulEncoder encoder,
Object encoded)
Callback to deliver a fully encoded object.
|
Object |
getMostRecent()
Gets the most recent decoded object if one exists.
|
Object |
getOldest()
Gets the oldest decoded object if one exists.
|
boolean |
isEmpty()
Tests to see if the history is empty.
|
int |
size()
Gets the number of decoded items in the callback history.
|
public CallbackHistory()
public CallbackHistory(int length)
length
- the maximum length of callback history to store before
dropping decoded items, a length of zero or 1 corresponds to
indefinite historypublic void decodeOccurred(StatefulDecoder decoder, Object decoded)
DecoderCallback
decodeOccurred
in interface DecoderCallback
decoder
- the stateful decoder driving the callbackdecoded
- the object that was decodedpublic void encodeOccurred(StatefulEncoder encoder, Object encoded)
encodeOccurred
in interface EncoderCallback
encoder
- the stateful encoder driving the callbackencoded
- the object that was encodedpublic Object getMostRecent()
NoSuchElementException
- if the history is emptypublic Object getOldest()
NoSuchElementException
- if the history is emptypublic boolean isEmpty()
public void clear()
public int size()
Copyright © 2003–2015 The Apache Software Foundation. All rights reserved.