public abstract class SseEventSource extends Object
http://www.whatwg.org/specs/web-apps/current-work/#server-sent-events
http://www.whatwg.org/specs/web-apps/current-work/#the-event-source
Constructor and Description |
---|
SseEventSource() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Disconnects with the server.
|
abstract void |
connect()
Connects with the server using an end-point.
|
abstract SseEventReader |
getEventReader()
Returns a
SseEventReader that can be used to receive
events based on the SseEventType . |
abstract HttpRedirectPolicy |
getFollowRedirect()
Returns
HttpRedirectPolicy indicating the policy for
following HTTP redirects (3xx). |
abstract long |
getRetryTimeout()
Returns the retry timeout in milliseconds.
|
abstract void |
setFollowRedirect(HttpRedirectPolicy option)
Sets
HttpRedirectPolicy indicating the policy for
following HTTP redirects (3xx). |
abstract void |
setRetryTimeout(long millis)
Sets the retry timeout specified in milliseconds.
|
public abstract void close() throws IOException
IOException
- if the disconnect did not succeedpublic abstract void connect() throws IOException
IOException
- if the connection cannot be establishedpublic abstract SseEventReader getEventReader() throws IOException
SseEventReader
that can be used to receive
events based on the SseEventType
.
If this method is invoked before a connection is established successfully, then an IOException is thrown.
IOException
- if invoked before the connection is openedpublic abstract HttpRedirectPolicy getFollowRedirect()
HttpRedirectPolicy
indicating the policy for
following HTTP redirects (3xx). The default option is
HttpRedirectPolicy#NONE
.public abstract long getRetryTimeout()
public abstract void setFollowRedirect(HttpRedirectPolicy option)
HttpRedirectPolicy
indicating the policy for
following HTTP redirects (3xx).option
- HttpRedirectOption to used for following the
redirectspublic abstract void setRetryTimeout(long millis)
millis
- retry timeoutCopyright © 2015. All Rights Reserved.