Examples of UpdateFailedException


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

                                                                                                                                                "oauth with the Withings API. Please head to <a href=\"javascript:App.manageConnectors()\">Manage Connectors</a>,<br>" +
                                                                                                                                                "scroll to the Withings connector, and renew your tokens (look for the <i class=\"icon-resize-small icon-large\"></i> icon)");
            // Record permanent failure since this connector won't work again until
            // it is reauthenticated
            guestService.setApiKeyStatus(updateInfo.apiKey.getId(), ApiKey.Status.STATUS_PERMANENT_FAILURE, null, ApiKey.PermanentFailReason.NEEDS_REAUTH);
            throw new UpdateFailedException("requires token reauthorization",true, ApiKey.PermanentFailReason.NEEDS_REAUTH);
        }

        final String userid = guestService.getApiKeyAttribute(updateInfo.apiKey, "userid");

        // do v1 API call
View Full Code Here

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

                                                                                                                                                "oauth with the Withings API. Please head to <a href=\"javascript:App.manageConnectors()\">Manage Connectors</a>,<br>" +
                                                                                                                                                "scroll to the Withings connector, and renew your tokens (look for the <i class=\"icon-resize-small icon-large\"></i> icon)");
            // Record permanent failure since this connector won't work again until
            // it is reauthenticated
            guestService.setApiKeyStatus(updateInfo.apiKey.getId(), ApiKey.Status.STATUS_PERMANENT_FAILURE, null, ApiKey.PermanentFailReason.NEEDS_REAUTH);
            throw new UpdateFailedException("requires token reauthorization",true, ApiKey.PermanentFailReason.NEEDS_REAUTH);
        }

        // do v1 API call
        String url = "http://wbsapi.withings.net/measure";
        Map<String,String> parameters = new HashMap<String,String>();
