Merge branch 'master' into feature_enable_push_in_deployment_view
Conflicts: hawkbit-core/src/main/java/org/eclipse/hawkbit/eventbus/event/TargetDeletedEvent.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleMetadatadetailslayout.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java Signed-off-by: Gaurav <gaurav.sahay@in.bosch.com>
This commit is contained in:
@@ -27,43 +27,84 @@ import org.eclipse.hawkbit.repository.model.EntityInterceptor;
|
||||
*/
|
||||
public class EntityInterceptorListener {
|
||||
|
||||
/**
|
||||
* Callback for lifecyle event <i>pre persist</i>.
|
||||
*
|
||||
* @param entity
|
||||
* the JPA entity which this listener is associated with
|
||||
*/
|
||||
@PrePersist
|
||||
protected void prePersist(final Object entity) {
|
||||
public void prePersist(final Object entity) {
|
||||
notifyAll(interceptor -> interceptor.prePersist(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for lifecyle event <i>post persist</i>.
|
||||
*
|
||||
* @param entity
|
||||
* the JPA entity which this listener is associated with
|
||||
*/
|
||||
@PostPersist
|
||||
protected void postPersist(final Object entity) {
|
||||
public void postPersist(final Object entity) {
|
||||
notifyAll(interceptor -> interceptor.postPersist(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for lifecyle event <i>post remove</i>.
|
||||
*
|
||||
* @param entity
|
||||
* the JPA entity which this listener is associated with
|
||||
*/
|
||||
@PostRemove
|
||||
protected void postRemove(final Object entity) {
|
||||
public void postRemove(final Object entity) {
|
||||
notifyAll(interceptor -> interceptor.postRemove(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for lifecyle event <i>pre remove</i>.
|
||||
*
|
||||
* @param entity
|
||||
* the JPA entity which this listener is associated with
|
||||
*/
|
||||
@PreRemove
|
||||
protected void preRemove(final Object entity) {
|
||||
public void preRemove(final Object entity) {
|
||||
notifyAll(interceptor -> interceptor.preRemove(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for lifecyle event <i>post load</i>.
|
||||
*
|
||||
* @param entity
|
||||
* the JPA entity which this listener is associated with
|
||||
*/
|
||||
@PostLoad
|
||||
protected void postLoad(final Object entity) {
|
||||
public void postLoad(final Object entity) {
|
||||
notifyAll(interceptor -> interceptor.postLoad(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for lifecyle event <i>pre update</i>.
|
||||
*
|
||||
* @param entity
|
||||
* the JPA entity which this listener is associated with
|
||||
*/
|
||||
@PreUpdate
|
||||
protected void preUpdate(final Object entity) {
|
||||
public void preUpdate(final Object entity) {
|
||||
notifyAll(interceptor -> interceptor.preUpdate(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for lifecyle event <i>post update</i>.
|
||||
*
|
||||
* @param entity
|
||||
* the JPA entity which this listener is associated with
|
||||
*/
|
||||
@PostUpdate
|
||||
protected void postUpdate(final Object entity) {
|
||||
public void postUpdate(final Object entity) {
|
||||
notifyAll(interceptor -> interceptor.postUpdate(entity));
|
||||
}
|
||||
|
||||
private void notifyAll(final Consumer<? super EntityInterceptor> action) {
|
||||
private static void notifyAll(final Consumer<? super EntityInterceptor> action) {
|
||||
EntityInterceptorHolder.getInstance().getEntityInterceptors().forEach(action);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user