public interface RoomEventHandler extends RoomHandler
Modifier and Type | Method and Description |
---|---|
void |
onParticipantJoined(ParticipantRequest request,
java.lang.String roomName,
java.lang.String newUserName,
java.util.Set<UserParticipant> existingParticipants,
RoomException error)
Called as a result of
RoomManager.joinRoom(String, String, ParticipantRequest) . |
void |
onParticipantLeft(ParticipantRequest request,
java.lang.String roomName,
java.lang.String userName,
java.util.Set<java.lang.String> remainingParticipantIds,
RoomException error)
Called as a result of
RoomManager#leaveRoom(String, String, ParticipantRequest) or
RoomManager.evictParticipant(String) (admin action). |
void |
onPublishMedia(ParticipantRequest request,
java.lang.String publisherName,
java.lang.String sdpAnswer,
java.util.Set<java.lang.String> participantIds,
RoomException error)
Called as a result of
RoomManager#publishMedia(String, ParticipantRequest, MediaElement...)
. |
void |
onRecvIceCandidate(ParticipantRequest request,
RoomException error)
Called as a result of
RoomManager.onIceCandidate(String, String, int, String, ParticipantRequest)
. |
void |
onRoomClosed(java.lang.String roomName,
java.util.Set<java.lang.String> participantIds)
Called as a result of
RoomManager.closeRoom(String) or
RoomManager.evictParticipant(String) - server domain methods, not
as a consequence of a room API request. |
void |
onRoomCreated(ParticipantRequest request,
java.lang.String roomName)
Called as a result of
RoomManager.joinRoom(String, String, ParticipantRequest) when the
specified room doesn't exist and it's successfully created. |
void |
onSendMessage(ParticipantRequest request,
java.lang.String message,
java.lang.String userName,
java.lang.String roomName,
java.util.Set<java.lang.String> participantIds,
RoomException error)
Called as a result of
RoomManager.sendMessage(String, String, String, ParticipantRequest)
. |
void |
onSubscribe(ParticipantRequest request,
java.lang.String sdpAnswer,
RoomException error)
Called as a result of
RoomManager.subscribe(String, String, ParticipantRequest) . |
void |
onUnpublishMedia(ParticipantRequest request,
java.lang.String publisherName,
java.util.Set<java.lang.String> participantIds,
RoomException error)
Called as a result of
RoomManager.unpublishMedia(ParticipantRequest) . |
void |
onUnsubscribe(ParticipantRequest request,
RoomException error)
Called as a result of
RoomManager.unsubscribe(String, ParticipantRequest) . |
onIceCandidate, onMediaElementError, onPipelineError
void onRoomCreated(ParticipantRequest request, java.lang.String roomName)
RoomManager.joinRoom(String, String, ParticipantRequest)
when the
specified room doesn't exist and it's successfully created. Normally this
event won't have to be notified to the user(s).request
- instance of ParticipantRequest
POJO to identify
the user and the requestroomName
- the room's namevoid onParticipantJoined(ParticipantRequest request, java.lang.String roomName, java.lang.String newUserName, java.util.Set<UserParticipant> existingParticipants, RoomException error)
RoomManager.joinRoom(String, String, ParticipantRequest)
. The new
participant should be responded with all the available information: the
existing peers and, for any publishers, their stream names. The current
peers should receive a notification of the join event.request
- instance of ParticipantRequest
POJO to identify
the user and the requestroomName
- the room's namenewUserName
- the new userexistingParticipants
- instances of UserParticipant
POJO
that represent the already existing peerserror
- instance of RoomException
POJO, includes a code and
error message. If not null, then the join was unsuccessful and the
user should be responded accordingly.void onParticipantLeft(ParticipantRequest request, java.lang.String roomName, java.lang.String userName, java.util.Set<java.lang.String> remainingParticipantIds, RoomException error)
RoomManager#leaveRoom(String, String, ParticipantRequest)
or
RoomManager.evictParticipant(String)
(admin action). The user
should receive an acknowledgement if the operation completed
successfully, and the remaining peers should be notified of this event.request
- instance of ParticipantRequest
POJO to identify
the user and the requestroomName
- the room's nameuserName
- the departing user's nameremainingParticipantIds
- identifiers of the participants in the
roomerror
- instance of RoomException
POJO, includes a code and
error message. If not null, then the operation was unsuccessful
and the user should be responded accordingly.void onPublishMedia(ParticipantRequest request, java.lang.String publisherName, java.lang.String sdpAnswer, java.util.Set<java.lang.String> participantIds, RoomException error)
RoomManager#publishMedia(String, ParticipantRequest, MediaElement...)
. The user should receive the generated SPD answer from the local WebRTC
endpoint, and the other peers should be notified of this event.request
- instance of ParticipantRequest
POJO to identify
the user and the requestpublisherName
- the user namesdpAnswer
- String with generated SPD answer from the local WebRTC
endpointparticipantIds
- identifiers of ALL the participants in the room
(includes the publisher)error
- instance of RoomException
POJO, includes a code and
error message. If not null, then the operation was unsuccessful
and the user should be responded accordingly.void onUnpublishMedia(ParticipantRequest request, java.lang.String publisherName, java.util.Set<java.lang.String> participantIds, RoomException error)
RoomManager.unpublishMedia(ParticipantRequest)
. The user should
receive an acknowledgement if the operation completed successfully, and
all other peers in the room should be notified of this event.request
- instance of ParticipantRequest
POJO to identify
the user and the requestpublisherName
- the user nameparticipantIds
- identifiers of ALL the participants in the room
(includes the publisher)error
- instance of RoomException
POJO, includes a code and
error message. If not null, then the operation was unsuccessful
and the user should be responded accordingly.void onSubscribe(ParticipantRequest request, java.lang.String sdpAnswer, RoomException error)
RoomManager.subscribe(String, String, ParticipantRequest)
. The
user should be responded with generated SPD answer from the local WebRTC
endpoint.request
- instance of ParticipantRequest
POJO to identify
the user and the requestsdpAnswer
- String with generated SPD answer from the local WebRTC
endpointerror
- instance of RoomException
POJO, includes a code and
error message. If not null, then the operation was unsuccessful
and the user should be responded accordingly.void onUnsubscribe(ParticipantRequest request, RoomException error)
RoomManager.unsubscribe(String, ParticipantRequest)
. The user
should receive an acknowledgement if the operation completed successfully
(no error).request
- instance of ParticipantRequest
POJO to identify
the user and the requesterror
- instance of RoomException
POJO, includes a code and
error message. If not null, then the operation was unsuccessful
and the user should be responded accordingly.void onSendMessage(ParticipantRequest request, java.lang.String message, java.lang.String userName, java.lang.String roomName, java.util.Set<java.lang.String> participantIds, RoomException error)
RoomManager.sendMessage(String, String, String, ParticipantRequest)
. The user should receive an acknowledgement if the operation completed
successfully, and all the peers in the room should be notified with the
message contents and its origin.request
- instance of ParticipantRequest
POJO to identify
the user and the requestmessage
- String with the message bodyuserName
- name of the peer that sent itroomName
- the current room nameparticipantIds
- identifiers of ALL the participants in the room
(includes the sender)error
- instance of RoomException
POJO, includes a code and
error message. If not null, then the operation was unsuccessful
and the user should be responded accordingly.void onRecvIceCandidate(ParticipantRequest request, RoomException error)
RoomManager.onIceCandidate(String, String, int, String, ParticipantRequest)
. The user should receive an acknowledgement if the operation completed
successfully (no error).request
- instance of ParticipantRequest
POJO to identify
the user and the requesterror
- instance of RoomException
POJO, includes a code and
error message. If not null, then the operation was unsuccessful
and the user should be responded accordingly.void onRoomClosed(java.lang.String roomName, java.util.Set<java.lang.String> participantIds)
RoomManager.closeRoom(String)
or
RoomManager.evictParticipant(String)
- server domain methods, not
as a consequence of a room API request. All resources on the server,
associated with the room, have been released. The existing participants
in the room should be notified of this event so that the client-side
application acts accordingly.roomName
- the room that's just been closedparticipantIds
- identifiers of the participants in the room