Package com.sequenceiq.cloudbreak.controller

Examples of com.sequenceiq.cloudbreak.controller.InternalServerException


                                    Boolean delete = false;
                                    try {
                                        delete = instanceResourceBuilders.get(cloudPlatform).get(index).delete(resource, dCO);
                                    } catch (HttpResponseException ex) {
                                        LOGGER.error(String.format("Error occurred on stack under the instance remove"), ex);
                                        throw new InternalServerException(
                                                String.format("Error occurred while removing instance '%s' on stack. Message: '%s'",
                                                instanceId, ex.getResponse().toString()), ex);
                                    } catch (Exception ex) {
                                        throw new InternalServerException(
                                                String.format("Error occurred while removing instance '%s' on stack. Message: '%s'",
                                                instanceId, ex.getMessage()), ex);
                                    }
                                    return delete;
                                }
View Full Code Here


            final FileOutputStream os = new FileOutputStream(getUserCerFileName(azureCredential, emailAsFolder));
            os.write(Base64.encodeBase64(certificate.getEncoded(), true));
            os.close();
        } catch (Exception e) {
            LOGGER.error(e.getMessage(), e);
            throw new InternalServerException("There was a problem with the certificate generation", e);
        }
    }
View Full Code Here

                bw.write(sshKey);
                bw.close();
                keyGeneratorService.generateSshKey(getSshFolderForTemplate(emailAsFolder, azureCredential.getId()) + "/" + emailAsFolder);
            } catch (InterruptedException e) {
                LOGGER.error("An error occured under the ssh generation for {} template. The error was: {} {}", azureCredential.getId(), e.getMessage(), e);
                throw new InternalServerException(e.getMessage());
            }
        } catch (IOException ex) {
            LOGGER.error("An error occured under the ssh folder generation: {} {}", ex.getMessage(), ex);
            throw new InternalServerException("There was a problem with the ssh key generation", ex);
        }
    }
View Full Code Here

    }

    protected void httpResponseExceptionHandler(HttpResponseException ex, String resourceName, String user, Stack stack) {
        MDCBuilder.buildMdcContext(stack);
        if (ex.getStatusCode() != NOT_FOUND) {
            throw new InternalServerException(ex.getMessage());
        } else {
            LOGGER.error(String.format("Azure resource not found with %s name for %s user.", resourceName, user));
        }
    }
View Full Code Here

    }

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

    }

    protected void httpResponseExceptionHandler(HttpResponseException ex, String resourceName, String user, Stack stack) {
        MDCBuilder.buildMdcContext(stack);
        if (ex.getStatusCode() != NOT_FOUND) {
            throw new InternalServerException(ex.getMessage());
        } else {
            LOGGER.error(String.format("Azure resource not found with %s name for %s user.", resourceName, user));
        }
    }
View Full Code Here

    }

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

    protected void exceptionHandler(GoogleJsonResponseException ex, String name, Stack stack) {
        MDCBuilder.buildMdcContext(stack);
        if (ex.getDetails().get("code").equals(NOT_FOUND)) {
            LOGGER.info(String.format("Resource was delete with name: %s", name));
        } else {
            throw new InternalServerException(ex.getMessage());
        }
    }
View Full Code Here

    protected void exceptionHandler(GoogleJsonResponseException ex, String name, Stack stack) {
        MDCBuilder.buildMdcContext(stack);
        if (ex.getDetails().get("code").equals(NOT_FOUND)) {
            LOGGER.info(String.format("Resource was delete with name: %s", name));
        } else {
            throw new InternalServerException(ex.getMessage());
        }
    }
View Full Code Here

        }
    }

    @Override
    public void handleTimeout(AmbariClient t) {
        throw new InternalServerException(String.format("Operation timed out. Ambari server could not start %s", t.getAmbari().getUri()));
    }
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.