Example usage for com.amazonaws.services.elasticbeanstalk.model CheckDNSAvailabilityResult isAvailable

List of usage examples for com.amazonaws.services.elasticbeanstalk.model CheckDNSAvailabilityResult isAvailable

Introduction

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

Prototype


public Boolean isAvailable() 

Source Link

Document

Indicates if the specified CNAME is available:

  • true : The CNAME is available.

    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);// w  w w.java2 s. c  o m
        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);//from   ww  w.  j a  v  a2s  .  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;
    }