View Full Code Here

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

            final Token token = new Token(accessToken, guestService.getApiKeyAttribute(updateInfo.apiKey, "tokenSecret"));
            service.signRequest(token, request);
            Response response = request.send();
            httpResponseCode = response.getCode();
            if (httpResponseCode!=200)
                throw new UpdateFailedException("Unexpected response code: " + httpResponseCode);
            String json = response.getBody();
            JSONObject jsonObject = JSONObject.fromObject(json);
            final int withingsStatusCode = jsonObject.getInt("status");
            String message = null;
            if (withingsStatusCode !=0) {
                switch (withingsStatusCode) {
                    case 247:
                        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:
                        message = "293 : The callback URL is either absent or incorrect";
                        throw new UpdateFailedException(message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 294:
                        message = "294 : No such subscription could be deleted";
                        throw new UpdateFailedException(message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 304:
                        message = "304 : The comment is either absent or incorrect";
                        throw new UpdateFailedException(message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 305:
                        // 305: Too many notifications are already set
                        throw new RateLimitExceededException();
                    case 342:
                        message = "342 : The signature (using Oauth) is invalid";
                        throw new UpdateFailedException( message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 343:
                        message = "343 : Wrong Notification Callback Url don't exist";
                        throw new UpdateFailedException(message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 601:
                        // 601: Too Many Requests
                        throw new RateLimitReachedException();
                    case 2554:
                        message = "2554 : Wrong action or wrong webservice";
                        throw new UpdateFailedException(message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 2555:
                        message = "2555 : An unknown error occurred";
                        throw new UpdateFailedException(message, false,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    case 2556:
                        message = "2556 : Service is not defined";
                        throw new UpdateFailedException(message, true,
                                                        ApiKey.PermanentFailReason.unknownReason(message));
                    default:
                    throw new UnexpectedHttpResponseCodeException(withingsStatusCode, "Unexpected status code: " + withingsStatusCode);
                }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.domain.UpdateFailedException

            for (String step : steps) {
                if (result.hasDefined(step)) {
                    // Get the result for this step
                    final ModelNode stepResult = result.get(step);
                    final boolean isRolledBack = (stepResult.hasDefined(ROLLED_BACK) && stepResult.get(ROLLED_BACK).asBoolean());
                    final UpdateFailedException updateFailedException;
                    // Create the failure description
                    if (stepResult.hasDefined(ClientConstants.FAILURE_DESCRIPTION)) {
                        updateFailedException = new UpdateFailedException(stepResult.get(ClientConstants.FAILURE_DESCRIPTION).asString());
                    } else if (planResultNode.hasDefined(ClientConstants.FAILURE_DESCRIPTION)) {
                        updateFailedException = new UpdateFailedException(planResultNode.get(ClientConstants.FAILURE_DESCRIPTION).asString());
                    } else {
                        updateFailedException = new UpdateFailedException(ControllerClientMessages.MESSAGES.noFailureDetails());
                    }
                    final BasicDomainUpdateResult domainUpdateResult;
                    if (isDomainFailure) {
                        domainUpdateResult = new BasicDomainUpdateResult(updateFailedException, isRolledBack);
                    } else if (isHostFailure) {
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.domain.UpdateFailedException

        else if ("cancelled".equals(outcome)) {
            return createCancellationResponse();
        }
        else {
            String message = modelNode.hasDefined("failure-description") ? modelNode.get("failure-description").asString() : "No failure details provided";
            result = createFailureResponse(new UpdateFailedException(message));
        }
        if (modelNode.get("rolled-back").asBoolean(false)) {
            result = createRollbackResponse(result);
        }
        else if (modelNode.hasDefined("rollback-failure-description")) {
            String message = modelNode.get("rollback-failure-description").asString();
            result = createRollbackFailedResponse(result, new UpdateFailedException(message));
        }
        return result;
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.domain.UpdateFailedException

        else if ("cancelled".equals(outcome)) {
            return createCancellationResponse();
        }
        else {
            String message = modelNode.hasDefined("failure-description") ? modelNode.get("failure-description").asString() : MESSAGES.noFailureDetails();
            result = createFailureResponse(new UpdateFailedException(message));
        }
        if (modelNode.get("rolled-back").asBoolean(false)) {
            result = createRollbackResponse(result);
        }
        else if (modelNode.hasDefined("rollback-failure-description")) {
            String message = modelNode.get("rollback-failure-description").asString();
            result = createRollbackFailedResponse(result, new UpdateFailedException(message));
        }
        return result;
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.domain.UpdateFailedException

            for (String step : steps) {
                if (result.hasDefined(step)) {
                    // Get the result for this step
                    final ModelNode stepResult = result.get(step);
                    final boolean isRolledBack = (stepResult.hasDefined(ROLLED_BACK) && stepResult.get(ROLLED_BACK).asBoolean());
                    final UpdateFailedException updateFailedException;
                    // Create the failure description
                    if (stepResult.hasDefined(ClientConstants.FAILURE_DESCRIPTION)) {
                        updateFailedException = new UpdateFailedException(stepResult.get(ClientConstants.FAILURE_DESCRIPTION).toString());
                    } else if (planResultNode.hasDefined(ClientConstants.FAILURE_DESCRIPTION)) {
                        updateFailedException = new UpdateFailedException(planResultNode.get(ClientConstants.FAILURE_DESCRIPTION).toString());
                    } else {
                        updateFailedException = new UpdateFailedException(ControllerClientMessages.MESSAGES.noFailureDetails());
                    }
                    final BasicDomainUpdateResult domainUpdateResult;
                    if (isDomainFailure) {
                        domainUpdateResult = new BasicDomainUpdateResult(updateFailedException, isRolledBack);
                    } else if (isHostFailure) {
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.domain.UpdateFailedException

        else if ("cancelled".equals(outcome)) {
            return createCancellationResponse();
        }
        else {
            String message = modelNode.hasDefined("failure-description") ? modelNode.get("failure-description").toString() : MESSAGES.noFailureDetails();
            result = createFailureResponse(new UpdateFailedException(message));
        }
        if (modelNode.get("rolled-back").asBoolean(false)) {
            result = createRollbackResponse(result);
        }
        else if (modelNode.hasDefined("rollback-failure-description")) {
            String message = modelNode.get("rollback-failure-description").toString();
            result = createRollbackFailedResponse(result, new UpdateFailedException(message));
        }
        return result;
    }
View Full Code Here

Examples of org.jboss.as.model.UpdateFailedException

        /** {@inheritDoc} */
        public void handleFailure(Throwable cause, P param) {
            if(cause instanceof UpdateFailedException) {
                failure = (UpdateFailedException) cause;
            } else {
                failure = new UpdateFailedException(cause);
            }
        }
View Full Code Here

Examples of org.jboss.as.model.UpdateFailedException

     * {@inheritDoc}
     */
    protected void applyUpdate(LoggingSubsystemElement element) throws UpdateFailedException {
        final AbstractLoggerElement<?> logger = element.removeLogger(name);
        if (logger == null) {
            throw new UpdateFailedException(String.format("logger (%s) does not exist", name));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.