ImpersonatedUserHolder (interface)

Used by the framework’s default implementation of UserService to allow the current user to be temporarily impersonated.

The intention is that viewers provide an implementation of this service.. Note that the Wicket viewer does implement this service and uses an HttpSession ; this will have the side-effect

API

ImpersonatedUserHolder.java
interface ImpersonatedUserHolder {
  boolean supportsImpersonation()     (1)
  void setUserMemento(final UserMemento userMemento)     (2)
  Optional<UserMemento> getUserMemento()
  void clearUserMemento()
}
1 supportsImpersonation()

Whether or not this implementation supports impersonation.

2 setUserMemento(UserMemento)

Sets the user memento to be impersonated.

Members

supportsImpersonation()

Whether or not this implementation supports impersonation.

If it does not , then #setUserMemento(UserMemento) is expected/required to throw an exception. throw

setUserMemento(UserMemento)

Sets the user memento to be impersonated.