@API(status=INTERNAL) public class DatahoseLoopImpl extends AbstractAckIdEventLoop implements DatahoseLoop
Modifier and Type | Field and Description |
---|---|
protected AuthSession |
authSession |
protected com.symphony.bdk.core.config.model.BdkConfig |
bdkConfig |
protected UserV2 |
botInfo |
protected DatafeedApi |
datafeedApi |
protected java.util.concurrent.atomic.AtomicBoolean |
started |
ackId, INITIAL_ACK_ID
Constructor and Description |
---|
DatahoseLoopImpl(DatafeedApi datafeedApi,
AuthSession authSession,
com.symphony.bdk.core.config.model.BdkConfig config,
UserV2 botInfo) |
Modifier and Type | Method and Description |
---|---|
protected void |
handleV4EventList(java.util.List<V4Event> events)
Handle a received listener by using the subscribed
RealTimeEventListener . |
protected V5EventList |
readEvents() |
protected void |
refresh() |
protected void |
runLoop() |
void |
start()
Start the datafeed events service
|
void |
stop()
Stop the datafeed events service.
|
void |
subscribe(RealTimeEventListener listener)
The bot subscribes to a
RealTimeEventListener |
void |
unsubscribe(RealTimeEventListener listener)
The bot unsubscribes to a
RealTimeEventListener |
readAndHandleEvents
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
start, stop, subscribe, unsubscribe
protected final AuthSession authSession
protected final com.symphony.bdk.core.config.model.BdkConfig bdkConfig
protected final UserV2 botInfo
protected final java.util.concurrent.atomic.AtomicBoolean started
protected DatafeedApi datafeedApi
public DatahoseLoopImpl(DatafeedApi datafeedApi, AuthSession authSession, com.symphony.bdk.core.config.model.BdkConfig config, UserV2 botInfo)
protected void runLoop() throws java.lang.Throwable
java.lang.Throwable
protected V5EventList readEvents() throws com.symphony.bdk.http.api.ApiException
readEvents
in class AbstractAckIdEventLoop
com.symphony.bdk.http.api.ApiException
public void subscribe(RealTimeEventListener listener)
RealTimeEventListener
subscribe
in interface DatafeedLoop
listener
- a Datafeed event listener to be subscribedpublic void unsubscribe(RealTimeEventListener listener)
RealTimeEventListener
unsubscribe
in interface DatafeedLoop
listener
- a Datafeed event listener to be unsubscribedpublic void start() throws AuthUnauthorizedException, com.symphony.bdk.http.api.ApiException
start
in interface DatafeedLoop
AuthUnauthorizedException
com.symphony.bdk.http.api.ApiException
public void stop()
stop
in interface DatafeedLoop
protected void handleV4EventList(@Nullable java.util.List<V4Event> events) throws RequeueEventException
RealTimeEventListener
.events
- List of Datafeed events to be handledRequeueEventException
- Raised if a listener fails and the developer wants to explicitly not update the ack id.protected void refresh() throws AuthUnauthorizedException
AuthUnauthorizedException