Package org.openbravo.service
Class UserCtxCacheObserver
- java.lang.Object
-
- org.openbravo.client.kernel.event.EntityPersistenceEventObserver
-
- org.openbravo.service.UserCtxCacheObserver
-
public class UserCtxCacheObserver extends EntityPersistenceEventObserver
Observers events in entities that affectUserContextCache
to invalidate it. These entities are that can modify access settings such as anyone implementingInheritedAccessEnabled
and the ones defining user/roles.
-
-
Constructor Summary
Constructors Constructor Description UserCtxCacheObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Entity[]
getObservedEntities()
Must be implemented by subclass to signal whichEntity
types are observed.void
invalidateCacheOnAnyValidEvent(EntityPersistenceEvent event)
InvalidatesUserContextCache
if any entity affecting permissions is modified.protected boolean
isValidEvent(EntityPersistenceEvent event)
Convenience method which can be used by subclass to check if a certain event is indeed targeted for this observer.
-
-
-
Method Detail
-
invalidateCacheOnAnyValidEvent
public void invalidateCacheOnAnyValidEvent(@Observes EntityPersistenceEvent event)
InvalidatesUserContextCache
if any entity affecting permissions is modified.
-
getObservedEntities
protected Entity[] getObservedEntities()
Description copied from class:EntityPersistenceEventObserver
Must be implemented by subclass to signal whichEntity
types are observed.- Specified by:
getObservedEntities
in classEntityPersistenceEventObserver
- Returns:
- the array of entity instances to observe.
- See Also:
EntityPersistenceEventObserver.isValidEvent(EntityPersistenceEvent)
-
isValidEvent
protected boolean isValidEvent(EntityPersistenceEvent event)
Description copied from class:EntityPersistenceEventObserver
Convenience method which can be used by subclass to check if a certain event is indeed targeted for this observer.- Overrides:
isValidEvent
in classEntityPersistenceEventObserver
- Parameters:
event
- the persistence event which is being handled by this observer.- Returns:
- true if the event applies to one of the observed entities.
- See Also:
EntityPersistenceEventObserver.getObservedEntities()
-
-