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
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected final SystemAuthenticator
-
Constructor Summary
ConstructorDescriptionVaadinSessionNotificationEventPublisher
(SystemAuthenticator systemAuthenticator) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getUsernameFromVaadinSession
(com.vaadin.flow.server.VaadinSession session) void
Notifies all active sessionsvoid
notifyUserSession
(String username) Notifies session (if active) of specific userprotected void
onSessionAccess
(com.vaadin.flow.server.VaadinSession session, VaadinSessionNotificationEvent event) void
onSessionInitialized
(io.jmix.notificationsflowui.event.NotificationsServiceInitListener.SessionInitializedEvent event) HandlesNotificationsServiceInitListener.SessionInitializedEvent
to collect new active Vaadin sessions.protected void
void
setApplicationContext
(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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
onSessionInitialized
@EventListener public void onSessionInitialized(io.jmix.notificationsflowui.event.NotificationsServiceInitListener.SessionInitializedEvent event) HandlesNotificationsServiceInitListener.SessionInitializedEvent
to collect new active Vaadin sessions.- Parameters:
event
- session initialized event
-
notifyUserSession
Description copied from interface:UserSessionNotifier
Notifies session (if active) of specific user- Specified by:
notifyUserSession
in interfaceUserSessionNotifier
- Parameters:
username
- username
-
notifyAllUserSessions
public void notifyAllUserSessions()Description copied from interface:UserSessionNotifier
Notifies all active sessions- Specified by:
notifyAllUserSessions
in 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)
-