public interface NotificationRoomHandler extends RoomHandler
RoomHandler
interface so that the clients are also notified of spontaneous media
events.RoomHandler
Modifier and Type | Method and Description |
---|---|
void |
onParticipantEvicted(UserParticipant participant)
Called as a result of
NotificationRoomManager.evictParticipant(String) -
application-originated method, not as a consequence of a client request. |
void |
onParticipantJoined(ParticipantRequest request,
java.lang.String roomName,
java.lang.String newUserName,
java.util.Set<UserParticipant> existingParticipants,
RoomException error)
Called as a result of
NotificationRoomManager#joinRoom(String, String, ParticipantRequest) . |
void |
onParticipantLeft(ParticipantRequest request,
java.lang.String userName,
java.util.Set<UserParticipant> remainingParticipants,
RoomException error)
Called as a result of
NotificationRoomManager#leaveRoom(String, String, ParticipantRequest) . |
void |
onParticipantLeft(java.lang.String userName,
java.util.Set<UserParticipant> remainingParticipants)
Called as a result of
NotificationRoomManager.evictParticipant(String)
(application-originated action). |
void |
onPublishMedia(ParticipantRequest request,
java.lang.String publisherName,
java.lang.String sdpAnswer,
java.util.Set<UserParticipant> participants,
RoomException error)
Called as a result of
NotificationRoomManager#publishMedia(String, ParticipantRequest, MediaElement...) . |
void |
onRecvIceCandidate(ParticipantRequest request,
RoomException error)
Called as a result of
NotificationRoomManager.onIceCandidate(String, String, int, String, ParticipantRequest)
. |
void |
onRoomClosed(java.lang.String roomName,
java.util.Set<UserParticipant> participants)
Called as a result of
NotificationRoomManager.closeRoom(String) -
application-originated method, not as a consequence of a client request. |
void |
onSendMessage(ParticipantRequest request,
java.lang.String message,
java.lang.String userName,
java.lang.String roomName,
java.util.Set<UserParticipant> participants,
RoomException error)
Called as a result of
NotificationRoomManager.sendMessage(String, String, String, ParticipantRequest) . |
void |
onSubscribe(ParticipantRequest request,
java.lang.String sdpAnswer,
RoomException error)
Called as a result of
NotificationRoomManager.subscribe(String, String, ParticipantRequest) . |
void |
onUnpublishMedia(ParticipantRequest request,
java.lang.String publisherName,
java.util.Set<UserParticipant> participants,
RoomException error)
Called as a result of
NotificationRoomManager.unpublishMedia(ParticipantRequest) . |
void |
onUnsubscribe(ParticipantRequest request,
RoomException error)
Called as a result of
NotificationRoomManager.unsubscribe(String, ParticipantRequest) . |
getNextFilterState, onIceCandidate, onMediaElementError, onPipelineError, updateFilter
void onParticipantJoined(ParticipantRequest request, java.lang.String roomName, java.lang.String newUserName, java.util.Set<UserParticipant> existingParticipants, RoomException error)
NotificationRoomManager#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 representing 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 userName, java.util.Set<UserParticipant> remainingParticipants, RoomException error)
NotificationRoomManager#leaveRoom(String, String, ParticipantRequest)
. 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 requestuserName
- the departing user's nameremainingParticipants
- instances of UserParticipant
representing the remaining 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 onParticipantLeft(java.lang.String userName, java.util.Set<UserParticipant> remainingParticipants)
NotificationRoomManager.evictParticipant(String)
(application-originated action). The remaining peers should be notified of this event.request
- instance of ParticipantRequest
POJO to identify the user and the requestuserName
- the departing user's nameremainingParticipants
- instances of UserParticipant
representing the remaining participants in the
roomvoid onPublishMedia(ParticipantRequest request, java.lang.String publisherName, java.lang.String sdpAnswer, java.util.Set<UserParticipant> participants, RoomException error)
NotificationRoomManager#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 endpointparticipants
- instances of UserParticipant
for 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<UserParticipant> participants, RoomException error)
NotificationRoomManager.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 nameparticipants
- instances of UserParticipant
for 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)
NotificationRoomManager.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)
NotificationRoomManager.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<UserParticipant> participants, RoomException error)
NotificationRoomManager.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 nameparticipants
- instances of UserParticipant
for 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)
NotificationRoomManager.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<UserParticipant> participants)
NotificationRoomManager.closeRoom(String)
-
application-originated method, not as a consequence of a client 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 closedparticipants
- instances of UserParticipant
POJO representing the peers of the closed roomvoid onParticipantEvicted(UserParticipant participant)
NotificationRoomManager.evictParticipant(String)
-
application-originated method, not as a consequence of a client request. The participant should
be notified so that the client-side application would terminate gracefully.participant
- instance of UserParticipant
POJO representing the evicted peer