Package com.sequenceiq.cloudbreak.controller

Examples of com.sequenceiq.cloudbreak.controller.InternalServerException


        MDCBuilder.buildMdcContext(stack);
        AmbariClient ambariClient = createAmbariClient(ambariIp);
        try {
            String clusterJson = ambariClient.getClusterAsJson();
            if (clusterJson == null) {
                throw new InternalServerException(String.format("Cluster response coming from Ambari server was null. [Ambari Server IP: '%s']", ambariIp));
            }
            return clusterJson;
        } catch (HttpResponseException e) {
            if ("Not Found".equals(e.getMessage())) {
                throw new NotFoundException("Ambari blueprint not found.", e);
            } else {
                throw new InternalServerException("Something went wrong", e);
            }
        }
    }
View Full Code Here


                if (hostGroup.path("name").asText().equals(hostgroup)) {
                    return true;
                }
            }
        } catch (IOException e) {
            throw new InternalServerException("Unhandled exception occured while reading blueprint: " + e.getMessage(), e);
        }
        return false;
    }
View Full Code Here

    }

    private void waitForFinishing(AzureClient azureClient, String requestId) {
        boolean finished = azureClient.waitUntilComplete(requestId);
        if (!finished) {
            throw new InternalServerException("Azure resource timeout");
        }
    }
View Full Code Here

    }

    private void waitForFinishing(AzureClient azureClient, String requestId) {
        boolean finished = azureClient.waitUntilComplete(requestId);
        if (!finished) {
            throw new InternalServerException("Azure resource timeout");
        }
    }
View Full Code Here

        model.put("volumeCount", volumeCount);
        model.put("useSpot", spotPriced);
        try {
            return FreeMarkerTemplateUtils.processTemplateIntoString(freemarkerConfiguration.getTemplate(templatePath, "UTF-8"), model);
        } catch (IOException | TemplateException e) {
            throw new InternalServerException("Failed to process CloudFormation freemarker template", e);
        }
    }
View Full Code Here

        } catch (OptimisticLockException | OptimisticLockingFailureException e) {
            LOGGER.info("Failed to update stack status. [attempt: '{}', Cause: {}]. Trying to save it again.", attempt++, e.getClass().getSimpleName());
            if (attempt <= MAX_RETRIES) {
                return doUpdateStackStatus(stackId, status, statusReason);
            } else {
                throw new InternalServerException(String.format("Failed to update stack '%s' in 5 attempts. (while trying to update status)", stackId), e);
            }
        }
    }
View Full Code Here

        } catch (OptimisticLockException | OptimisticLockingFailureException e) {
            LOGGER.info("Failed to update stack status. [attempt: '{}', Cause: {}]. Trying to save it again.", attempt++, e.getClass().getSimpleName());
            if (attempt <= MAX_RETRIES) {
                return doUpdateStackStatusReason(stackId, statusReason);
            } else {
                throw new InternalServerException(String.format("Failed to update stack '%s' in 5 attempts. (while trying to update status)", stackId), e);
            }
        }
    }
View Full Code Here

        } catch (OptimisticLockException | OptimisticLockingFailureException e) {
            LOGGER.info("Failed to update stack status. [attempt: '{}', Cause: {}]. Trying to save it again.", attempt++, e.getClass().getSimpleName());
            if (attempt <= MAX_RETRIES) {
                return doUpdateMetaData(stackId, instanceMetaData);
            } else {
                throw new InternalServerException(String.format("Failed to update stack '%s' in 5 attempts. (while trying to update metadata)", stackId), e);
            }
        }
    }
View Full Code Here

        } catch (OptimisticLockException | OptimisticLockingFailureException e) {
            LOGGER.info("Failed to update stack resources. [attempt: '{}', Cause: {}]. Trying to save it again.", attempt++, e.getClass().getSimpleName());
            if (attempt <= MAX_RETRIES) {
                return doUpdateResources(stackId, resources);
            } else {
                throw new InternalServerException(String.format("Failed to update stack '%s' in 5 attempts. (while trying to update resources)", stackId), e);
            }
        }
    }
View Full Code Here

        } catch (OptimisticLockException | OptimisticLockingFailureException e) {
            LOGGER.info("Failed to update stack's Ambari IP. [attempt: '{}', Cause: {}]. Trying to save it again.", attempt++, e.getClass().getSimpleName());
            if (attempt <= MAX_RETRIES) {
                return doUpdateAmbariIp(stackId, ambariIp);
            } else {
                throw new InternalServerException(String.format("Failed to update stack '%s' in 5 attempts. (while trying to update ambariIp)", stackId), e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.controller.InternalServerException

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.