Package io.meeds.chat.rest
Class MatrixRest
java.lang.Object
io.meeds.chat.rest.MatrixRest
- All Implemented Interfaces:
org.exoplatform.services.rest.resource.ResourceContainer
@RestController
@RequestMapping("/matrix")
public class MatrixRest
extends Object
implements org.exoplatform.services.rest.resource.ResourceContainer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDirectMessagingRoom(jakarta.servlet.http.HttpServletRequest request, Room room) org.springframework.http.ResponseEntity<String> disableChat(jakarta.servlet.http.HttpServletRequest request, String spaceId) org.springframework.http.ResponseEntity<String> enableChat(jakarta.servlet.http.HttpServletRequest request, String spaceId) getByRoomId(String roomId) getDirectMessagingRoom(jakarta.servlet.http.HttpServletRequest request, String firstParticipant, String secondParticipant) getMatrixRoomBySpaceId(jakarta.servlet.http.HttpServletRequest request, String spaceId) io.meeds.pwa.model.PwaNotificationMessagegetNotification(jakarta.servlet.http.HttpServletRequest request, String roomId, String eventId, String timeStamp, String accessToken) org.springframework.http.ResponseEntity<?> getParticipantInfo(String userId) org.springframework.http.ResponseEntity<RoomEntity> getRoomById(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.context.request.WebRequest webRequest, String roomId) org.springframework.http.ResponseEntity<RoomEntity> getRoomBySpaceId(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.context.request.WebRequest webRequest, long spaceId) org.springframework.http.ResponseEntity<String> isPushNotificationsEnabled(jakarta.servlet.http.HttpServletRequest request, String userName) booleanlinkSpaceToRoom(String spaceGroupId, String roomId, Boolean create) org.springframework.http.ResponseEntity<String> This API is used by Matrix server to notify the Meeds server that a user has a new notification This API is used as a Push Gateway for Matrix serverprocessRooms(RoomList roomList, String currentUserName) Process the Matrix rooms and adds the missing information of users and spacesorg.springframework.http.ResponseEntity<RoomList> processRooms(jakarta.servlet.http.HttpServletRequest request, RoomList rooms) org.springframework.http.ResponseEntity<String> org.springframework.http.ResponseEntity<String> updatePresenceStatus(Presence presence) org.springframework.http.ResponseEntity<String> updatePushNotificationsSettings(jakarta.servlet.http.HttpServletRequest request, String pushNotificationSetting)
-
Constructor Details
-
MatrixRest
public MatrixRest()
-
-
Method Details
-
getMatrixRoomBySpaceId
@GetMapping @Secured("users") public RoomEntity getMatrixRoomBySpaceId(jakarta.servlet.http.HttpServletRequest request, @RequestParam(name="spaceId") String spaceId) -
getDirectMessagingRoom
@GetMapping("dmRoom") @Secured("users") public RoomEntity getDirectMessagingRoom(jakarta.servlet.http.HttpServletRequest request, @RequestParam(name="firstParticipant") String firstParticipant, @RequestParam(name="secondParticipant") String secondParticipant) -
createDirectMessagingRoom
@PostMapping @Secured("users") public RoomEntity createDirectMessagingRoom(jakarta.servlet.http.HttpServletRequest request, @RequestBody Room room) -
notify
This API is used by Matrix server to notify the Meeds server that a user has a new notification This API is used as a Push Gateway for Matrix server- Parameters:
notification-- Returns:
-
linkSpaceToRoom
-
getUserDirectMessagingRooms
-
getByRoomId
-
getRoomById
@GetMapping("byRoomId") @Secured("users") public org.springframework.http.ResponseEntity<RoomEntity> getRoomById(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.context.request.WebRequest webRequest, @RequestParam(name="roomId") String roomId) -
getRoomBySpaceId
@GetMapping("spaceRoom") @Secured("users") public org.springframework.http.ResponseEntity<RoomEntity> getRoomBySpaceId(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.context.request.WebRequest webRequest, @RequestParam(name="spaceId") long spaceId) -
processRooms
-
updatePresenceStatus
-
syncUsersAndSpaces
@GetMapping("sync") @Secured("administrators") public org.springframework.http.ResponseEntity<String> syncUsersAndSpaces() -
getParticipantInfo
@GetMapping("participant/{userId}") @Secured("users") public org.springframework.http.ResponseEntity<?> getParticipantInfo(@PathVariable("userId") String userId) -
enableChat
-
disableChat
-
getNotification
@PutMapping("notification/{roomId}/{eventId}/{ts}") @Secured("users") public io.meeds.pwa.model.PwaNotificationMessage getNotification(jakarta.servlet.http.HttpServletRequest request, @PathVariable("roomId") String roomId, @PathVariable("eventId") String eventId, @PathVariable("ts") String timeStamp, @RequestBody(required=false) String accessToken) -
muteRoom
-
isPushNotificationsEnabled
-
updatePushNotificationsSettings
-
processRooms
Process the Matrix rooms and adds the missing information of users and spaces- Parameters:
roomList- the room list received from Matrix par sync APIcurrentUserName- the current user- Returns:
- the roo List after processing
-