Package org.fluxtream.core.connectors.updaters

Examples of org.fluxtream.core.connectors.updaters.AuthExpiredException


                if (feed.has("stat")) {
                String stat = feed.getString("stat");
                if (stat.equalsIgnoreCase("fail")) {
                    String message = feed.getString("message");
                    if (message.indexOf("Invalid auth token")!=-1) {
                        throw new AuthExpiredException();
                    } else
                        throw new UpdateFailedException("Could not retrieve flickr recently updated photos: " + message,
                                                        true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                }
View Full Code Here


                throw new RateLimitReachedException();
            }
        } catch (EDAMUserException e) {
            // if the auth token expired, we have no other choice than to have the user re-authenticate
            if (e.getErrorCode()==EDAMErrorCode.AUTH_EXPIRED) {
                throw new AuthExpiredException();
            }
        }
    }
View Full Code Here

            }
        } catch (Throwable t) {
            // just ignore any potential problems here
        }
        if (statusCode==401)
            throw new AuthExpiredException();
        if (statusCode>=400&&statusCode<500) {
            throw new UpdateFailedException("Unexpected response code: " + statusCode, new Exception(), true,
                                            ApiKey.PermanentFailReason.clientError(statusCode, message));
        } else
            throw new UpdateFailedException("Unexpected response code: " + statusCode);
View Full Code Here

    } else {
            final String reasonPhrase = response.getStatusLine().getReasonPhrase();
            countFailedApiCall(updateInfo.apiKey, updateInfo.objectTypes, then, requestUrl, reasonPhrase,
                               statusCode, reasonPhrase);
            if (statusCode==401)
                throw new AuthExpiredException();
            else if (statusCode>=400&&statusCode<500)
                throw new UpdateFailedException("Unexpected response code " + statusCode, new Exception(), true,
                                                ApiKey.PermanentFailReason.clientError(statusCode, reasonPhrase));
            throw new UpdateFailedException(new Exception());
    }
View Full Code Here

                        reasonPhrase + " httpCode=" + response.getStatusLine().getStatusCode());
      countFailedApiCall(updateInfo.apiKey,
          updateInfo.objectTypes, then, requestUrl, reasonPhrase,
                    statusCode, reasonPhrase);
            if (statusCode==401)
                throw new AuthExpiredException();
            else if (statusCode>=400&&statusCode<500)
                throw new UpdateFailedException("Unexpected response code " + statusCode, new Exception(), true,
                                                ApiKey.PermanentFailReason.clientError(statusCode, reasonPhrase));
            throw new UpdateFailedException(new Exception());
    }
View Full Code Here

    } else {
            final String reasonPhrase = response.getStatusLine().getReasonPhrase();
            countFailedApiCall(updateInfo.apiKey, updateInfo.objectTypes, then, requestUrl, reasonPhrase,
                               statusCode, reasonPhrase);
            if (statusCode==401)
                throw new AuthExpiredException();
            else if (statusCode>=400&&statusCode<500)
                throw new UpdateFailedException("Unexpected response code " + statusCode, new Exception(), true,
                                                ApiKey.PermanentFailReason.clientError(statusCode, reasonPhrase));
            throw new UpdateFailedException(new Exception());
    }
View Full Code Here

            final String reasonPhrase = response.getStatusLine().getReasonPhrase();
            countFailedApiCall(updateInfo.apiKey,
                               updateInfo.objectTypes, then, requestUrl, reasonPhrase,
                               statusCode, reasonPhrase);
            if (statusCode==401)
                throw new AuthExpiredException();
            else if (statusCode>=400&&statusCode<500)
                throw new UpdateFailedException("Unexpected response code " + statusCode, new Exception(), true,
                                                ApiKey.PermanentFailReason.clientError(statusCode, reasonPhrase));
            throw new UpdateFailedException(new Exception());
    }
View Full Code Here

                        message = "247 : The userid provided is absent, or incorrect";
                        throw new UpdateFailedException(message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 250:
                        // 250 : The provided userid and/or Oauth credentials do not match
                        throw new AuthExpiredException();
                    case 286:
                        message = "286 : No such subscription was found";
                        throw new UpdateFailedException(message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 293:
View Full Code Here

TOP

Related Classes of org.fluxtream.core.connectors.updaters.AuthExpiredException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.