public class UserEventListener
extends org.exoplatform.container.component.BaseComponentPlugin
<configuration> [..] <external-component-plugins> <target-component>org.exoplatform.services.organization.OrganizationService</target-component> <component-plugin> <name>my.user.listener</name> <set-method>addListenerPlugin</set-method> <type>my.package.MyUserEventListener</type> <description>your listener description</description> </component-plugin> </external-component-plugins> [...] /configuration>
Constructor and Description |
---|
UserEventListener() |
Modifier and Type | Method and Description |
---|---|
void |
postDelete(User user)
This method should be called after the user has been removed from the
database but not committed yet.
|
void |
postSave(User user,
boolean isNew)
This method is called after the user has been saved but not committed yet
|
void |
postSetEnabled(User user)
This method is called after enabling/disabling a user.
|
void |
preDelete(User user)
This method is called before an user should be deleted
|
void |
preSave(User user,
boolean isNew)
This method is called before the user is persisted to the database.
|
void |
preSetEnabled(User user)
This method is called before enabling/disabling a user.
|
public void preSave(User user, boolean isNew) throws Exception
user
- The user to be savedisNew
- if the user is a new record in the database or notException
- The developer can decide to throw an exception or not. If
the listener throw an exception, the organization service should
not save/update the user to the databasepublic void postSave(User user, boolean isNew) throws Exception
user
- The user instance has been saved.isNew
- if the user is a new record in the database or notException
- The developer can decide to throw the exception or not.
If the method throw an exception. The organization service should
role back the data to the state before the method
userHandler.createUser(..) or UserHandler.saveUser(..) is called.public void preDelete(User user) throws Exception
user
- the user to be deleteException
- The developer can decide to throw the exception or not.
If the method throw an exception. The organization service should
not remove the user record from the database.public void postDelete(User user) throws Exception
user
- The user instance which has been removed from the database.Exception
- The developer can decide to throw the exception or not.
If the method throw the exception, the organization service
should role back the database to the state before the method
UserHandler.removeUser(..) is called.public void preSetEnabled(User user) throws Exception
User.isEnabled()
on the provided user objectuser
- the user to be enable/disableException
- The developer can decide to throw the exception or not.
If the method throw an exception. The organization service should
not enable/disable the user.public void postSetEnabled(User user) throws Exception
User.isEnabled()
on the provided user objectuser
- The user instance which has been enabled/disabled.Exception
- The developer can decide to throw the exception or not.
If the method throw the exception, the organization service
should role back the database to the state before the method
UserHandler#setEnabled(User, boolean, boolean)
is called.Copyright © 2003-2018 eXo Platform SAS. All Rights Reserved.