public class DefaultRoomEventHandler extends Object implements RoomEventHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
ICE_CANDIDATE_METHOD |
static String |
MEDIA_ERROR_METHOD |
static String |
ON_ICE_CANDIDATE_PARAM |
static String |
ON_ICE_EP_NAME_PARAM |
static String |
ON_ICE_SDP_M_LINE_INDEX_PARAM |
static String |
ON_ICE_SDP_MID_PARAM |
static String |
PARTICIPANT_JOINED_METHOD |
static String |
PARTICIPANT_LEFT_METHOD |
static String |
PARTICIPANT_PUBLISHED_METHOD |
static String |
PARTICIPANT_SEND_MESSAGE_METHOD |
static String |
PARTICIPANT_UNPUBLISHED_METHOD |
static String |
ROOM_CLOSED_METHOD |
| Constructor and Description |
|---|
DefaultRoomEventHandler(UserNotificationService notifService) |
| Modifier and Type | Method and Description |
|---|---|
void |
onParticipantJoined(ParticipantRequest request,
String roomName,
String newUserName,
Set<UserParticipant> existingParticipants,
RoomException error)
Called as a result of
RoomManager.joinRoom(String, String, ParticipantRequest). |
void |
onParticipantLeft(ParticipantRequest request,
String roomName,
String userName,
Set<String> remainingParticipantIds,
RoomException error)
Called as a result of
RoomManager#leaveRoom(String, String, ParticipantRequest) or
RoomManager.evictParticipant(String) (admin action). |
void |
onParticipantMediaError(String participantId,
String description)
Called as a result of an error intercepted on a media element of a
participant.
|
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<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(String roomName,
Set<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,
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 |
onSendIceCandidate(String participantId,
String endpointName,
org.kurento.client.IceCandidate candidate)
Called when a new
IceCandidate is gathered for the local WebRTC
endpoint. |
void |
onSendMessage(ParticipantRequest request,
String message,
String userName,
String roomName,
Set<String> participantIds,
RoomException error)
Called as a result of
RoomManager.sendMessage(String, String, String, ParticipantRequest)
. |
void |
onSubscribe(ParticipantRequest request,
String sdpAnswer,
RoomException error)
Called as a result of
RoomManager.subscribe(String, String, ParticipantRequest). |
void |
onUnpublishMedia(ParticipantRequest request,
String publisherName,
Set<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). |
public static final String PARTICIPANT_LEFT_METHOD
public static final String PARTICIPANT_JOINED_METHOD
public static final String PARTICIPANT_PUBLISHED_METHOD
public static final String PARTICIPANT_UNPUBLISHED_METHOD
public static final String PARTICIPANT_SEND_MESSAGE_METHOD
public static final String ROOM_CLOSED_METHOD
public static final String MEDIA_ERROR_METHOD
public static final String ICE_CANDIDATE_METHOD
public static final String ON_ICE_EP_NAME_PARAM
public static final String ON_ICE_CANDIDATE_PARAM
public static final String ON_ICE_SDP_MID_PARAM
public static final String ON_ICE_SDP_M_LINE_INDEX_PARAM
public DefaultRoomEventHandler(UserNotificationService notifService)
public void onRoomCreated(ParticipantRequest request, String roomName)
RoomEventHandlerRoomManager.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).onRoomCreated in interface RoomEventHandlerrequest - instance of ParticipantRequest POJO to identify
the user and the requestroomName - the room's namepublic void onRoomClosed(String roomName, Set<String> participantIds)
RoomEventHandlerRoomManager.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.onRoomClosed in interface RoomEventHandlerroomName - the room that's just been closedparticipantIds - identifiers of the participants in the roompublic void onParticipantJoined(ParticipantRequest request, String roomName, String newUserName, Set<UserParticipant> existingParticipants, RoomException error)
RoomEventHandlerRoomManager.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 RoomEventHandlerrequest - 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.public void onParticipantLeft(ParticipantRequest request, String roomName, String userName, Set<String> remainingParticipantIds, RoomException error)
RoomEventHandlerRoomManager#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.onParticipantLeft in interface RoomEventHandlerrequest - 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.public void onPublishMedia(ParticipantRequest request, String publisherName, String sdpAnswer, Set<String> participantIds, RoomException error)
RoomEventHandlerRoomManager#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 RoomEventHandlerrequest - 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.public void onUnpublishMedia(ParticipantRequest request, String publisherName, Set<String> participantIds, RoomException error)
RoomEventHandlerRoomManager.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 RoomEventHandlerrequest - 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.public void onSubscribe(ParticipantRequest request, String sdpAnswer, RoomException error)
RoomEventHandlerRoomManager.subscribe(String, String, ParticipantRequest). The
user should be responded with generated SPD answer from the local WebRTC
endpoint.onSubscribe in interface RoomEventHandlerrequest - 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)
RoomEventHandlerRoomManager.unsubscribe(String, ParticipantRequest). The user
should receive an acknowledgement if the operation completed successfully
(no error).onUnsubscribe in interface RoomEventHandlerrequest - 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<String> participantIds, RoomException error)
RoomEventHandlerRoomManager.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 RoomEventHandlerrequest - 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.public void onRecvIceCandidate(ParticipantRequest request, RoomException error)
RoomEventHandlerRoomManager.onIceCandidate(String, String, int, String, ParticipantRequest)
. The user should receive an acknowledgement if the operation completed
successfully (no error).onRecvIceCandidate in interface RoomEventHandlerrequest - 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 onSendIceCandidate(String participantId, String endpointName, org.kurento.client.IceCandidate candidate)
RoomEventHandlerIceCandidate 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.onSendIceCandidate in interface RoomEventHandlerparticipantId - 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)
RoomEventHandleronPipelineError in interface RoomEventHandlerroomName - the room where the error occurredparticipantIds - the participants identifiersdescription - description of the errorpublic void onParticipantMediaError(String participantId, String description)
RoomEventHandleronParticipantMediaError in interface RoomEventHandlerparticipantId - identifier of the participantdescription - description of the errorCopyright © 2015 Kurento. All rights reserved.