Package io.meeds.chat.service
Class MatrixService
java.lang.Object
io.meeds.chat.service.MatrixService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDirectMessagingRoom(DirectMessagingRoom directMessagingRoom) createMatrixRoom(org.exoplatform.social.core.space.model.Space space, String roomId) records the matrix ID of the room linked top the spacecreateMatrixRoomForSpace(org.exoplatform.social.core.space.model.Space space) Creates a room for predefined spacecreateRoom(String teamDisplayName, String description) voiddisableAccount(String matrixUsername) longgetDirectMessagingRoom(String firstParticipant, String secondParticipant) getJWTSessionToken(String userNameOnMatrix) Returns the JWT for user authenticationgetMatrixDMRoomsOfUser(String user) getMatrixIdForUser(String userName) Get the matrix ID of a defined usergetRoomBySpace(org.exoplatform.social.core.space.model.Space space) Returns the ID of the room linked to a spacegetRoomSettings(String roomId) org.exoplatform.social.core.space.model.SpacegetSpaceByRoomId(String roomId) Returns the ID of the room linked to a spacevoidinit()booleanisUserMemberOfGroup(String userName, String groupId) voidjoinUserToRoom(String roomId, String matrixIdOfUser) voidkickUserFromRoom(String roomId, String matrixIdOfUser, String message) voidmakeUserAdminInRoom(String matrixRoomId, String matrixIdOfUser) voidrenameRoom(String roomId, String spaceDisplayName) saveUserAccount(org.exoplatform.services.organization.User user, boolean isNew, boolean isEnableUserOperation) Saves a new user on MatrixvoidupdateRoomAvatar(String roomId, String avatarURL) booleanupdateRoomDescription(String roomId, String description) booleanupdateRoomSettings(String roomId, MatrixRoomPermissions matrixRoomPermissions) voidupdateUserAvatar(String userMatrixID, String userAvatarUrl) uploadFileOnMatrix(String fileName, String mimeType, byte[] fileBytes)
-
Constructor Details
-
MatrixService
public MatrixService()
-
-
Method Details
-
init
@PostConstruct public void init() -
getRoomBySpace
Returns the ID of the room linked to a space- Parameters:
space-- Returns:
- the roomId linked to the space
-
getSpaceByRoomId
Returns the ID of the room linked to a space- Parameters:
roomId- the Matrix room ID- Returns:
- the roomId linked to the space
-
createMatrixRoom
public SpaceRoom createMatrixRoom(org.exoplatform.social.core.space.model.Space space, String roomId) records the matrix ID of the room linked top the space- Parameters:
space- the SpaceroomId- the ID of the matrix room- Returns:
- the room ID
-
createMatrixRoomForSpace
public String createMatrixRoomForSpace(org.exoplatform.social.core.space.model.Space space) throws Exception Creates a room for predefined space- Parameters:
space- the space- Returns:
- String representing the room id
- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedExceptionException
-
getMatrixIdForUser
Get the matrix ID of a defined user- Parameters:
userName- of the user- Returns:
- the matrix ID
-
getJWTSessionToken
Returns the JWT for user authentication- Parameters:
userNameOnMatrix- the username of the current user- Returns:
- String
-
saveUserAccount
public String saveUserAccount(org.exoplatform.services.organization.User user, boolean isNew, boolean isEnableUserOperation) Saves a new user on Matrix- Parameters:
user- the user to create on MatrixisNew- boolean if the user is new, then true- Returns:
- String the matrix user ID
-
uploadFileOnMatrix
-
updateUserAvatar
-
disableAccount
-
updateRoomDescription
-
updateRoomAvatar
-
getRoomSettings
-
updateRoomSettings
-
kickUserFromRoom
-
joinUserToRoom
-
renameRoom
-
makeUserAdminInRoom
-
createRoom
- Throws:
Exception
-
getAllLinkedRooms
public long getAllLinkedRooms() -
getDirectMessagingRoom
public DirectMessagingRoom getDirectMessagingRoom(String firstParticipant, String secondParticipant) -
createDirectMessagingRoom
public DirectMessagingRoom createDirectMessagingRoom(DirectMessagingRoom directMessagingRoom) throws org.exoplatform.commons.ObjectAlreadyExistsException - Throws:
org.exoplatform.commons.ObjectAlreadyExistsException
-
getMatrixDMRoomsOfUser
-
isUserMemberOfGroup
- Throws:
Exception
-