本文整理汇总了Java中com.amazonaws.services.elasticbeanstalk.model.CheckDNSAvailabilityResult.isAvailable方法的典型用法代码示例。如果您正苦于以下问题:Java CheckDNSAvailabilityResult.isAvailable方法的具体用法?Java CheckDNSAvailabilityResult.isAvailable怎么用?Java CheckDNSAvailabilityResult.isAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.elasticbeanstalk.model.CheckDNSAvailabilityResult
的用法示例。
在下文中一共展示了CheckDNSAvailabilityResult.isAvailable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEnvironment
import com.amazonaws.services.elasticbeanstalk.model.CheckDNSAvailabilityResult; //导入方法依赖的package包/类
public void createEnvironment(String applicationName, String domainName, String envName, String stackName) {
CreateEnvironmentRequest cr = new CreateEnvironmentRequest();
cr.setApplicationName(applicationName);
cr.setEnvironmentName(envName);
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!");
}
}
示例2: createEnvironmentWithWar
import com.amazonaws.services.elasticbeanstalk.model.CheckDNSAvailabilityResult; //导入方法依赖的package包/类
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);
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;
}
示例3: execute
import com.amazonaws.services.elasticbeanstalk.model.CheckDNSAvailabilityResult; //导入方法依赖的package包/类
public void execute() {
checkParams();
AWSElasticBeanstalkClient client = getOrCreateClient(AWSElasticBeanstalkClient.class);
CreateEnvironmentRequest eRequest = new CreateEnvironmentRequest(
applicationName, environmentName)
.withDescription(environmentDescription)
.withVersionLabel(versionLabel)
.withSolutionStackName(solutionStackName);
if (!(tierName == null || tierType == null || tierVersion == null)) {
eRequest.setTier(new EnvironmentTier().withName(tierName)
.withType(tierType).withVersion(tierVersion));
}
if (cnamePrefix != null) {
CheckDNSAvailabilityResult dnsResult = client
.checkDNSAvailability(new CheckDNSAvailabilityRequest(
cnamePrefix));
if (!dnsResult.isAvailable()) {
throw new BuildException("The specified CNAME " + cnamePrefix
+ " was not available");
}
eRequest.setCNAMEPrefix(cnamePrefix);
}
List<ConfigurationOptionSetting> optionSettings = new LinkedList<ConfigurationOptionSetting>();
for (Setting setting : settings) {
optionSettings.add(new ConfigurationOptionSetting(setting
.getNamespace(), setting.getOptionName(), setting
.getValue()));
}
if (optionSettings.size() > 0) {
eRequest.setOptionSettings(optionSettings);
}
System.out.println("Creating environment " + environmentName + "...");
String cNAME = "";
try {
CreateEnvironmentResult result = client.createEnvironment(eRequest);
if ((cNAME = result.getCNAME()) == null) {
System.out
.println("Create environment request submitted. The environment configuration does not support a CNAME.");
} else {
System.out
.println("Create environment request submitted. When the environment is finished launching, your deployment will be available at "
+ cNAME);
}
} catch (Exception e) {
throw new BuildException(
"Exception while attempting to create environment: "
+ e.getMessage(), e);
}
}