public class LogonChangeListener<U extends User> extends Object implements ChangeListener<Object[]>
AdminUser's #lastLogInDate or #lastLogOutDate properties
when the UserService is notified of EVENT_LOGIN and EVENT_LOGOUT .
ChangeListener is:
EVENT_LOGIN, EVENT_LOGOUTUser objectgetDao(ChangeGenerator),
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static String |
EVENT_LOGIN |
static String |
EVENT_LOGOUT |
| Constructor and Description |
|---|
LogonChangeListener() |
| Modifier and Type | Method and Description |
|---|---|
protected UserDao<U> |
getDao(ChangeGenerator generator) |
void |
onChange(ChangeGenerator generator,
Object[] event)
|
protected void |
onChange(ChangeGenerator generator,
String eventName,
U user)
Override this method for any further customizations
By default simply passes on the AdminUser.getLastLogInDate() and AdminUser.getLastLogOutDate()
to the persisted entity. |
public static final String EVENT_LOGIN
public static final String EVENT_LOGOUT
public void onChange(ChangeGenerator generator, Object[] event)
AdminUser,
then the user is loaded up using UserDao, #lastLogInDate or #lastLogOutDate are updated
and then saved.onChange in interface ChangeListener<Object[]>generator - as the generator that caused the change. Specially useful if the Listener is subscribing to multiple ChangeGeneratorsevent - as the model change communicatedprotected UserDao<U> getDao(ChangeGenerator generator)
ChangeGenerator is UserServiceImplprotected void onChange(ChangeGenerator generator, String eventName, U user)
AdminUser.getLastLogInDate() and AdminUser.getLastLogOutDate()
to the persisted entity.generator - as ChangeGeneratoreventName - as Stringuser - as User type Copyright © 2018. All rights reserved.