Class MapBasedSQSConfig
- java.lang.Object
-
- org.opennms.core.ipc.common.aws.sqs.MapBasedSQSConfig
-
- All Implemented Interfaces:
AmazonSQSConfig
- Direct Known Subclasses:
ManagedSQSConfig
public class MapBasedSQSConfig extends java.lang.Object implements AmazonSQSConfig
SQS configuration from a map of values. The associated keys are defined inAmazonSQSConstants
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_REGION
-
Constructor Summary
Constructors Constructor Description MapBasedSQSConfig()
MapBasedSQSConfig(java.util.Map<java.lang.String,java.lang.String> sqsConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccessKey()
AWS access key.protected static java.util.Map<java.lang.String,java.lang.String>
getConfigMapFromSystemProperties()
java.lang.String
getQueuePrefix()
Prefix to be added to all queues.com.amazonaws.regions.Regions
getRegion()
AWS region to use.AmazonSQSQueueConfig
getRpcQueueConfig()
Retrieves the queue configuration for queues used by the RPC API.java.lang.String
getSecretKey()
AWS secret key.AmazonSQSQueueConfig
getSinkQueueConfig()
Retrieves the queue configuration for queues used by the Sink API.boolean
hasStaticCredentials()
Convenience method that returnstrue
if both an access key and secret key have been set.boolean
isUseHttp()
Used to force the SQS client to use HTTP instead of HTTPS.java.lang.String
toString()
-
-
-
Method Detail
-
getConfigMapFromSystemProperties
protected static java.util.Map<java.lang.String,java.lang.String> getConfigMapFromSystemProperties()
-
getQueuePrefix
public java.lang.String getQueuePrefix()
Description copied from interface:AmazonSQSConfig
Prefix to be added to all queues. This can be used to differentiate between OpenNMS deployments in a single region.- Specified by:
getQueuePrefix
in interfaceAmazonSQSConfig
- Returns:
- the prefix, or null if no prefix should be used.
-
getRegion
public com.amazonaws.regions.Regions getRegion()
Description copied from interface:AmazonSQSConfig
AWS region to use.- Specified by:
getRegion
in interfaceAmazonSQSConfig
- Returns:
- the region, or null if the default region should be used.
-
hasStaticCredentials
public boolean hasStaticCredentials()
Description copied from interface:AmazonSQSConfig
Convenience method that returnstrue
if both an access key and secret key have been set.- Specified by:
hasStaticCredentials
in interfaceAmazonSQSConfig
- Returns:
true
if both an access key and secret key have been set,false
otherwise.
-
getAccessKey
public java.lang.String getAccessKey()
Description copied from interface:AmazonSQSConfig
AWS access key.- Specified by:
getAccessKey
in interfaceAmazonSQSConfig
- Returns:
- the key, or null if the client should be initialized without static credentials.
-
getSecretKey
public java.lang.String getSecretKey()
Description copied from interface:AmazonSQSConfig
AWS secret key.- Specified by:
getSecretKey
in interfaceAmazonSQSConfig
- Returns:
- the key, or null if the client should be initialized without static credentials.
-
isUseHttp
public boolean isUseHttp()
Description copied from interface:AmazonSQSConfig
Used to force the SQS client to use HTTP instead of HTTPS. This can be used for testing, making it easier to intercept the messages sent over the wire.- Specified by:
isUseHttp
in interfaceAmazonSQSConfig
- Returns:
true
if HTTP should be used insetad of HTTPS,false
otherwise.
-
getSinkQueueConfig
public AmazonSQSQueueConfig getSinkQueueConfig()
Description copied from interface:AmazonSQSConfig
Retrieves the queue configuration for queues used by the Sink API.- Specified by:
getSinkQueueConfig
in interfaceAmazonSQSConfig
- Returns:
- the queue configuration
-
getRpcQueueConfig
public AmazonSQSQueueConfig getRpcQueueConfig()
Description copied from interface:AmazonSQSConfig
Retrieves the queue configuration for queues used by the RPC API.- Specified by:
getRpcQueueConfig
in interfaceAmazonSQSConfig
- Returns:
- the queue configuration
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-