Class ExternalBrokerSessionManagementService

java.lang.Object
com.finconsgroup.itserr.marketplace.usercommunication.dm.service.impl.AbstractSessionManagementService
com.finconsgroup.itserr.marketplace.usercommunication.dm.service.impl.ExternalBrokerSessionManagementService
All Implemented Interfaces:
SessionManagementService

@ConditionalOnProperty(prefix="user-communication.dm.web-socket", value="enable-broker-relay", havingValue="true") @Service public class ExternalBrokerSessionManagementService extends AbstractSessionManagementService
The external broker implementation for SessionManagementService
  • Constructor Details

    • ExternalBrokerSessionManagementService

      public ExternalBrokerSessionManagementService(org.springframework.messaging.simp.user.SimpUserRegistry userRegistry, UserRepository userRepository)
  • Method Details

    • onSessionCreated

      @Transactional(propagation=REQUIRED, rollbackFor=java.lang.Exception.class) public User onSessionCreated(@NonNull String sessionId, @NonNull WebSocketUser user)
      Description copied from interface: SessionManagementService
      Callback method to call when a user connects to a web socket session.
      Parameters:
      sessionId - the STOMP session id
      user - the connected user
      Returns:
      the User entity if it was updated, null otherwise
    • onSessionDestroyed

      @Transactional(propagation=REQUIRED, rollbackFor=java.lang.Exception.class) public User onSessionDestroyed(@NonNull String sessionId)
      Description copied from interface: SessionManagementService
      Callback method to call when a user disconnects from a web socket session.
      Parameters:
      sessionId - the STOMP session id
      Returns:
      the User entity if it was updated, null otherwise
    • isUserOnline

      public boolean isUserOnline(@NonNull UUID userId)
      Description copied from interface: SessionManagementService
      Returns if the user has any active session and so is considered as online.
      Parameters:
      userId - the user id
      Returns:
      true if online, false otherwise
    • getUserSessionCount

      public int getUserSessionCount(@NonNull UUID userId)
      Description copied from interface: SessionManagementService
      Returns the count of sessions for the provider user id
      Parameters:
      userId - the user id
      Returns:
      the session count