java.lang.Object
org.mastodon4j.core.impl.MastodonEventStream
- All Implemented Interfaces:
AutoCloseable,WebSocket.Listener,EventStream
-
Method Summary
Modifier and TypeMethodDescriptionvoidchangeSubscription(Subscription subscription) Sends the given subscription to that stream.voidclose()Closes the event stream and its underlying resources.voidonText(WebSocket webSocket, CharSequence data, boolean last) voidregisterConsumer(Consumer<Event> statusConsumer) Adds a new event consumer to this stream.
-
Method Details
-
onOpen
- Specified by:
onOpenin interfaceWebSocket.Listener
-
onText
- Specified by:
onTextin interfaceWebSocket.Listener
-
registerConsumer
Description copied from interface:EventStreamAdds a new event consumer to this stream.- Specified by:
registerConsumerin interfaceEventStream- Parameters:
statusConsumer- the event consumer to add
-
changeSubscription
Description copied from interface:EventStreamSends the given subscription to that stream.- Specified by:
changeSubscriptionin interfaceEventStream- Parameters:
subscription- the subscription definition
-
close
Description copied from interface:EventStreamCloses the event stream and its underlying resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceEventStream- Throws:
MastodonException- if a error during the close operation occurs
-