com.veriplace.web.spring
Class UserDiscoveryInterceptor

java.lang.Object
  extended by org.springframework.web.servlet.handler.HandlerInterceptorAdapter
      extended by com.veriplace.web.spring.VeriplaceInterceptor
          extended by com.veriplace.web.spring.UserDiscoveryInterceptor
All Implemented Interfaces:
HandlerExceptionResolver, HandlerInterceptor

public class UserDiscoveryInterceptor
extends VeriplaceInterceptor

An Interceptor that does not allow requests to proceed until the current Veriplace user has been identified.


Field Summary
 
Fields inherited from class com.veriplace.web.spring.VeriplaceInterceptor
veriplace
 
Constructor Summary
UserDiscoveryInterceptor()
           
 
Method Summary
 java.lang.String getUserAttributeName()
          See setUserAttributeName(String).
protected  boolean handleInternal(VeriplaceState state, HttpServletRequest request, HttpServletResponse response)
          Override this method to do any necessary preprocessing of the request based on the corresponding VeriplaceState.
 boolean isInteractionAllowed()
          See setInteractionAllowed(boolean).
 void setInteractionAllowed(boolean interactionAllowed)
          Specifies whether Veriplace can redirect to a login page or otherwise interact with the user when we need to determine the current user.
 void setUserAttributeName(java.lang.String userAttributeName)
          Specifies that when user discovery has been successfully completed on a request, the User object should be stored in the request as an attribute with this name.
 
Methods inherited from class com.veriplace.web.spring.VeriplaceInterceptor
getVeriplace, getVeriplaceClient, postHandle, preHandle, resolveException, setVeriplace
 
Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserDiscoveryInterceptor

public UserDiscoveryInterceptor()
Method Detail

getUserAttributeName

public java.lang.String getUserAttributeName()
See setUserAttributeName(String).


setUserAttributeName

public void setUserAttributeName(java.lang.String userAttributeName)
Specifies that when user discovery has been successfully completed on a request, the User object should be stored in the request as an attribute with this name.


isInteractionAllowed

public boolean isInteractionAllowed()
See setInteractionAllowed(boolean).


setInteractionAllowed

public void setInteractionAllowed(boolean interactionAllowed)
Specifies whether Veriplace can redirect to a login page or otherwise interact with the user when we need to determine the current user. This is true by default; if false, then user discovery will fail unless the user is already logged in.


handleInternal

protected boolean handleInternal(VeriplaceState state,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
                          throws java.lang.Exception
Description copied from class: VeriplaceInterceptor
Override this method to do any necessary preprocessing of the request based on the corresponding VeriplaceState.

Overrides:
handleInternal in class VeriplaceInterceptor
Returns:
true if the request can be passed on to the regular handler; false if we have already handled the request (e.g. redirected it).
Throws:
java.lang.Exception