View Javadoc

1   package com.atlassian.messagequeue.internal.sqs;
2   
3   import com.atlassian.messagequeue.MessageRunnerKey;
4   
5   import java.util.Map;
6   import java.util.Set;
7   
8   import static java.util.Objects.requireNonNull;
9   
10  /**
11   * SQS config contains
12   * <ul>
13   * <li>{@link #outboundQueueNameMappings} map of {@link MessageRunnerKey} to {@link SQSProducerQueueConfig}</li>
14   * <li>{@link #inboundQueueMappings} map of worker group's name to {@link SQSConsumerQueueConfig}</li>
15   * <li>{@link #defaultQueueConfig} default {@link SQSProducerQueueConfig}</li>
16   * </ul>
17   */
18  public class SQSConfig {
19      private final Map<MessageRunnerKey, SQSProducerQueueConfig> outboundQueueNameMappings;
20      private final Map<String, Set<SQSConsumerQueueConfig>> inboundQueueMappings;
21      private final SQSProducerQueueConfig defaultQueueConfig;
22  
23      public SQSConfig(SQSProducerQueueConfig defaultQueueConfig, Map<MessageRunnerKey, SQSProducerQueueConfig> outboundQueueNameMappings, Map<String, Set<SQSConsumerQueueConfig>> inboundQueueMappings) {
24          this.defaultQueueConfig = requireNonNull(defaultQueueConfig);
25          this.outboundQueueNameMappings = requireNonNull(outboundQueueNameMappings);
26          this.inboundQueueMappings = requireNonNull(inboundQueueMappings);
27      }
28  
29      public Map<MessageRunnerKey, SQSProducerQueueConfig> getOutboundQueueNameMappings() {
30          return outboundQueueNameMappings;
31      }
32  
33      public Map<String, Set<SQSConsumerQueueConfig>> getInboundQueueMappings() {
34          return inboundQueueMappings;
35      }
36  
37      public SQSProducerQueueConfig getDefaultQueue() {
38          return defaultQueueConfig;
39      }
40  }