Package com.illumon.iris.db.v2.locations
Class TableLocationUpdateSubscriptionBuffer
java.lang.Object
com.illumon.iris.db.v2.locations.TableLocationUpdateSubscriptionBuffer
- All Implemented Interfaces:
- BasicTableDataListener,- TableLocation.Listener
public class TableLocationUpdateSubscriptionBuffer extends Object implements TableLocation.Listener
Intermediates between push-based subscription to a TableLocation and polling on LiveTable refresh.
- 
Constructor SummaryConstructors Constructor Description TableLocationUpdateSubscriptionBuffer(TableLocation tableLocation)
- 
Method SummaryModifier and Type Method Description voidhandleException(TableDataException exception)Notify the listener that an exception was encountered while initiating or maintaining the subscription.voidhandleUpdate()Notify the listener that the table location has been updated.booleanprocessPending()Subscribe if needed, and return whether there was a pending update to the table location, or throw a pending exception.voidreset()Unsubscribe and clear any state pending processing.
- 
Constructor Details
- 
Method Details- 
processPendingpublic boolean processPending()Subscribe if needed, and return whether there was a pending update to the table location, or throw a pending exception. If a pending exception is thrown, this signals that the subscription is no longer valid and no subsequent pending updates will be returned.- Returns:
- Whether there was a pending update
 
- 
resetpublic void reset()Unsubscribe and clear any state pending processing.
- 
handleUpdatepublic void handleUpdate()Description copied from interface:TableLocation.ListenerNotify the listener that the table location has been updated. This may be called "spuriously," i.e. in cases where there has been no substantive update since the last handleUpdate() invocation. Implementations should use appropriate measures to avoid reacting to spurious updates.- Specified by:
- handleUpdatein interface- TableLocation.Listener
 
- 
handleExceptionDescription copied from interface:BasicTableDataListenerNotify the listener that an exception was encountered while initiating or maintaining the subscription. Delivery of an exception implies that the subscription is no longer valid. This might happen during subscription establishment, and consequently should be checked for after subscribe completes.- Specified by:
- handleExceptionin interface- BasicTableDataListener
- Parameters:
- exception- The exception
 
 
-