Package com.hazelcast.config

Examples of com.hazelcast.config.AwsConfig


    private boolean preferIPv4Stack() {
        boolean preferIPv4Stack = Boolean.getBoolean("java.net.preferIPv4Stack")
                || node.groupProperties.PREFER_IPv4_STACK.getBoolean();
        // AWS does not support IPv6.
        JoinConfig join = node.getConfig().getNetworkConfig().getJoin();
        AwsConfig awsConfig = join.getAwsConfig();
        boolean awsEnabled = awsConfig != null && awsConfig.isEnabled();
        return preferIPv4Stack || awsEnabled;
    }
View Full Code Here


    final ILogger logger;

    public TcpIpJoinerOverAWS(Node node) {
        super(node);
        logger = node.getLogger(getClass());
        AwsConfig awsConfig = node.getConfig().getNetworkConfig().getJoin().getAwsConfig();
        aws = new AWSClient(awsConfig);
        if (awsConfig.getRegion() != null && awsConfig.getRegion().length() > 0) {
            aws.setEndpoint("ec2." + awsConfig.getRegion() + ".amazonaws.com");
        }
    }
View Full Code Here

        }
    }

    @Override
    protected int getConnTimeoutSeconds() {
        AwsConfig awsConfig = node.getConfig().getNetworkConfig().getJoin().getAwsConfig();
        return awsConfig.getConnectionTimeoutSeconds();
    }
View Full Code Here

    private boolean preferIPv4Stack() {
        boolean preferIPv4Stack = Boolean.getBoolean("java.net.preferIPv4Stack")
                || node.groupProperties.PREFER_IPv4_STACK.getBoolean();
        // AWS does not support IPv6.
        JoinConfig join = node.getConfig().getNetworkConfig().getJoin();
        AwsConfig awsConfig = join.getAwsConfig();
        boolean awsEnabled = awsConfig != null && awsConfig.isEnabled();
        return preferIPv4Stack || awsEnabled;
    }
View Full Code Here

        final List<String> members = tcp.getMembers();
        assertEquals(members.toString(), 2, members.size());
        assertEquals("127.0.0.1:5700", members.get(0));
        assertEquals("127.0.0.1:5701", members.get(1));
        assertEquals("127.0.0.1:5700", tcp.getRequiredMember());
        AwsConfig aws = networkConfig.getJoin().getAwsConfig();
        assertFalse(aws.isEnabled());
        assertEquals("sample-access-key", aws.getAccessKey());
        assertEquals("sample-secret-key", aws.getSecretKey());
        assertEquals("sample-region", aws.getRegion());
        assertEquals("sample-group", aws.getSecurityGroupName());
        assertEquals("sample-tag-key", aws.getTagKey());
        assertEquals("sample-tag-value", aws.getTagValue());

        assertTrue("reuse-address", networkConfig.isReuseAddress());
    }
View Full Code Here

    final ILogger logger;

    public TcpIpJoinerOverAWS(Node node) {
        super(node);
        logger = node.getLogger(getClass());
        AwsConfig awsConfig = node.getConfig().getNetworkConfig().getJoin().getAwsConfig();
        aws = new AWSClient(awsConfig);
        if (awsConfig.getRegion() != null && awsConfig.getRegion().length() > 0) {
            aws.setEndpoint("ec2." + awsConfig.getRegion() + ".amazonaws.com");
        }
    }
View Full Code Here

        }
    }

    @Override
    protected int getConnTimeoutSeconds() {
        AwsConfig awsConfig = node.getConfig().getNetworkConfig().getJoin().getAwsConfig();
        return awsConfig.getConnectionTimeoutSeconds();
    }
View Full Code Here

            "</DescribeInstancesResponse>";

    @Test
    public void testNoTags() throws IOException {
        InputStream is = new ByteArrayInputStream(xml.getBytes());
        AwsConfig awsConfig = new AwsConfig();
        awsConfig.setAccessKey("some-access-key");
        awsConfig.setSecretKey("some-secret-key");
        awsConfig.setSecurityGroupName("hazelcast");
        final Map<String, String> result = CloudyUtility.unmarshalTheResponse(is, awsConfig);
        assertEquals(2, result.size());
    }
View Full Code Here

    }

    @Test
    public void testTagsBothNodeHave() throws IOException {
        InputStream is = new ByteArrayInputStream(xml.getBytes());
        AwsConfig awsConfig = new AwsConfig();
        awsConfig.setAccessKey("some-access-key");
        awsConfig.setSecretKey("some-secret-key");
        awsConfig.setSecurityGroupName("hazelcast");
        awsConfig.setTagKey("Name1");
        awsConfig.setTagValue("value1");
        final Map<String, String> result = CloudyUtility.unmarshalTheResponse(is, awsConfig);
        assertEquals(2, result.size());
    }
View Full Code Here

    }

    @Test
    public void testTagOnlyOneNodeHave() throws IOException {
        InputStream is = new ByteArrayInputStream(xml.getBytes());
        AwsConfig awsConfig = new AwsConfig();
        awsConfig.setAccessKey("some-access-key");
        awsConfig.setSecretKey("some-secret-key");
        awsConfig.setSecurityGroupName("hazelcast");
        awsConfig.setTagKey("name");
        awsConfig.setTagValue("");
        final Map<String, String> result = CloudyUtility.unmarshalTheResponse(is, awsConfig);
        assertEquals(1, result.size());
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.config.AwsConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.