public class DefaultServer extends Object implements Server
Server.
This implementation provides and manages ServerSocket processing HTTP request and WebSocket
following the Vibe protocol.
| Constructor and Description |
|---|
DefaultServer() |
| Modifier and Type | Method and Description |
|---|---|
Sentence |
all()
Returns a sentence that all of the socket in this server or all of the
server if it's in a clustered environment have to follow.
|
Server |
all(org.atmosphere.vibe.platform.Action<ServerSocket> action)
Executes the given action retrieving all of the socket in this server or
all of the server if it's in a clustered environment .
|
Sentence |
byId(String id)
Returns a sentence that the socket of the given id in this server or all
of the server if it's in a clustered environment 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 or all of the server if it's in a clustered environment.
|
Sentence |
byTag(String... names)
Returns a sentence that the socket tagged with all of the given names in
this server or all of the server if it's in a clustered environment have
to follow.
|
Server |
byTag(String[] names,
org.atmosphere.vibe.platform.Action<ServerSocket> action)
Executes the given action retrieving the socket tagged with all of the
given names in this server or all of the server if it's in a clustered
environment.
|
Server |
byTag(String name,
org.atmosphere.vibe.platform.Action<ServerSocket> action)
Executes the given action retrieving the socket tagged with the given
name in this server or all of the server if it's in a clustered
environment.
|
org.atmosphere.vibe.platform.Action<org.atmosphere.vibe.platform.server.ServerHttpExchange> |
httpAction()
ServerHttpExchange action to install in wes
|
void |
set_heartbeat(int _heartbeat)
To speed up the protocol tests.
|
void |
setHeartbeat(int heartbeat)
A heartbeat interval in milliseconds to maintain a connection alive and
prevent server from holding idle connections.
|
void |
setTransports(String... transports)
A set of transports to allow connections.
|
Server |
socketAction(org.atmosphere.vibe.platform.Action<ServerSocket> action)
Registers an action to be called when the socket has been opened in this
server regardless of clustering.
|
org.atmosphere.vibe.platform.Action<org.atmosphere.vibe.platform.server.ServerWebSocket> |
websocketAction()
ServerWebSocket action to install in wes
|
public Sentence all()
Serverpublic Server all(org.atmosphere.vibe.platform.Action<ServerSocket> action)
Serverpublic Sentence byId(String id)
Serverpublic Server byId(String id, org.atmosphere.vibe.platform.Action<ServerSocket> action)
Serverpublic Sentence byTag(String... names)
Serverpublic Server byTag(String name, org.atmosphere.vibe.platform.Action<ServerSocket> action)
Serverpublic Server byTag(String[] names, org.atmosphere.vibe.platform.Action<ServerSocket> action)
Serverpublic Server socketAction(org.atmosphere.vibe.platform.Action<ServerSocket> action)
ServersocketAction in interface Serverpublic org.atmosphere.vibe.platform.Action<org.atmosphere.vibe.platform.server.ServerHttpExchange> httpAction()
ServerhttpAction in interface Serverpublic org.atmosphere.vibe.platform.Action<org.atmosphere.vibe.platform.server.ServerWebSocket> websocketAction()
ServerwebsocketAction in interface Serverpublic void setTransports(String... transports)
ws,
sse, streamxhr, streamxdr,
streamiframe, longpollajax,
longpollxdr and longpolljsonp.public void setHeartbeat(int heartbeat)
public void set_heartbeat(int _heartbeat)
Copyright 2014, The Vibe Project