com.veriplace.web.spring
Class LocationDiscoveryInterceptor

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

public class LocationDiscoveryInterceptor
extends VeriplaceInterceptor

An Interceptor that does not allow requests to proceed until the current user's location is available from Veriplace.


Field Summary
 
Fields inherited from class com.veriplace.web.spring.VeriplaceInterceptor
veriplace
 
Constructor Summary
LocationDiscoveryInterceptor()
           
 
Method Summary
 java.lang.String getLocationAttributeName()
          See setLocationAttributeName(String).
 java.lang.String getLocationMode()
          See setLocationMode(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.
 void setLocationAttributeName(java.lang.String locationAttributeName)
          Specifies that when location discovery has been successfully completed on a request, the Location object should be stored in the request as an attribute with this name.
 void setLocationMode(java.lang.String locationMode)
          Specifies the method or degree of accuracy for obtaining location.
 
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

LocationDiscoveryInterceptor

public LocationDiscoveryInterceptor()
Method Detail

getLocationAttributeName

public java.lang.String getLocationAttributeName()
See setLocationAttributeName(String).


setLocationAttributeName

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


getLocationMode

public java.lang.String getLocationMode()
See setLocationMode(String).


setLocationMode

public void setLocationMode(java.lang.String locationMode)
Specifies the method or degree of accuracy for obtaining location. The names of allowable modes are defined in LocationMode.


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