public class RoomService extends java.lang.Object implements RoomServiceEventListener
Its important to note the distinction between creating a room and joining a room. Creating a room implies the creation of the room object, but not the monitoring of it by the service. You must explicitly join a room (register with the RoomService) in order to receive individual room events.
| Constructor and Description |
|---|
RoomService(SymphonyClient symClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRoomServiceEventListener(RoomServiceEventListener roomServiceEventListener) |
Room |
createRoom(SymRoomAttributes symRoomAttributes)
Create a new room object from
SymRoomAttributes provided. |
Room |
getRoom(java.lang.String streamId)
Return registered room by provided stream.
|
Room |
getRoom(SymStream symStream)
Return registered room by provided stream.
|
void |
joinRoom(Room room)
Logical join of the room which registers the listeners and the Room object to the service.
|
void |
onMessage(SymMessage symMessage)
Callback from registered room listener on the MessageService.
|
void |
onNewRoom(Room room)
Publish new room objects based on detection and/or registration to the service
|
void |
onSymRoomCreated(SymRoomCreated symRoomCreated) |
void |
onSymRoomDeactivated(SymRoomDeactivated symRoomDeactivated) |
void |
onSymRoomMemberDemotedFromOwner(SymRoomMemberDemotedFromOwner symRoomMemberDemotedFromOwner) |
void |
onSymRoomMemberPromotedToOwner(SymRoomMemberPromotedToOwner symRoomMemberPromotedToOwner) |
void |
onSymRoomReactivated(SymRoomReactivated symRoomReactivated) |
void |
onSymRoomUpdated(SymRoomUpdated symRoomUpdated) |
void |
onSymUserJoinedRoom(SymUserJoinedRoom symUserJoinedRoom) |
void |
onSymUserLeftRoom(SymUserLeftRoom symUserLeftRoom) |
void |
removeRoomServiceEventListener(RoomServiceEventListener roomServiceEventListener) |
public RoomService(SymphonyClient symClient)
symClient - SymphonyClient provides access to client implementations and dependant services such as the
MessageServicepublic Room createRoom(SymRoomAttributes symRoomAttributes) throws RoomException
SymRoomAttributes provided. The room object will be enriched with all
associated room metadata at the point of creation.
Note: Future lifecycle room events are not automatically reflected in the created room object. updated.
symRoomAttributes - Room attributes required to create the room objectRoom objectRoomException - Exception generated from the logical creation of the room objectpublic Room getRoom(java.lang.String streamId)
joinRoom(Room) method.streamId - Stream Room ID as key to lookup registered roomRoom based on stream ID providedpublic Room getRoom(SymStream symStream)
joinRoom(Room) method.symStream - Stream ID as key to lookup registered roomRoom based on stream ID providedpublic void joinRoom(Room room) throws RoomException
This call will also update room details within the Room object.
room - Room to registerRoomException - Caused by room details that prevent logical monitoring of the room objectpublic void onMessage(SymMessage symMessage)
RoomServiceEventListener
Messages associated with registered rooms are published to room object listeners.
onMessage in interface RoomServiceEventListenersymMessage - Room messages detected and publishedpublic void onSymRoomDeactivated(SymRoomDeactivated symRoomDeactivated)
onSymRoomDeactivated in interface RoomServiceEventListenerpublic void onSymRoomMemberDemotedFromOwner(SymRoomMemberDemotedFromOwner symRoomMemberDemotedFromOwner)
onSymRoomMemberDemotedFromOwner in interface RoomServiceEventListenerpublic void onSymRoomMemberPromotedToOwner(SymRoomMemberPromotedToOwner symRoomMemberPromotedToOwner)
onSymRoomMemberPromotedToOwner in interface RoomServiceEventListenerpublic void onSymRoomReactivated(SymRoomReactivated symRoomReactivated)
onSymRoomReactivated in interface RoomServiceEventListenerpublic void onSymRoomUpdated(SymRoomUpdated symRoomUpdated)
onSymRoomUpdated in interface RoomServiceEventListenerpublic void onSymUserJoinedRoom(SymUserJoinedRoom symUserJoinedRoom)
onSymUserJoinedRoom in interface RoomServiceEventListenerpublic void onSymUserLeftRoom(SymUserLeftRoom symUserLeftRoom)
onSymUserLeftRoom in interface RoomServiceEventListenerpublic void onSymRoomCreated(SymRoomCreated symRoomCreated)
onSymRoomCreated in interface RoomServiceEventListenerpublic void onNewRoom(Room room)
onNewRoom in interface RoomServiceEventListenerroom - Room object published from callbackpublic void addRoomServiceEventListener(RoomServiceEventListener roomServiceEventListener)
public void removeRoomServiceEventListener(RoomServiceEventListener roomServiceEventListener)