public abstract class SseEventSourceFactory extends Object
SseEventSourceFactory is an abstract class that can be used to create
SseEventSources by specifying the end-point. It may be extended to
instantiate particular subclasses of SseEventSource and thus provide
a general framework for the addition of public SSE-level functionality.| Modifier | Constructor and Description |
|---|---|
protected |
SseEventSourceFactory() |
| Modifier and Type | Method and Description |
|---|---|
abstract SseEventSource |
createEventSource(URI location)
Creates a
SseEventSource to connect to the target location. |
static SseEventSourceFactory |
createEventSourceFactory()
Creates and returns a new instance of the default implementation of the
SseEventSourceFactory. |
abstract HttpRedirectPolicy |
getDefaultFollowRedirect()
Returns the default
HttpRedirectPolicy that was specified at
on the factory. |
abstract long |
getDefaultRetryTimeout()
Returns the default retry timeout.
|
abstract void |
setDefaultFollowRedirect(HttpRedirectPolicy option)
Sets the default
HttpRedirectPolicy that is to be inherited by
all the EventSources created using this factory instance. |
abstract void |
setDefaultRetryTimeout(long millis)
Sets the default retry timeout that is to be inherited by all the
EventSources created using this factory instance. |
public static SseEventSourceFactory createEventSourceFactory()
SseEventSourceFactory.public abstract SseEventSource createEventSource(URI location) throws URISyntaxException
SseEventSource to connect to the target location.
location - URI of the SSE provider for the connectionURISyntaxExceptionpublic abstract HttpRedirectPolicy getDefaultFollowRedirect()
HttpRedirectPolicy that was specified at
on the factory.
### TODO: If this wasn't set, should we return HttpRedirectOption.NONE or
null.public abstract long getDefaultRetryTimeout()
public abstract void setDefaultFollowRedirect(HttpRedirectPolicy option)
HttpRedirectPolicy that is to be inherited by
all the EventSources created using this factory instance.option - HttpRedirectOptionpublic abstract void setDefaultRetryTimeout(long millis)
EventSources created using this factory instance.millis - retry timeoutCopyright © 2014. All Rights Reserved.