Class WebSocketServiceImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate  
      private org.springframework.messaging.simp.user.SimpUserRegistry simpUserRegistry  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String generateActionId()
      This method does generation for unique action id
      java.util.List<java.lang.String> getSubscribers​(java.lang.String destination)
      This method retrieves all subscribers based on destination
      void sendGlobalResponse​(java.lang.String destination, org.springframework.messaging.simp.SimpMessageHeaderAccessor headerAccessor, java.util.Map<java.lang.String,​java.lang.Object> result)
      This method does server-push for all users
      void sendSharedResponse​(java.lang.String destination, java.util.Map<java.lang.String,​java.lang.Object> result)
      This method does server-push for subscribers from destination
      void sendUserResponse​(java.lang.String destination, java.lang.String sessionId, org.springframework.messaging.simp.SimpMessageHeaderAccessor headerAccessor, java.util.Map<java.lang.String,​java.lang.Object> result)
      This method does server-push for current user
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • messagingTemplate

        @Autowired
        private org.springframework.messaging.simp.SimpMessagingTemplate messagingTemplate
      • simpUserRegistry

        @Autowired
        private org.springframework.messaging.simp.user.SimpUserRegistry simpUserRegistry
    • Constructor Detail

      • WebSocketServiceImpl

        public WebSocketServiceImpl()
    • Method Detail

      • generateActionId

        public java.lang.String generateActionId()
        Description copied from interface: WebSocketService
        This method does generation for unique action id
        Specified by:
        generateActionId in interface WebSocketService
        Returns:
        generated unique id for the response
      • sendSharedResponse

        public void sendSharedResponse​(java.lang.String destination,
                                       java.util.Map<java.lang.String,​java.lang.Object> result)
        Description copied from interface: WebSocketService
        This method does server-push for subscribers from destination
        Specified by:
        sendSharedResponse in interface WebSocketService
        Parameters:
        destination - endpoint for web-socket connection
        result - payload object for response
      • sendGlobalResponse

        public void sendGlobalResponse​(java.lang.String destination,
                                       org.springframework.messaging.simp.SimpMessageHeaderAccessor headerAccessor,
                                       java.util.Map<java.lang.String,​java.lang.Object> result)
        Description copied from interface: WebSocketService
        This method does server-push for all users
        Specified by:
        sendGlobalResponse in interface WebSocketService
        Parameters:
        destination - endpoint for web-socket connection
        headerAccessor - header for web-socket response
        result - payload object for response
      • sendUserResponse

        public void sendUserResponse​(java.lang.String destination,
                                     java.lang.String sessionId,
                                     org.springframework.messaging.simp.SimpMessageHeaderAccessor headerAccessor,
                                     java.util.Map<java.lang.String,​java.lang.Object> result)
        Description copied from interface: WebSocketService
        This method does server-push for current user
        Specified by:
        sendUserResponse in interface WebSocketService
        Parameters:
        destination - endpoint for web-socket connection
        sessionId - session id for current connected user
        headerAccessor - header for web-socket response
        result - payload object for response
      • getSubscribers

        public java.util.List<java.lang.String> getSubscribers​(java.lang.String destination)
        Description copied from interface: WebSocketService
        This method retrieves all subscribers based on destination
        Specified by:
        getSubscribers in interface WebSocketService
        Parameters:
        destination - endpoint for web-socket connection
        Returns:
        the list of all subscribers based on destination