本文整理汇总了Java中com.hazelcast.config.AwsConfig.setHostHeader方法的典型用法代码示例。如果您正苦于以下问题:Java AwsConfig.setHostHeader方法的具体用法?Java AwsConfig.setHostHeader怎么用?Java AwsConfig.setHostHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.config.AwsConfig
的用法示例。
在下文中一共展示了AwsConfig.setHostHeader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAwsConfig
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
private AwsConfig getAwsConfig() throws IllegalArgumentException {
final AwsConfig config = new AwsConfig()
.setEnabled(true)
.setSecurityGroupName(getOrNull(SECURITY_GROUP_NAME))
.setTagKey(getOrNull(TAG_KEY))
.setTagValue(getOrNull(TAG_VALUE))
.setIamRole(getOrNull(IAM_ROLE));
String property = getOrNull(ACCESS_KEY);
if (property != null) {
config.setAccessKey(property);
}
property = getOrNull(SECRET_KEY);
if (property != null) {
config.setSecretKey(property);
}
final Integer timeout = getOrDefault(CONNECTION_TIMEOUT_SECONDS.getDefinition(), 10);
config.setConnectionTimeoutSeconds(timeout);
final String region = getOrNull(REGION);
if (region != null) {
config.setRegion(region);
}
final String hostHeader = getOrNull(HOST_HEADER);
if (hostHeader != null) {
config.setHostHeader(hostHeader);
}
reviewConfiguration(config);
return config;
}
示例2: testAwsClient_withDifferentHostHeader
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testAwsClient_withDifferentHostHeader() {
AwsConfig awsConfig = new AwsConfig();
awsConfig.setIamRole("test");
awsConfig.setHostHeader("ec2.amazonaws.com.cn");
awsConfig.setRegion("cn-north-1");
AWSClient awsClient = new AWSClient(awsConfig);
assertEquals("ec2.cn-north-1.amazonaws.com.cn", awsClient.getEndpoint());
}
示例3: testAwsClient_withInvalidHostHeader
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test(expected = InvalidConfigurationException.class)
public void testAwsClient_withInvalidHostHeader() {
AwsConfig awsConfig = new AwsConfig();
awsConfig.setIamRole("test");
awsConfig.setHostHeader("ec3.amazonaws.com.cn");
new AWSClient(awsConfig);
}