Class RoomsManager
java.lang.Object
ro.sync.ecss.extensions.api.webapp.ce.RoomsManager
Class that manages the creation of instances concurrent editing
Room.- Since:
- 23
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SaveStrategyDefault save strategy used when no save strategy is explicitly specified when creating a room.static final RoomsManagerSingleton instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRoomCreatedListener(RoomCreatedListener listener) Adds a listener to be called when a room is created.Create a room with a single document with default save strategy (DefaultSaveStrategy).createRoomFromDocument(AuthorDocumentModel model, SaveStrategy saveStrategy) Create a room with a single document.Return the room of a given document model.getRoomTryCreateProxy(String roomId) Return the room of a given document model.booleanThe rooms manager is enabled when the Concurrent Editing plugin is installed.voidremoveRoomCreatedListener(RoomCreatedListener listener) Removes a listener.
-
Field Details
-
INSTANCE
Singleton instance. -
DEFAULT_SAVE_STRATEGY
Default save strategy used when no save strategy is explicitly specified when creating a room. Saves all changes at once, as the user who triggered the save.
-
-
Constructor Details
-
RoomsManager
public RoomsManager()
-
-
Method Details
-
createRoomFromDocument
Create a room with a single document with default save strategy (DefaultSaveStrategy).- Parameters:
model- The document model.- Returns:
- The room id.
-
createRoomFromDocument
Create a room with a single document.- Parameters:
model- The document model.saveStrategy- The save details.- Returns:
- The room id.
-
getRoom
Return the room of a given document model.- Parameters:
roomId- The room ID.- Returns:
- The document model.
-
getRoomTryCreateProxy
public Optional<Room> getRoomTryCreateProxy(String roomId) throws RoomProxyCouldNotBeCreatedException Return the room of a given document model. Tries to create a proxy room if the room doesn't exist on this server.- Parameters:
roomId- The room ID.- Returns:
- The room instance for the given ID.
- Throws:
RoomProxyCouldNotBeCreatedException- If the instantiation of a proxy room fails.
-
isEnabled
public boolean isEnabled()The rooms manager is enabled when the Concurrent Editing plugin is installed.- Returns:
- true if the concurrent editing support is enabled.
-
addRoomCreatedListener
Adds a listener to be called when a room is created.- Parameters:
listener- The listener to add- Since:
- 26
-
removeRoomCreatedListener
Removes a listener.- Parameters:
listener- The listener to remove.- Since:
- 26
-