Exemplo n.º 1
0
 private bool handleProtocolException(OAuthProtocolException pe, int attempts)
 {
     if (pe.canExtend)
     {
         accessorInfo.setTokenExpireMillis(ACCESS_TOKEN_FORCE_EXPIRE);
     }
     else if (pe.startFromScratch)
     {
         fetcherConfig.getTokenStore().removeToken(realRequest.getSecurityToken(),
                                                   accessorInfo.getConsumer(), realRequest.getOAuthArguments(), responseParams);
         accessorInfo.getAccessor().accessToken  = null;
         accessorInfo.getAccessor().requestToken = null;
         accessorInfo.getAccessor().TokenSecret  = null;
         accessorInfo.setSessionHandle(null);
         accessorInfo.setTokenExpireMillis(ACCESS_TOKEN_EXPIRE_UNKNOWN);
     }
     return(attempts < MAX_ATTEMPTS && pe.canRetry);
 }
Exemplo n.º 2
0
 private bool handleProtocolException(OAuthProtocolException pe, int attempts)
 {
     if (pe.canExtend)
     {
         accessorInfo.setTokenExpireMillis(ACCESS_TOKEN_FORCE_EXPIRE);
     }
     else if (pe.startFromScratch)
     {
         fetcherConfig.getTokenStore().removeToken(realRequest.getSecurityToken(),
             accessorInfo.getConsumer(), realRequest.getOAuthArguments(), responseParams);
         accessorInfo.getAccessor().accessToken = null;
         accessorInfo.getAccessor().requestToken = null;
         accessorInfo.getAccessor().TokenSecret = null;
         accessorInfo.setSessionHandle(null);
         accessorInfo.setTokenExpireMillis(ACCESS_TOKEN_EXPIRE_UNKNOWN);
     }
     return (attempts < MAX_ATTEMPTS && pe.canRetry);
 }