|
Spring Social | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.web.filter.GenericFilterBean
org.springframework.social.connect.web.ReconnectFilter
public class ReconnectFilter
Servlet filter that intercepts Spring Social ApiExceptions thrown in the course of a request and attempts to reconcile any connection-related
problems by deleting the stale/revoked connection and walking the user through the connection process to obtain a new connection.
This filter handles the exceptions via the following flow:
ConnectController to kick of the authorization flow.
| Constructor Summary | |
|---|---|
ReconnectFilter(UsersConnectionRepository usersConnectionRepository,
UserIdSource userIdSource)
Creates an instance of ReconnectFilter. |
|
| Method Summary | |
|---|---|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
protected java.lang.String |
getRefreshUrl(javax.servlet.http.HttpServletRequest request,
ApiException apiException)
Returns the URL to redirect to if it is determined that a connection needs to be renewed. |
protected boolean |
shouldPerformRefreshPostRequest(javax.servlet.http.HttpServletRequest request)
Determines whether or not the handled request should be converted to a POST request to ConnectController for authorization. |
| Methods inherited from class org.springframework.web.filter.GenericFilterBean |
|---|
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReconnectFilter(UsersConnectionRepository usersConnectionRepository,
UserIdSource userIdSource)
ReconnectFilter.
usersConnectionRepository - a UsersConnectionRepository used to create a ConnectionRepository for the current user.userIdSource - an instance of UserIdSource to obtain the current user's ID used to create a ConnectionFactory.| Method Detail |
|---|
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
protected java.lang.String getRefreshUrl(javax.servlet.http.HttpServletRequest request,
ApiException apiException)
ConnectController for authorization.
May be overridden by a subclass to handle other flows, such as redirecting to a page that informs the user that a new connection is needed.
request - The HTTP request that triggered the exception.apiException - The ApiException.
protected boolean shouldPerformRefreshPostRequest(javax.servlet.http.HttpServletRequest request)
ConnectController for authorization.
By default, will return true if the request is a GET request for /connect/{provider ID} and there is a "reconnect" query parameter.
May be overridden by a subclass to consider other criteria in deciding whether or not to convert the request.
request - the handled request.
ConnectController.
|
Spring Social | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||