Class ChatMongoDataStorage
java.lang.Object
org.exoplatform.chat.services.mongodb.ChatMongoDataStorage
- All Implemented Interfaces:
ChatDataStorage
@Named("chatStorage")
@ApplicationScoped
@Singleton
public class ChatMongoDataStorage
extends Object
implements ChatDataStorage
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteTeamRoom(String roomId, String user) 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 RoomvoidList<org.exoplatform.chat.model.RoomBean>getExistingRooms(String user, boolean withPublic, boolean isAdmin, org.exoplatform.chat.services.NotificationService notificationService, org.exoplatform.chat.services.TokenService tokenService) getExternalRoom(String identifier) org.exoplatform.chat.model.MessageBeangetMessage(String roomId, String messageId) intintorg.exoplatform.chat.model.RoomsBeangetRooms(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) getSpaceRoom(String space) getSpaceRoomByName(String name) getTeamCreator(String room) getTeamRoom(String team, String user) org.exoplatform.chat.model.RoomBeangetTeamRoomById(String roomId) Retrieve a Room by its IDList<org.exoplatform.chat.model.RoomBean>getTeamRoomByName(String teamName) Return rooms by namegetTypeRoomChat(String roomId) org.exoplatform.chat.model.RoomsBeangetUserRooms(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 paginationorg.exoplatform.chat.model.RoomsBeangetUserRooms(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 paginationbooleanisRoomEnabled(String room) Read messages from room from a dedicated timestamp to another with limit.voidsetRoomEnabled(String room, boolean enabled) voidsetRoomMeetingStatus(String room, boolean start, String startTime) voidsetRoomName(String room, String name) voidvoid
-
Field Details
-
M_ROOM_PREFIX
- See Also:
-
M_ROOMS_COLLECTION
- See Also:
-
-
Constructor Details
-
ChatMongoDataStorage
public ChatMongoDataStorage()
-
-
Method Details
-
write
- Specified by:
writein interfaceChatDataStorage
-
write
- Specified by:
writein interfaceChatDataStorage
-
save
- Specified by:
savein interfaceChatDataStorage
-
delete
- Specified by:
deletein interfaceChatDataStorage
-
getTeamRoomByName
Description copied from interface:ChatDataStorageReturn rooms by name- Specified by:
getTeamRoomByNamein interfaceChatDataStorage- Returns:
-
getTeamRoomById
Description copied from interface:ChatDataStorageRetrieve a Room by its ID- Specified by:
getTeamRoomByIdin interfaceChatDataStorage- Parameters:
roomId- the ID of the room- Returns:
- the room or null if the room doesn't exists
-
deleteTeamRoom
Description copied from interface:ChatDataStorageDelete 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:
deleteTeamRoomin interfaceChatDataStorage- Parameters:
roomId- the team room ID to deleteuser- the owner of the team room
-
edit
- Specified by:
editin interfaceChatDataStorage
-
read
- Specified by:
readin interfaceChatDataStorage
-
read
- Specified by:
readin interfaceChatDataStorage
-
read
public String read(String room, boolean isTextOnly, Long fromTimestamp, Long toTimestamp, int limitToLoad) Description copied from interface:ChatDataStorageRead messages from room from a dedicated timestamp to another with limit.- Specified by:
readin interfaceChatDataStorage- Returns:
-
getMessage
- Specified by:
getMessagein interfaceChatDataStorage
-
getSpaceRoom
- Specified by:
getSpaceRoomin interfaceChatDataStorage
-
getSpaceRoomByName
- Specified by:
getSpaceRoomByNamein interfaceChatDataStorage
-
getTeamRoom
- Specified by:
getTeamRoomin interfaceChatDataStorage
-
getExternalRoom
- Specified by:
getExternalRoomin interfaceChatDataStorage
-
getTeamCreator
- Specified by:
getTeamCreatorin interfaceChatDataStorage
-
setRoomName
- Specified by:
setRoomNamein interfaceChatDataStorage
-
isRoomEnabled
- Specified by:
isRoomEnabledin interfaceChatDataStorage
-
setRoomEnabled
- Specified by:
setRoomEnabledin interfaceChatDataStorage
-
setRoomMeetingStatus
- Specified by:
setRoomMeetingStatusin interfaceChatDataStorage
-
getRoom
- Specified by:
getRoomin interfaceChatDataStorage
-
getTypeRoomChat
- Specified by:
getTypeRoomChatin interfaceChatDataStorage
-
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:
getExistingRoomsin interfaceChatDataStorage- 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:
getRoomsin interfaceChatDataStorage
-
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:
getUserRoomsin interfaceChatDataStorage- Parameters:
user- the user for whom roomw will be loadedonlineUsers- list of online usersfilter- the filter used to filter roomsoffset- the current offsetlimit- the limit of roomsnotificationService- service storing rooms notificationstokenService- 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:
getUserRoomsin interfaceChatDataStorage- Parameters:
user- the user for whom roomw will be loadedonlineUsers- list of online usersfilter- the filter used to filter roomsoffset- the current offsetlimit- the limit of roomsnotificationService- service storing rooms notificationstokenService- service storing tokensroomType- 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
-
getNumberOfRooms
public int getNumberOfRooms()- Specified by:
getNumberOfRoomsin interfaceChatDataStorage
-
getNumberOfMessages
public int getNumberOfMessages()- Specified by:
getNumberOfMessagesin interfaceChatDataStorage
-