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
MessageService
public 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 RoomServiceEventListener
symMessage
- Room messages detected and publishedpublic void onSymRoomDeactivated(SymRoomDeactivated symRoomDeactivated)
onSymRoomDeactivated
in interface RoomServiceEventListener
public void onSymRoomMemberDemotedFromOwner(SymRoomMemberDemotedFromOwner symRoomMemberDemotedFromOwner)
onSymRoomMemberDemotedFromOwner
in interface RoomServiceEventListener
public void onSymRoomMemberPromotedToOwner(SymRoomMemberPromotedToOwner symRoomMemberPromotedToOwner)
onSymRoomMemberPromotedToOwner
in interface RoomServiceEventListener
public void onSymRoomReactivated(SymRoomReactivated symRoomReactivated)
onSymRoomReactivated
in interface RoomServiceEventListener
public void onSymRoomUpdated(SymRoomUpdated symRoomUpdated)
onSymRoomUpdated
in interface RoomServiceEventListener
public void onSymUserJoinedRoom(SymUserJoinedRoom symUserJoinedRoom)
onSymUserJoinedRoom
in interface RoomServiceEventListener
public void onSymUserLeftRoom(SymUserLeftRoom symUserLeftRoom)
onSymUserLeftRoom
in interface RoomServiceEventListener
public void onSymRoomCreated(SymRoomCreated symRoomCreated)
onSymRoomCreated
in interface RoomServiceEventListener
public void onNewRoom(Room room)
onNewRoom
in interface RoomServiceEventListener
room
- Room object published from callbackpublic void addRoomServiceEventListener(RoomServiceEventListener roomServiceEventListener)
public void removeRoomServiceEventListener(RoomServiceEventListener roomServiceEventListener)