Class SnsConnectorCommonConfiguration
- java.lang.Object
-
- io.smallrye.reactive.messaging.aws.sns.SnsConnectorCommonConfiguration
-
- Direct Known Subclasses:
SnsConnectorIncomingConfiguration
,SnsConnectorOutgoingConfiguration
public class SnsConnectorCommonConfiguration extends Object
Extracts the common configuration for thesmallrye-aws-sns
connector.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.microprofile.config.Config
config
-
Constructor Summary
Constructors Constructor Description SnsConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config)
Creates a new SnsConnectorCommonConfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.microprofile.config.Config
config()
String
getChannel()
protected <T> Optional<T>
getFromAlias(String alias, Class<T> type)
Retrieves the value stored for the given alias.protected <T> T
getFromAliasWithDefaultValue(String alias, Class<T> type, T defaultValue)
Retrieves the value stored for the given alias.Boolean
getMockSnsTopics()
Gets the mock-sns-topics value from the configuration.String
getSnsUrl()
Gets the sns-url value from the configuration.Optional<String>
getTopic()
Gets the topic value from the configuration.void
validate()
-
-
-
Method Detail
-
config
public org.eclipse.microprofile.config.Config config()
- Returns:
- the connector configuration
-
getFromAlias
protected <T> Optional<T> getFromAlias(String alias, Class<T> type)
Retrieves the value stored for the given alias.- Type Parameters:
T
- the targeted type- Parameters:
alias
- the attribute alias, must not benull
or blanktype
- the targeted type- Returns:
- the configuration value for the given alias, empty if not set
-
getFromAliasWithDefaultValue
protected <T> T getFromAliasWithDefaultValue(String alias, Class<T> type, T defaultValue)
Retrieves the value stored for the given alias. Returns the default value if not present.- Type Parameters:
T
- the targeted type- Parameters:
alias
- the attribute alias, must not benull
or blanktype
- the targeted typedefaultValue
- the default value- Returns:
- the configuration value for the given alias, empty if not set
-
getChannel
public String getChannel()
- Returns:
- the channel name
-
getTopic
public Optional<String> getTopic()
Gets the topic value from the configuration. Attribute Name: topic Description: The SNS topic. If not set, the channel name is used.- Returns:
- the topic
-
getSnsUrl
public String getSnsUrl()
Gets the sns-url value from the configuration. Attribute Name: sns-url Description: Set the Amazon SNS subscription url. It can be set to a local URL for testing. MicroProfile Config Alias: sns-url Mandatory: yes- Returns:
- the sns-url
-
getMockSnsTopics
public Boolean getMockSnsTopics()
Gets the mock-sns-topics value from the configuration. Attribute Name: mock-sns-topics Description: Indicates to the connector to use mock/fake topics. _For testing only_ MicroProfile Config Alias: sns-mock-topics Default Value: false- Returns:
- the mock-sns-topics
-
validate
public void validate()
-
-