| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| private static class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final Queue | |
| private final List | |
| private final HttpServerExchange | |
| private final Queue | flushingMessages
Messages that have been written to the channel but flush() has failed |
| private volatile long | |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater | |
| private Map | |
| private PooledByteBuffer | |
| private Map | |
| private final Deque | |
| private volatile boolean | |
| private final StreamSinkChannel | |
| private XnioExecutor. | |
| private final ServerSentEventConnection. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | addCloseTask(ChannelListener<ServerSentEventConnection>
The listener to invoke listener)Adds a listener that will be invoked when the channel is closed |
| public <T> void | addToAttachmentList(AttachmentKey<AttachmentList<T>>
the attachment key key, T the value to add value)Implements io. Add a value to a list-typed attachment key. |
| public void | |
| private synchronized void | |
| private void | |
| public Account | |
| public <T> T | getAttachment(AttachmentKey<T>
the attachment key key)Implements io. Get an attachment value. |
| public <T> List | getAttachmentList(AttachmentKey<? extends List<T>>
the attachment key key)Implements io. Gets a list attachment value. |
| public long | |
| public String | |
| public Principal | |
| public Map | |
| public Map | |
| public String | |
| public HeaderMap | Returns: The request headers from the initial request that opened this connection
|
| public String | |
| public HeaderMap | Returns: The response headers from the initial request that opened this connection
|
| private void | |
| public boolean | |
| public <T> T | putAttachment(AttachmentKey<T>
the attachment key key, T the new value value)Implements io. Set an attachment value. |
| public <T> T | removeAttachment(AttachmentKey<T>
the attachment key key)Implements io. Remove an attachment, returning its previous value. |
| public void | |
| public void | send(String
The event data data, ServerSentEventConnection.A callback that is notified on Success or failure callbackSends an event to the remote client |
| public synchronized void | send(String
The event data data, String The event name event, String The event ID id, ServerSentEventConnection.A callback that is notified on Success or failure callbackSends an event to the remote client |
| public void | sendRetry(long
The retry time in milliseconds retry)Sends the 'retry' message to the client, instructing it how long to wait before attempting a reconnect. |
| public synchronized void | sendRetry(long
The retry time in milliseconds retry, ServerSentEventConnection.The callback that is notified on success or failure callbackSends the 'retry' message to the client, instructing it how long to wait before attempting a reconnect. |
| public void | setKeepAliveTime(long
The time in milliseconds between keep alive messaged keepAliveTime)Sets the keep alive time in milliseconds. |
| public void | |
| public void |
| buffered | back to summary |
|---|---|
| private final Queue<ServerSentEventConnection. | |
| closeTasks | back to summary |
|---|---|
| private final List<ChannelListener<ServerSentEventConnection>> closeTasks | |
| exchange | back to summary |
|---|---|
| private final HttpServerExchange exchange | |
| flushingMessages | back to summary |
|---|---|
| private final Queue<ServerSentEventConnection. Messages that have been written to the channel but flush() has failed | |
| keepAliveTime | back to summary |
|---|---|
| private volatile long keepAliveTime | |
| open | back to summary |
|---|---|
| private volatile int open | |
| openUpdater | back to summary |
|---|---|
| private static final AtomicIntegerFieldUpdater<ServerSentEventConnection> openUpdater | |
| parameters | back to summary |
|---|---|
| private Map<String, String> parameters | |
| pooled | back to summary |
|---|---|
| private PooledByteBuffer pooled | |
| properties | back to summary |
|---|---|
| private Map<String, Object> properties | |
| queue | back to summary |
|---|---|
| private final Deque<ServerSentEventConnection. | |
| shutdown | back to summary |
|---|---|
| private volatile boolean shutdown | |
| sink | back to summary |
|---|---|
| private final StreamSinkChannel sink | |
| timerKey | back to summary |
|---|---|
| private XnioExecutor. | |
| writeListener | back to summary |
|---|---|
| private final ServerSentEventConnection. | |
| ServerSentEventConnection | back to summary |
|---|---|
| public ServerSentEventConnection(HttpServerExchange exchange, StreamSinkChannel sink) | |
| addCloseTask | back to summary |
|---|---|
| public synchronized void addCloseTask(ChannelListener<ServerSentEventConnection> listener) Adds a listener that will be invoked when the channel is closed
| |
| addToAttachmentList | back to summary |
|---|---|
| public <T> void addToAttachmentList(AttachmentKey<AttachmentList<T>> key, T value) Implements io. Doc from io. Add a value to a list-typed attachment key. If the key is not mapped, add such a mapping.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this channel. After a channel is closed, any further attempt to invoke I/O
operations upon it will cause a If this channel is already closed then invoking this method has no effect. This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.
| |
| close | back to summary |
|---|---|
| private synchronized void close(IOException e) throws IOException | |
| fillBuffer | back to summary |
|---|---|
| private void fillBuffer() | |
| getAccount | back to summary |
|---|---|
public Account getAccount()
| |
| getAttachment | back to summary |
|---|---|
| public <T> T getAttachment(AttachmentKey<T> key) Implements io. Doc from io. Get an attachment value. If no attachment exists for this key,
| |
| getAttachmentList | back to summary |
|---|---|
| public <T> List Implements io. Doc from io. Gets a list attachment value. If not attachment exists for this key an empty list is returned
| |
| getKeepAliveTime | back to summary |
|---|---|
public long getKeepAliveTime()
| |
| getParameter | back to summary |
|---|---|
| public String getParameter(String name) | |
| getPrincipal | back to summary |
|---|---|
public Principal getPrincipal()
| |
| getProperties | back to summary |
|---|---|
| public Map | |
| getQueryParameters | back to summary |
|---|---|
| public Map | |
| getQueryString | back to summary |
|---|---|
public String getQueryString()
| |
| getRequestHeaders | back to summary |
|---|---|
public HeaderMap getRequestHeaders()
| |
| getRequestURI | back to summary |
|---|---|
public String getRequestURI()
| |
| getResponseHeaders | back to summary |
|---|---|
public HeaderMap getResponseHeaders()
| |
| handleException | back to summary |
|---|---|
| private void handleException(IOException e) | |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements java. Doc from java. Tells whether or not this channel is open.
| |
| putAttachment | back to summary |
|---|---|
| public <T> T putAttachment(AttachmentKey<T> key, T value) Implements io. Doc from io. Set an attachment value. If an attachment for this key was already set, return the original value. If the value being set
is
| |
| removeAttachment | back to summary |
|---|---|
| public <T> T removeAttachment(AttachmentKey<T> key) Implements io. Doc from io. Remove an attachment, returning its previous value.
| |
| send | back to summary |
|---|---|
| public void send(String data) Sends an event to the remote client
| |
| send | back to summary |
|---|---|
| public void send(String data, ServerSentEventConnection. Sends an event to the remote client
| |
| send | back to summary |
|---|---|
| public synchronized void send(String data, String event, String id, ServerSentEventConnection. Sends an event to the remote client
| |
| sendRetry | back to summary |
|---|---|
| public void sendRetry(long retry) Sends the 'retry' message to the client, instructing it how long to wait before attempting a reconnect.
| |
| sendRetry | back to summary |
|---|---|
| public synchronized void sendRetry(long retry, ServerSentEventConnection. Sends the 'retry' message to the client, instructing it how long to wait before attempting a reconnect.
| |
| setKeepAliveTime | back to summary |
|---|---|
| public void setKeepAliveTime(long keepAliveTime) Sets the keep alive time in milliseconds. If this is larger than zero a ':' message will be sent this often (assuming there is no activity) to keep the connection alive. The spec recommends a value of 15000 (15 seconds).
| |
| setParameter | back to summary |
|---|---|
| public void setParameter(String name, String value) | |
| shutdown | back to summary |
|---|---|
| public void shutdown() execute a graceful shutdown once all data has been sent | |
| Modifier and Type | Method and Description |
|---|---|
| public void | done(ServerSentEventConnection
The connection connection, String The message data data, String The message event event, String The message id id)Notification that is called when a message is sucessfully sent |
| public void | failed(ServerSentEventConnection
The connection connection, String The message data data, String The message event event, String The message id id, IOException The exception e)Notification that is called when a message send fails. |
| done | back to summary |
|---|---|
| public void done(ServerSentEventConnection connection, String data, String event, String id) Notification that is called when a message is sucessfully sent
| |
| failed | back to summary |
|---|---|
| public void failed(ServerSentEventConnection connection, String data, String event, String id, IOException e) Notification that is called when a message send fails.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ServerSentEventConnection. | |
| pack-priv final String | |
| private int | |
| pack-priv final String | |
| pack-priv final String | |
| private byte[] | |
| private int | |
| pack-priv final long |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| callback | back to summary |
|---|---|
| pack-priv final ServerSentEventConnection. | |
| data | back to summary |
|---|---|
| pack-priv final String data | |
| endBufferPosition | back to summary |
|---|---|
| private int endBufferPosition | |
| event | back to summary |
|---|---|
| pack-priv final String event | |
| id | back to summary |
|---|---|
| pack-priv final String id | |
| leftOverData | back to summary |
|---|---|
| private byte[] leftOverData | |
| leftOverDataOffset | back to summary |
|---|---|
| private int leftOverDataOffset | |
| retry | back to summary |
|---|---|
| pack-priv final long retry | |
| SSEData | back to summary |
|---|---|
| private SSEData(String event, String data, String id, ServerSentEventConnection. | |
| SSEData | back to summary |
|---|---|
| private SSEData(long retry, ServerSentEventConnection. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | handleEvent(StreamSinkChannel
the channel event channel)Implements org. Handle the event on this channel. |
| SseWriteListener | back to summary |
|---|---|
| private SseWriteListener() | |
| handleEvent | back to summary |
|---|---|
| public void handleEvent(StreamSinkChannel channel) Implements org. Doc from org. Handle the event on this channel.
| |