本文整理汇总了Java中com.hazelcast.config.AwsConfig.setAccessKey方法的典型用法代码示例。如果您正苦于以下问题:Java AwsConfig.setAccessKey方法的具体用法?Java AwsConfig.setAccessKey怎么用?Java AwsConfig.setAccessKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.config.AwsConfig
的用法示例。
在下文中一共展示了AwsConfig.setAccessKey方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIamRole
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testIamRole() throws IOException {
String s = "{\n"
+ " \"Code\" : \"Success\",\n"
+ " \"LastUpdated\" : \"2015-09-06T21:17:26Z\",\n"
+ " \"Type\" : \"AWS-HMAC\",\n"
+ " \"AccessKeyId\" : \"ASIAIEXAMPLEOXYDA\",\n"
+ " \"SecretAccessKey\" : \"hOCVge3EXAMPLExSJ+B\",\n"
+ " \"Token\" : \"AQoDYXdzEE4EXAMPLE2UGAFshkTsyw7gojLdiEXAMPLE+1SfSRTfLR\",\n"
+ " \"Expiration\" : \"2015-09-07T03:19:56Z\"\n}";
StringReader sr = new StringReader(s);
BufferedReader br = new BufferedReader(sr);
AwsConfig awsConfig1 = new AwsConfig();
awsConfig1.setAccessKey("some-access-key");
awsConfig1.setSecretKey("some-secret-key");
awsConfig1.setSecurityGroupName("hazelcast");
DescribeInstances describeInstances = new DescribeInstances(awsConfig, "");
Map map = describeInstances.parseIamRole(br);
assertEquals("Success", map.get("Code"));
assertEquals("2015-09-06T21:17:26Z", map.get("LastUpdated"));
assertEquals("AWS-HMAC", map.get("Type"));
assertEquals("ASIAIEXAMPLEOXYDA", map.get("AccessKeyId"));
assertEquals("hOCVge3EXAMPLExSJ+B", map.get("SecretAccessKey"));
assertEquals("AQoDYXdzEE4EXAMPLE2UGAFshkTsyw7gojLdiEXAMPLE+1SfSRTfLR", map.get("Token"));
}
示例2: 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;
}
示例3: setup
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Before
public void setup() {
awsConfig = new AwsConfig();
awsConfig.setAccessKey("some-access-key");
awsConfig.setSecretKey("some-secret-key");
awsConfig.setSecurityGroupName("hazelcast");
}
示例4: testUnmarshalling
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testUnmarshalling() throws IOException {
InputStream is = new ByteArrayInputStream(xml.getBytes());
AwsConfig awsConfig1 = new AwsConfig();
awsConfig1.setAccessKey("some-access-key");
awsConfig1.setSecretKey("some-secret-key");
Map<String, String> result = CloudyUtility.unmarshalTheResponse(is);
assertEquals(2, result.size());
}
示例5: test_whenAccessKeyExistsInConfig
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void test_whenAccessKeyExistsInConfig() throws IOException {
AwsConfig awsConfig = new AwsConfig();
awsConfig.setAccessKey("accesskey");
awsConfig.setSecretKey("secretkey");
new DescribeInstances(awsConfig, "endpoint");
}
示例6: setNetworkJoin
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
private void setNetworkJoin(JoinConfig join) {
join.getMulticastConfig().setEnabled(false);
AwsConfig aws = join.getAwsConfig();
aws.setEnabled(false);
aws.setAccessKey("AKIAIA2GXRFAH4OTZN4A");
aws.setSecretKey("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");
setTcpIpConfig(join.getTcpIpConfig());
}
示例7: testNoTags
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testNoTags() throws IOException {
InputStream is = new ByteArrayInputStream(xml.getBytes());
AwsConfig awsConfig = new AwsConfig();
awsConfig.setAccessKey("");
awsConfig.setSecretKey("");
awsConfig.setSecurityGroupName("hazelcast");
List<String> result = (List<String>) CloudyUtility.unmarshalTheResponse(is, awsConfig);
assertEquals(2, result.size());
}
示例8: testTagsBothNodeHave
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testTagsBothNodeHave() throws IOException {
InputStream is = new ByteArrayInputStream(xml.getBytes());
AwsConfig awsConfig = new AwsConfig();
awsConfig.setAccessKey("");
awsConfig.setSecretKey("");
awsConfig.setSecurityGroupName("hazelcast");
awsConfig.setTagKey("Name1");
awsConfig.setTagValue("value1");
List<String> result = (List<String>) CloudyUtility.unmarshalTheResponse(is, awsConfig);
assertEquals(2, result.size());
}
示例9: testTagOnlyOneNodeHave
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testTagOnlyOneNodeHave() throws IOException {
InputStream is = new ByteArrayInputStream(xml.getBytes());
AwsConfig awsConfig = new AwsConfig();
awsConfig.setAccessKey("");
awsConfig.setSecretKey("");
awsConfig.setSecurityGroupName("hazelcast");
awsConfig.setTagKey("name");
awsConfig.setTagValue("");
List<String> result = (List<String>) CloudyUtility.unmarshalTheResponse(is, awsConfig);
assertEquals(1, result.size());
}