Interface Room
-
@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface Room
A room is an abstraction for a set of document models created for the same document. Such models belong to different users and are edited concurrently and synchronized in real-time. An document model that is part in a room is called a "peer".- Since:
- 23
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PEER_ID_ATTRIBUTE
Editing Session Context attribute to store the peer ID which is unique inside this room.static java.lang.String
ROOM_CREATOR_ATTRIBUTE
Editing Session Context attribute that mark the room creator with "true" value.static java.lang.String
ROOM_ID_ATTRIBUTE
Editing Session Context attribute to store the room ID.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close the room.RoomObserver
getObserver()
Returns the room observer, useful for saving changes made in the room by multiple users.PeerContext
getPeerContext(int peerId)
Get the peer context for a given peer.
-
-
-
Field Detail
-
PEER_ID_ATTRIBUTE
static final java.lang.String PEER_ID_ATTRIBUTE
Editing Session Context attribute to store the peer ID which is unique inside this room.- See Also:
- Constant Field Values
-
ROOM_ID_ATTRIBUTE
static final java.lang.String ROOM_ID_ATTRIBUTE
Editing Session Context attribute to store the room ID.- See Also:
- Constant Field Values
-
ROOM_CREATOR_ATTRIBUTE
static final java.lang.String ROOM_CREATOR_ATTRIBUTE
Editing Session Context attribute that mark the room creator with "true" value.- See Also:
- Constant Field Values
-
-
Method Detail
-
getPeerContext
PeerContext getPeerContext(int peerId)
Get the peer context for a given peer.- Parameters:
peerId
- The peer ID.- Returns:
- The peer context.
-
getObserver
RoomObserver getObserver()
Returns the room observer, useful for saving changes made in the room by multiple users. Note: The room observer needs to be requested when the room is created.- Returns:
- The room observer - used to observe changes to the document made in the room.
-
close
void close()
Close the room. Should do any necessary cleanup and should notify all peers.
-
-