@ProviderType public interface SocketIOSocket extends SocketIOEmitter
Modifier and Type | Method and Description |
---|---|
SocketIOEmitter |
broadcast()
Sets a modifier for a subsequent event emission that the event will
sent to all sockets except to itself.
|
SocketIOSocket |
disconnect(boolean close)
Disconnects this socket.
|
SocketIOSocket |
emit(java.lang.String eventName,
SocketIOAckListener ackListener,
JSONArray arguments)
Emits an event to the socket identified by the string name.
|
SocketIOSocket |
emit(java.lang.String eventName,
SocketIOAckListener ackListener,
java.lang.Object... arguments)
Emits an event to the socket identified by the string name.
|
java.lang.String |
getId()
A unique identifier for the socket session, that comes from the underlying Client.
|
SocketIONamespace |
getNamespace()
Client namespace
|
java.util.Set<java.lang.String> |
getRooms()
A list of strings identifying the rooms this socket is in.
|
java.security.Principal |
getUserPrincipal() |
SocketIOSocket |
join(java.lang.String name)
Adds the socket to the room, and fires optionally a callback fn with err signature (if any).
|
SocketIOSocket |
leave(java.lang.String name)
Removes the socket from room, and fires optionally a callback fn
with err signature (if any).
|
SocketIOSocket |
removeListener(SocketIOSocketListener listener)
Removes a listener from this socket.
|
SocketIOSocket |
setListener(SocketIOSocketListener listener)
Sets a listener to this socket that will receive the socket events.
|
emit, emit, to
@Nonnull SocketIOSocket setListener(@Nonnull SocketIOSocketListener listener)
listener
- the listenerjava.lang.IllegalArgumentException
- if this socket already has a listener@Nonnull SocketIOSocket removeListener(@Nonnull SocketIOSocketListener listener)
listener
- the listenerjava.lang.IllegalArgumentException
- if this socket already has a listener defined that is not the given one.@Nonnull java.lang.String getId()
@Nonnull SocketIONamespace getNamespace()
@Nonnull java.util.Set<java.lang.String> getRooms()
@Nonnull SocketIOSocket disconnect(boolean close)
close
- true
to also close the underlying connection@Nonnull SocketIOSocket join(@Nonnull java.lang.String name)
name
- room name@Nonnull SocketIOSocket leave(@Nonnull java.lang.String name)
name
- room name@Nonnull SocketIOEmitter broadcast()
@Nonnull SocketIOSocket emit(@Nonnull java.lang.String eventName, @Nonnull SocketIOAckListener ackListener, @Nonnull java.lang.Object... arguments) throws java.io.IOException
SocketIOAckListener
that will be called after the client sent the
ack response.eventName
- name of the eventackListener
- the acknowledge listenerarguments
- optional argumentsjava.io.IOException
- error@Nonnull SocketIOSocket emit(@Nonnull java.lang.String eventName, @Nonnull SocketIOAckListener ackListener, @Nonnull JSONArray arguments) throws java.io.IOException
SocketIOAckListener
that will be called after the client sent the
ack response.eventName
- name of the eventackListener
- the acknowledge listenerarguments
- optional argumentsjava.io.IOException
- errorjava.security.Principal getUserPrincipal()
Principal
of the current authenticated user.Copyright © 2010 - 2020 Adobe. All Rights Reserved