com.hazelcast.config
Class AwsConfig

java.lang.Object
  extended by com.hazelcast.config.AwsConfig
Direct Known Subclasses:
ClientAwsConfig

public class AwsConfig
extends Object

The AWSConfig contains the configuration for AWS join mechanism.

what happens behind the scenes is that data about the running AWS instances in a specific region are downloaded using the accesskey/secretkey and are potential Hazelcast members.

Filtering

There are 2 mechanisms for filtering out AWS instances and these mechanisms can be combined (AND).
  1. If a securityGroup is configured only instanced within that security group are selected.
  2. If a tag key/value is set only instances with that tag key/value will be selected.

Once Hazelcast has figured out which instances are available, it will use the private ip addresses of these instances to create a tcp/ip-cluster.


Constructor Summary
AwsConfig()
           
 
Method Summary
 String getAccessKey()
          Gets the access key to access AWS.
 int getConnectionTimeoutSeconds()
          Gets the connection timeout in seconds.
 String getHostHeader()
          Gets the host header; the address the EC2 API can be found.
 String getRegion()
          Gets the region where the EC2 instances running the Hazelcast members will be running.
 String getSecretKey()
          Gets the secret key to access AWS.
 String getSecurityGroupName()
          Gets the security group name.
 String getTagKey()
          Gets the tag key; if nothing is specified null is returned.
 String getTagValue()
          Gets the tag value.
 boolean isEnabled()
          Checks if the aws join mechanism is enabled.
 AwsConfig setAccessKey(String accessKey)
          Sets the access key to access AWS.
 AwsConfig setConnectionTimeoutSeconds(int connectionTimeoutSeconds)
          Sets the connect timeout in seconds.
 AwsConfig setEnabled(boolean enabled)
          Enables or disables the aws join mechanism.
 AwsConfig setHostHeader(String hostHeader)
          Sets the host header; the address the EC2 API can be found.
 AwsConfig setRegion(String region)
          Sets the region where the EC2 instances running the Hazelcast members will be running.
 AwsConfig setSecretKey(String secretKey)
          Sets the secret key to access AWS.
 AwsConfig setSecurityGroupName(String securityGroupName)
          Sets the security group name.
 AwsConfig setTagKey(String tagKey)
          Sets the tag key.
 AwsConfig setTagValue(String tagValue)
          Sets the tag value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AwsConfig

public AwsConfig()
Method Detail

getAccessKey

public String getAccessKey()
Gets the access key to access AWS. Returns null if no access key is configured.

Returns:
the access key.
See Also:
setAccessKey(String)

setAccessKey

public AwsConfig setAccessKey(String accessKey)
Sets the access key to access AWS.

Parameters:
accessKey - the access key.
Returns:
the updated AwsConfig.
Throws:
IllegalArgumentException - if accessKey is null or empty.
See Also:
getAccessKey(), setSecretKey(String)

getSecretKey

public String getSecretKey()
Gets the secret key to access AWS. Returns null if no access key is configured.

Returns:
the secret key.
See Also:
setSecretKey(String)

setSecretKey

public AwsConfig setSecretKey(String secretKey)
Sets the secret key to access AWS.

Parameters:
secretKey - the secret key
Returns:
the updated AwsConfig.
See Also:
getSecretKey(), setAccessKey(String)

getRegion

public String getRegion()
Gets the region where the EC2 instances running the Hazelcast members will be running.

Returns:
the region
See Also:
setRegion(String)

setRegion

public AwsConfig setRegion(String region)
Sets the region where the EC2 instances running the Hazelcast members will be running.

Parameters:
region - the region
Returns:
the updated AwsConfig
Throws:
IllegalArgumentException - if region is null or empty.

getHostHeader

public String getHostHeader()
Gets the host header; the address the EC2 API can be found.

Returns:
the host header.

setHostHeader

public AwsConfig setHostHeader(String hostHeader)
Sets the host header; the address the EC2 API can be found.

Parameters:
hostHeader - the new host header
Returns:
the updated AwsConfig
Throws:
IllegalArgumentException - if hostHeader is null or an empty string.

setEnabled

public AwsConfig setEnabled(boolean enabled)
Enables or disables the aws join mechanism.

Parameters:
enabled - true if enabled, false otherwise.
Returns:
the updated AwsConfig.

isEnabled

public boolean isEnabled()
Checks if the aws join mechanism is enabled.

Returns:
true if enabled, false otherwise.

setSecurityGroupName

public AwsConfig setSecurityGroupName(String securityGroupName)
Sets the security group name. See the filtering section for more information.

Parameters:
securityGroupName - the security group name.
Returns:
the updated AwsConfig.
See Also:
getSecurityGroupName()

getSecurityGroupName

public String getSecurityGroupName()
Gets the security group name. If nothing has been configured, null is returned.

Returns:
the security group name

setTagKey

public AwsConfig setTagKey(String tagKey)
Sets the tag key. See the filtering section for more information.

Parameters:
tagKey - the tag key.
Returns:
the updated AwsConfig.
See Also:
setTagKey(String)

setTagValue

public AwsConfig setTagValue(String tagValue)
Sets the tag value. see the filtering section for more information.

Parameters:
tagValue - the tag value.
Returns:
the updated AwsConfig.
See Also:
setTagKey(String), getTagValue()

getTagKey

public String getTagKey()
Gets the tag key; if nothing is specified null is returned.

Returns:
the tag key.

getTagValue

public String getTagValue()
Gets the tag value. If nothing is specified null is returned.

Returns:
the tag value.

getConnectionTimeoutSeconds

public int getConnectionTimeoutSeconds()
Gets the connection timeout in seconds.

Returns:
the connectionTimeoutSeconds
See Also:
setConnectionTimeoutSeconds(int)

setConnectionTimeoutSeconds

public AwsConfig setConnectionTimeoutSeconds(int connectionTimeoutSeconds)
Sets the connect timeout in seconds. See TcpIpConfig.setConnectionTimeoutSeconds(int) for more information.

Parameters:
connectionTimeoutSeconds - the connectionTimeoutSeconds to set
Returns:
the updated AwsConfig.
See Also:
getConnectionTimeoutSeconds(), TcpIpConfig.setConnectionTimeoutSeconds(int)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.