当前位置: 首页>>代码示例>>Java>>正文


Java AwsConfig.setSecretKey方法代码示例

本文整理汇总了Java中com.hazelcast.config.AwsConfig.setSecretKey方法的典型用法代码示例。如果您正苦于以下问题:Java AwsConfig.setSecretKey方法的具体用法?Java AwsConfig.setSecretKey怎么用?Java AwsConfig.setSecretKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hazelcast.config.AwsConfig的用法示例。


在下文中一共展示了AwsConfig.setSecretKey方法的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"));
}
 
开发者ID:hazelcast,项目名称:hazelcast-aws,代码行数:27,代码来源:CloudyUtilityTest.java

示例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;
}
 
开发者ID:hazelcast,项目名称:hazelcast-aws,代码行数:35,代码来源:AwsDiscoveryStrategy.java

示例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");
}
 
开发者ID:hazelcast,项目名称:hazelcast-aws,代码行数:8,代码来源:CloudyUtilityTest.java

示例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());
}
 
开发者ID:hazelcast,项目名称:hazelcast-aws,代码行数:11,代码来源:CloudyUtilityTest.java

示例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");
}
 
开发者ID:hazelcast,项目名称:hazelcast-aws,代码行数:8,代码来源:DescribeInstancesTest.java

示例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());
}
 
开发者ID:eetlite,项目名称:eet.osslite.cz,代码行数:11,代码来源:HazelcastConfiguration.java

示例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());
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:11,代码来源:CloudyUtilityTest.java

示例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());
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:13,代码来源:CloudyUtilityTest.java

示例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());
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:13,代码来源:CloudyUtilityTest.java


注:本文中的com.hazelcast.config.AwsConfig.setSecretKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。