Example usage for com.amazonaws.services.elasticbeanstalk.model CreateEnvironmentResult toString

List of usage examples for com.amazonaws.services.elasticbeanstalk.model CreateEnvironmentResult toString

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticbeanstalk.model CreateEnvironmentResult toString.

Prototype

@Override
public String toString() 

Source Link

Document

Returns a string representation of this object.

Usage

From source file:org.cloudml.connectors.BeanstalkConnector.java

License:Open Source License

public void createEnvironment(String applicationName, String domainName, String envName, String stackName) {
    CreateEnvironmentRequest cr = new CreateEnvironmentRequest();
    cr.setApplicationName(applicationName);
    cr.setEnvironmentName(envName);//from   ww  w  .  j  a va  2 s  . com
    String stack = findSolutionStack(stackName);
    if (!stack.equals("")) {
        cr.setSolutionStackName(stack);
        CheckDNSAvailabilityResult r = checkDNS(domainName);
        if (r.isAvailable()) {
            cr.setCNAMEPrefix(domainName);
            CreateEnvironmentResult res = beanstalkClient.createEnvironment(cr);
            journal.log(Level.INFO, ">> Status of the environment creation: " + res.toString());
        } else {
            journal.log(Level.INFO, ">> Status of the environment creation: Domain Name already existing");
        }
    } else {
        journal.log(Level.INFO, ">> Status of the environment creation: This type of stack does not exist!");
    }
}

From source file:org.cloudml.connectors.BeanstalkConnector.java

License:Open Source License

public String createEnvironmentWithWar(String applicationName, String domainName, String envName,
        String stackName, int minRam, String warFile, String versionLabel) {
    String endPoint = "";
    prepareWar(new File(warFile), versionLabel, applicationName);
    CreateEnvironmentRequest cr = new CreateEnvironmentRequest();

    cr.setApplicationName(applicationName);
    cr.setEnvironmentName(envName);/* w w  w . j ava2s.  c o m*/
    cr.setVersionLabel(versionLabel);
    String stack = findSolutionStack(stackName);
    if (!stack.equals("")) {
        cr.setSolutionStackName(stack);
        CheckDNSAvailabilityResult r = checkDNS(domainName);
        if (r.isAvailable()) {
            cr.setCNAMEPrefix(domainName);
            CreateEnvironmentResult res = beanstalkClient.createEnvironment(cr);
            endPoint = res.getEndpointURL();
            journal.log(Level.INFO, ">> Status of the environment creation: " + res.toString());
        } else {
            journal.log(Level.INFO, ">> Status of the environment creation: Domain Name already existing");
        }
    } else {
        journal.log(Level.INFO, ">> Status of the environment creation: This type of stack does not exist!");
    }
    return endPoint;
}