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 Summary
ConstructorsConstructorDescriptionExternalBrokerSessionManagementService(org.springframework.messaging.simp.user.SimpUserRegistry userRegistry, UserRepository userRepository) -
Method Summary
Modifier and TypeMethodDescriptionintgetUserSessionCount(UUID userId) Returns the count of sessions for the provider user idbooleanisUserOnline(UUID userId) Returns if the user has any active session and so is considered as online.onSessionCreated(String sessionId, WebSocketUser user) Callback method to call when a user connects to a web socket session.onSessionDestroyed(String sessionId) Callback method to call when a user disconnects from a web socket session.Methods inherited from class com.finconsgroup.itserr.marketplace.usercommunication.dm.service.impl.AbstractSessionManagementService
updateUserOnlineStatus
-
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:SessionManagementServiceCallback method to call when a user connects to a web socket session.- Parameters:
sessionId- the STOMP session iduser- the connected user- Returns:
- the
Userentity 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:SessionManagementServiceCallback method to call when a user disconnects from a web socket session.- Parameters:
sessionId- the STOMP session id- Returns:
- the
Userentity if it was updated, null otherwise
-
isUserOnline
Description copied from interface:SessionManagementServiceReturns if the user has any active session and so is considered as online.- Parameters:
userId- the user id- Returns:
trueif online,falseotherwise
-
getUserSessionCount
Description copied from interface:SessionManagementServiceReturns the count of sessions for the provider user id- Parameters:
userId- the user id- Returns:
- the session count
-