Class ChatMongoDataStorage

    • Constructor Detail

      • ChatMongoDataStorage

        public ChatMongoDataStorage()
    • Method Detail

      • getTeamRoomById

        public org.exoplatform.chat.model.RoomBean getTeamRoomById​(String roomId)
        Description copied from interface: ChatDataStorage
        Retrieve a Room by its ID
        Specified by:
        getTeamRoomById in interface ChatDataStorage
        Parameters:
        roomId - the ID of the room
        Returns:
        the room or null if the room doesn't exists
      • deleteTeamRoom

        public void deleteTeamRoom​(String roomId,
                                   String user)
        Description copied from interface: ChatDataStorage
        Delete a Team Room by its corresponding ID.
        Nothing happen if :
        • the roomId doesn't exists
        • the roomId doesn't correspond to a Team Room
        • the specified user is not the owner of the Team Room
        Specified by:
        deleteTeamRoom in interface ChatDataStorage
        Parameters:
        roomId - the team room ID to delete
        user - the owner of the team room
      • read

        public String read​(String room,
                           boolean isTextOnly,
                           Long fromTimestamp,
                           Long toTimestamp,
                           int limitToLoad)
        Description copied from interface: ChatDataStorage
        Read messages from room from a dedicated timestamp to another with limit.
        Specified by:
        read in interface ChatDataStorage
        Returns:
      • getExistingRooms

        public List<org.exoplatform.chat.model.RoomBean> getExistingRooms​(String user,
                                                                          boolean withPublic,
                                                                          boolean isAdmin,
                                                                          org.exoplatform.chat.services.NotificationService notificationService,
                                                                          org.exoplatform.chat.services.TokenService tokenService)
        Specified by:
        getExistingRooms in interface ChatDataStorage
        Returns:
        All existing personal rooms of given user
      • getRooms

        public org.exoplatform.chat.model.RoomsBean getRooms​(String user,
                                                             List<String> onlineUsers,
                                                             String filter,
                                                             boolean withUsers,
                                                             boolean withSpaces,
                                                             boolean withPublic,
                                                             boolean withOffline,
                                                             boolean isAdmin,
                                                             int limit,
                                                             org.exoplatform.chat.services.NotificationService notificationService,
                                                             org.exoplatform.chat.services.TokenService tokenService)
        Specified by:
        getRooms in interface ChatDataStorage
      • getUserRooms

        public org.exoplatform.chat.model.RoomsBean getUserRooms​(String user,
                                                                 List<String> onlineUsers,
                                                                 String filter,
                                                                 int offset,
                                                                 int limit,
                                                                 org.exoplatform.chat.services.NotificationService notificationService,
                                                                 org.exoplatform.chat.services.TokenService tokenService)
        This will load all user rooms with pagination
        Specified by:
        getUserRooms in interface ChatDataStorage
        Parameters:
        user - the user for whom roomw will be loaded
        onlineUsers - list of online users
        filter - the filter used to filter rooms
        offset - the current offset
        limit - the limit of rooms
        notificationService - service storing rooms notifications
        tokenService - service storing tokens
        Returns:
        RoomsBean containing all rooms with unread messages
      • getUserRooms

        public org.exoplatform.chat.model.RoomsBean getUserRooms​(String user,
                                                                 List<String> onlineUsers,
                                                                 String filter,
                                                                 int offset,
                                                                 int limit,
                                                                 org.exoplatform.chat.services.NotificationService notificationService,
                                                                 org.exoplatform.chat.services.TokenService tokenService,
                                                                 String roomType)
        This will load all user rooms with pagination
        Specified by:
        getUserRooms in interface ChatDataStorage
        Parameters:
        user - the user for whom roomw will be loaded
        onlineUsers - list of online users
        filter - the filter used to filter rooms
        offset - the current offset
        limit - the limit of rooms
        notificationService - service storing rooms notifications
        tokenService - service storing tokens
        roomType - type of the room : u for one to one , t for team room or s for space rooms
        Returns:
        RoomsBean containing all rooms with unread messages