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
HttpRedirectOption that was specified at
on the factory. |
abstract long |
getDefaultRetryTimeout()
Returns the default retry timeout.
|
abstract void |
setDefaultFollowRedirect(HttpRedirectPolicy redirectOption)
Sets the default
HttpRedirectOption 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()
HttpRedirectOption 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 redirectOption)
HttpRedirectOption 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 © 2015. All Rights Reserved.