Class RoomsManager
- java.lang.Object
-
- ro.sync.ecss.extensions.api.webapp.ce.RoomsManager
-
@API(type=NOT_EXTENDABLE, src=PUBLIC) public class RoomsManager extends java.lang.Object
Class that manages the creation of instances concurrent editingRoom
.- Since:
- 23
-
-
Field Summary
Fields Modifier and Type Field Description static SaveStrategy
DEFAULT_SAVE_STRATEGY
Default save strategy used when no save strategy is explicitly specified when creating a room.static RoomsManager
INSTANCE
Singleton instance.
-
Constructor Summary
Constructors Constructor Description RoomsManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRoomCreatedListener(RoomCreatedListener listener)
Adds a listener to be called when a room is created.java.lang.String
createRoomFromDocument(AuthorDocumentModel model)
Create a room with a single document with default save strategy (DefaultSaveStrategy
).java.lang.String
createRoomFromDocument(AuthorDocumentModel model, SaveStrategy saveStrategy)
Create a room with a single document.java.util.Optional<Room>
getRoom(java.lang.String roomId)
Return the room of a given document model.java.util.Optional<Room>
getRoomTryCreateProxy(java.lang.String roomId)
Return the room of a given document model.boolean
isEnabled()
The rooms manager is enabled when the Concurrent Editing plugin is installed.void
removeRoomCreatedListener(RoomCreatedListener listener)
Removes a listener.
-
-
-
Field Detail
-
INSTANCE
public static final RoomsManager INSTANCE
Singleton instance.
-
DEFAULT_SAVE_STRATEGY
public static final SaveStrategy 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.
-
-
Method Detail
-
createRoomFromDocument
public java.lang.String createRoomFromDocument(AuthorDocumentModel model)
Create a room with a single document with default save strategy (DefaultSaveStrategy
).- Parameters:
model
- The document model.- Returns:
- The room id.
-
createRoomFromDocument
public java.lang.String createRoomFromDocument(AuthorDocumentModel model, SaveStrategy saveStrategy)
Create a room with a single document.- Parameters:
model
- The document model.saveStrategy
- The save details.- Returns:
- The room id.
-
getRoom
public java.util.Optional<Room> getRoom(java.lang.String roomId)
Return the room of a given document model.- Parameters:
roomId
- The room ID.- Returns:
- The document model.
-
getRoomTryCreateProxy
public java.util.Optional<Room> getRoomTryCreateProxy(java.lang.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
public void addRoomCreatedListener(RoomCreatedListener listener)
Adds a listener to be called when a room is created.- Parameters:
listener
- The listener to add- Since:
- 26
*********************************
EXPERIMENTAL - Subject to change
********************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
-
removeRoomCreatedListener
public void removeRoomCreatedListener(RoomCreatedListener listener)
Removes a listener.- Parameters:
listener
- The listener to remove.- Since:
- 26
*********************************
EXPERIMENTAL - Subject to change
********************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
-
-