Class Namespace
java.lang.Object
com.corundumstudio.socketio.namespace.Namespace
- All Implemented Interfaces:
ClientListeners
,SocketIONamespace
Hub object for all clients in one namespace.
Namespace shares by different namespace-clients.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClient
(SocketIOClient client) void
addConnectListener
(ConnectListener listener) void
addDisconnectListener
(DisconnectListener listener) void
addEventInterceptor
(EventInterceptor eventInterceptor) <T> void
addEventListener
(String eventName, Class<T> eventClass, DataListener<T> listener) <L> void
addListeners
(Iterable<L> listeners) void
addListeners
(Object listeners) void
addListeners
(Object listeners, Class<?> listenersClass) void
addMultiTypeEventListener
(String eventName, MultiTypeEventListener listener, Class<?>... eventClass) void
addPingListener
(PingListener listener) from v4, ping will always be sent by server except probe ping packet sent from client, and pong will always be responded by client while receiving ping except probe pong packet responded from server it makes no more sense to listen to ping packet, instead you can listen to pong packetvoid
addPongListener
(PongListener listener) void
boolean
Get all clients connected to namespaceGet client by uuid connected to namespacegetName()
getRoomClients
(String room) int
getRoomOperations
(String room) getRooms()
getRooms
(SocketIOClient client) int
hashCode()
void
void
void
void
void
void
leaveRooms
(Set<String> rooms, UUID sessionId) void
onConnect
(SocketIOClient client) void
onDisconnect
(SocketIOClient client) void
onEvent
(NamespaceClient client, String eventName, List<Object> args, AckRequest ackRequest) void
onPing
(SocketIOClient client) void
onPong
(SocketIOClient client) void
removeAllListeners
(String eventName)
-
Field Details
-
DEFAULT_NAME
- See Also:
-
-
Constructor Details
-
Namespace
-
-
Method Details
-
addClient
-
getName
- Specified by:
getName
in interfaceSocketIONamespace
-
addMultiTypeEventListener
public void addMultiTypeEventListener(String eventName, MultiTypeEventListener listener, Class<?>... eventClass) - Specified by:
addMultiTypeEventListener
in interfaceClientListeners
-
removeAllListeners
- Specified by:
removeAllListeners
in interfaceClientListeners
-
addEventListener
- Specified by:
addEventListener
in interfaceClientListeners
-
addEventInterceptor
- Specified by:
addEventInterceptor
in interfaceClientListeners
-
onEvent
public void onEvent(NamespaceClient client, String eventName, List<Object> args, AckRequest ackRequest) -
addDisconnectListener
- Specified by:
addDisconnectListener
in interfaceClientListeners
-
onDisconnect
-
addConnectListener
- Specified by:
addConnectListener
in interfaceClientListeners
-
onConnect
-
addPingListener
Description copied from interface:ClientListeners
from v4, ping will always be sent by server except probe ping packet sent from client, and pong will always be responded by client while receiving ping except probe pong packet responded from server it makes no more sense to listen to ping packet, instead you can listen to pong packet- Specified by:
addPingListener
in interfaceClientListeners
-
addPongListener
- Specified by:
addPongListener
in interfaceClientListeners
-
onPing
-
onPong
-
getBroadcastOperations
- Specified by:
getBroadcastOperations
in interfaceSocketIONamespace
-
getRoomOperations
- Specified by:
getRoomOperations
in interfaceSocketIONamespace
-
hashCode
public int hashCode() -
equals
-
addListeners
- Specified by:
addListeners
in interfaceClientListeners
-
addListeners
- Specified by:
addListeners
in interfaceClientListeners
-
addListeners
- Specified by:
addListeners
in interfaceClientListeners
-
joinRoom
-
joinRooms
-
dispatch
-
join
-
leaveRoom
-
leaveRooms
-
leave
-
getRooms
-
getRooms
-
getRoomClients
-
getRoomClientsInCluster
-
getAllClients
Description copied from interface:SocketIONamespace
Get all clients connected to namespace- Specified by:
getAllClients
in interfaceSocketIONamespace
- Returns:
- collection of clients
-
getJsonSupport
-
getClient
Description copied from interface:SocketIONamespace
Get client by uuid connected to namespace- Specified by:
getClient
in interfaceSocketIONamespace
- Parameters:
uuid
- - id of client- Returns:
- client
-