public class DefaultNotificationRoomHandler extends Object implements NotificationRoomHandler
| Constructor and Description |
|---|
DefaultNotificationRoomHandler(UserNotificationService notifService) |
| Modifier and Type | Method and Description |
|---|---|
void |
onIceCandidate(String roomName,
String participantId,
String endpointName,
org.kurento.client.IceCandidate candidate)
Called when a new
IceCandidate is gathered for the local WebRTC endpoint. |
void |
onMediaElementError(String roomName,
String participantId,
String description)
Called as a result of an error intercepted on a media element of a participant.
|
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,
String roomName,
String newUserName,
Set<UserParticipant> existingParticipants,
RoomException error)
Called as a result of
NotificationRoomManager#joinRoom(String, String, ParticipantRequest) . |
void |
onParticipantLeft(ParticipantRequest request,
String userName,
Set<UserParticipant> remainingParticipants,
RoomException error)
Called as a result of
NotificationRoomManager#leaveRoom(String, String, ParticipantRequest) . |
void |
onParticipantLeft(String userName,
Set<UserParticipant> remainingParticipants)
Called as a result of
NotificationRoomManager.evictParticipant(String)
(application-originated action). |
void |
onPipelineError(String roomName,
Set<String> participantIds,
String description)
Called as a result of an error intercepted on the media pipeline.
|
void |
onPublishMedia(ParticipantRequest request,
String publisherName,
String sdpAnswer,
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(String roomName,
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,
String message,
String userName,
String roomName,
Set<UserParticipant> participants,
RoomException error)
Called as a result of
NotificationRoomManager.sendMessage(String, String, String, ParticipantRequest) . |
void |
onSubscribe(ParticipantRequest request,
String sdpAnswer,
RoomException error)
Called as a result of
NotificationRoomManager.subscribe(String, String, ParticipantRequest) . |
void |
onUnpublishMedia(ParticipantRequest request,
String publisherName,
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). |
public DefaultNotificationRoomHandler(UserNotificationService notifService)
public void onRoomClosed(String roomName, Set<UserParticipant> participants)
NotificationRoomHandlerNotificationRoomManager.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.onRoomClosed in interface NotificationRoomHandlerroomName - the room that's just been closedparticipants - instances of UserParticipant POJO representing the peers of the closed roompublic void onParticipantJoined(ParticipantRequest request, String roomName, String newUserName, Set<UserParticipant> existingParticipants, RoomException error)
NotificationRoomHandlerNotificationRoomManager#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.onParticipantJoined in interface NotificationRoomHandlerrequest - 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.public void onParticipantLeft(ParticipantRequest request, String userName, Set<UserParticipant> remainingParticipants, RoomException error)
NotificationRoomHandlerNotificationRoomManager#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.onParticipantLeft in interface NotificationRoomHandlerrequest - 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.public void onPublishMedia(ParticipantRequest request, String publisherName, String sdpAnswer, Set<UserParticipant> participants, RoomException error)
NotificationRoomHandlerNotificationRoomManager#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.onPublishMedia in interface NotificationRoomHandlerrequest - 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.public void onUnpublishMedia(ParticipantRequest request, String publisherName, Set<UserParticipant> participants, RoomException error)
NotificationRoomHandlerNotificationRoomManager.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.onUnpublishMedia in interface NotificationRoomHandlerrequest - 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.public void onSubscribe(ParticipantRequest request, String sdpAnswer, RoomException error)
NotificationRoomHandlerNotificationRoomManager.subscribe(String, String, ParticipantRequest) . The user should
be responded with generated SPD answer from the local WebRTC endpoint.onSubscribe in interface NotificationRoomHandlerrequest - 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.public void onUnsubscribe(ParticipantRequest request, RoomException error)
NotificationRoomHandlerNotificationRoomManager.unsubscribe(String, ParticipantRequest).
The user should receive an acknowledgement if the operation completed successfully (no error).onUnsubscribe in interface NotificationRoomHandlerrequest - 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.public void onSendMessage(ParticipantRequest request, String message, String userName, String roomName, Set<UserParticipant> participants, RoomException error)
NotificationRoomHandlerNotificationRoomManager.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.onSendMessage in interface NotificationRoomHandlerrequest - 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.public void onRecvIceCandidate(ParticipantRequest request, RoomException error)
NotificationRoomHandlerNotificationRoomManager.onIceCandidate(String, String, int, String, ParticipantRequest)
. The user should receive an acknowledgement if the operation completed successfully (no
error).onRecvIceCandidate in interface NotificationRoomHandlerrequest - 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.public void onParticipantLeft(String userName, Set<UserParticipant> remainingParticipants)
NotificationRoomHandlerNotificationRoomManager.evictParticipant(String)
(application-originated action). The remaining peers should be notified of this event.onParticipantLeft in interface NotificationRoomHandleruserName - the departing user's nameremainingParticipants - instances of UserParticipant representing the remaining participants in the
roompublic void onParticipantEvicted(UserParticipant participant)
NotificationRoomHandlerNotificationRoomManager.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.onParticipantEvicted in interface NotificationRoomHandlerparticipant - instance of UserParticipant POJO representing the evicted peerpublic void onIceCandidate(String roomName, String participantId, String endpointName, org.kurento.client.IceCandidate candidate)
RoomHandlerIceCandidate is gathered for the local WebRTC endpoint. The user
should receive a notification with all the provided information so that the candidate is added
to the remote WebRTC peer.onIceCandidate in interface RoomHandlerroomName - name of the roomparticipantId - identifier of the participantendpointName - String the identifier of the local WebRTC endpoint (created in the server)candidate - the gathered IceCandidatepublic void onPipelineError(String roomName, Set<String> participantIds, String description)
RoomHandleronPipelineError in interface RoomHandlerroomName - the room where the error occurredparticipantIds - the participants identifierspublic void onMediaElementError(String roomName, String participantId, String description)
RoomHandleronMediaElementError in interface RoomHandlerroomName - name of the roomparticipantId - identifier of the participantCopyright © 2016 Kurento. All rights reserved.