Class RoomsManager

java.lang.Object
ro.sync.ecss.extensions.api.webapp.ce.RoomsManager

@API(type=NOT_EXTENDABLE, src=PUBLIC) public class RoomsManager extends Object
Class that manages the creation of instances concurrent editing Room.
Since:
23
  • Field Details

    • 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.
  • Constructor Details

    • RoomsManager

      public RoomsManager()
  • Method Details

    • createRoomFromDocument

      public 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 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 Optional<Room> getRoom(String roomId)
      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

      public void addRoomCreatedListener(RoomCreatedListener listener)
      Adds a listener to be called when a room is created.
      Parameters:
      listener - The listener to add
      Since:
      26
    • removeRoomCreatedListener

      public void removeRoomCreatedListener(RoomCreatedListener listener)
      Removes a listener.
      Parameters:
      listener - The listener to remove.
      Since:
      26