Class VaadinSessionNotificationEventPublisher
java.lang.Object
io.jmix.notificationsflowui.event.VaadinSessionNotificationEventPublisher
- All Implemented Interfaces:
UserSessionNotifier,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Component("ntf_VaadinSessionNotificationEventPublisher")
public class VaadinSessionNotificationEventPublisher
extends Object
implements UserSessionNotifier, org.springframework.context.ApplicationContextAware
Allows to notify active Vaadin sessions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected final SystemAuthenticator -
Constructor Summary
ConstructorsConstructorDescriptionVaadinSessionNotificationEventPublisher(SystemAuthenticator systemAuthenticator) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetUsernameFromVaadinSession(com.vaadin.flow.server.VaadinSession session) voidNotifies all active sessionsvoidnotifyUserSession(String username) Notifies session (if active) of specific userprotected voidonSessionAccess(com.vaadin.flow.server.VaadinSession session, VaadinSessionNotificationEvent event) voidonSessionInitialized(io.jmix.notificationsflowui.event.NotificationsServiceInitListener.SessionInitializedEvent event) HandlesNotificationsServiceInitListener.SessionInitializedEventto collect new active Vaadin sessions.protected voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
systemAuthenticator
-
-
Constructor Details
-
VaadinSessionNotificationEventPublisher
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
onSessionInitialized
@EventListener public void onSessionInitialized(io.jmix.notificationsflowui.event.NotificationsServiceInitListener.SessionInitializedEvent event) HandlesNotificationsServiceInitListener.SessionInitializedEventto collect new active Vaadin sessions.- Parameters:
event- session initialized event
-
notifyUserSession
Description copied from interface:UserSessionNotifierNotifies session (if active) of specific user- Specified by:
notifyUserSessionin interfaceUserSessionNotifier- Parameters:
username- username
-
notifyAllUserSessions
public void notifyAllUserSessions()Description copied from interface:UserSessionNotifierNotifies all active sessions- Specified by:
notifyAllUserSessionsin interfaceUserSessionNotifier
-
publishEvent
-
onSessionAccess
protected void onSessionAccess(com.vaadin.flow.server.VaadinSession session, VaadinSessionNotificationEvent event) -
getUsernameFromVaadinSession
@Nullable protected String getUsernameFromVaadinSession(com.vaadin.flow.server.VaadinSession session)
-