public interface Server
Server consumes ServerHttpExchange and
ServerWebSocket, produces ServerSocket following the Vibe
protocol and manages their life cycles. Server API is used to receive
ServerHttpExchange and ServerWebSocket from the platform and
accept, find and handle ServerSocket.
Server may be accessed by multiple threads.
| Modifier and Type | Method and Description |
|---|---|
Sentence |
all()
Returns a sentence that every socket in this server have to follow.
|
Server |
all(org.atmosphere.vibe.platform.Action<ServerSocket> action)
Executes the given action retrieving every socket in this server.
|
Sentence |
byId(String id)
Returns a sentence that the socket of the given id in this server have to
follow.
|
Server |
byId(String id,
org.atmosphere.vibe.platform.Action<ServerSocket> action)
Executes the given action retrieving the socket of the given id in this
server.
|
Sentence |
byTag(String... names)
Returns a sentence that the socket tagged with the given tags in this
server have to follow.
|
Server |
byTag(String[] names,
org.atmosphere.vibe.platform.Action<ServerSocket> action)
Executes the given action retrieving the socket tagged with the given
tags in this server.
|
Server |
byTag(String name,
org.atmosphere.vibe.platform.Action<ServerSocket> action)
Executes the given action retrieving the socket tagged with the given tag
in this server.
|
org.atmosphere.vibe.platform.Action<org.atmosphere.vibe.platform.server.ServerHttpExchange> |
httpAction()
An action to consume
ServerHttpExchange. |
Server |
socketAction(org.atmosphere.vibe.platform.Action<ServerSocket> action)
Registers an action to be called when the socket has been opened in this
server.
|
org.atmosphere.vibe.platform.Action<org.atmosphere.vibe.platform.server.ServerWebSocket> |
wsAction()
An action to consume
ServerWebSocket. |
Sentence all()
Server all(org.atmosphere.vibe.platform.Action<ServerSocket> action)
Sentence byId(String id)
Server byId(String id, org.atmosphere.vibe.platform.Action<ServerSocket> action)
Sentence byTag(String... names)
Server byTag(String name, org.atmosphere.vibe.platform.Action<ServerSocket> action)
Server byTag(String[] names, org.atmosphere.vibe.platform.Action<ServerSocket> action)
Server socketAction(org.atmosphere.vibe.platform.Action<ServerSocket> action)
org.atmosphere.vibe.platform.Action<org.atmosphere.vibe.platform.server.ServerHttpExchange> httpAction()
ServerHttpExchange.org.atmosphere.vibe.platform.Action<org.atmosphere.vibe.platform.server.ServerWebSocket> wsAction()
ServerWebSocket.Copyright 2014, The Vibe Project