001package com.nimbusds.infinispan.persistence.dynamodb.config;
002
003
004import com.amazonaws.regions.Regions;
005import com.codahale.metrics.MetricRegistry;
006import org.infinispan.configuration.cache.StoreConfigurationChildBuilder;
007
008import java.util.Set;
009
010
011/**
012 * DynamoDB store configuration child builder.
013 */
014public interface DynamoDBStoreConfigurationChildBuilder<S> extends StoreConfigurationChildBuilder<S> {
015        
016        
017        /**
018         * Sets the DynamoDB endpoint.
019         *
020         * @param endpoint The endpoint, {@code null} if not specified.
021         *
022         * @return The builder.
023         */
024        DynamoDBStoreConfigurationChildBuilder endpoint(final String endpoint);
025        
026        
027        /**
028         * Sets the DynamoDB region.
029         *
030         * @param region The region, {@code null} if not specified.
031         *
032         * @return The builder.
033         */
034        DynamoDBStoreConfigurationChildBuilder region(final Regions region);
035        
036        
037        /**
038         * Sets the class for transforming between Infinispan entries (key /
039         * value pair and optional metadata) and a corresponding DynamoDB item.
040         *
041         * @param itemTransformerClass The item transformer class. Must not
042         *                             be {@code null}.
043         *
044         * @return The builder.
045         */
046        DynamoDBStoreConfigurationChildBuilder itemTransformerClass(final Class itemTransformerClass);
047        
048        
049        /**
050         * Sets the optional class for executing direct queries against
051         * DynamoDB. If set {@link #indexedAttributes} must also be specified.
052         *
053         * @param queryExecutorClass The query executor class, {@code null} if
054         *                           not required.
055         *
056         * @return The builder.
057         */
058        DynamoDBStoreConfigurationChildBuilder queryExecutorClass(final Class queryExecutorClass);
059        
060        
061        /**
062         * Sets the optional indexed DynamoDB table attributes. If set
063         * {@link #queryExecutorClass} must also be specified.
064         *
065         * @param indexAttributes The indexed attributes, {@code null} if not
066         *                        required.
067         *
068         * @return The builder.
069         */
070        DynamoDBStoreConfigurationChildBuilder indexedAttributes(final Set<String> indexAttributes);
071        
072        
073        
074        /**
075         * Sets the consistent read flag.
076         *
077         * @param enable {@code true} for consistent reads, {@code false} for
078         *               eventually consistent.
079         *
080         * @return The builder.
081         */
082        DynamoDBStoreConfigurationChildBuilder consistentReads(final boolean enable);
083        
084        
085        /**
086         * Sets the read capacity to provision when creating a new DynamoDB
087         * table.
088         *
089         * @param readCapacity The read capacity. Must be equal or larger than
090         *                     one.
091         *
092         * @return The builder.
093         */
094        DynamoDBStoreConfigurationChildBuilder readCapacity(final long readCapacity);
095        
096        
097        /**
098         * Sets the write capacity to provision when creating a new DynamoDB
099         * table.
100         *
101         * @param writeCapacity The write capacity. Must be equal or larger
102         *                      than one.
103         *
104         * @return The builder.
105         */
106        DynamoDBStoreConfigurationChildBuilder writeCapacity(final long writeCapacity);
107        
108        
109        /**
110         * Sets the DynamoDB table encryption at rest.
111         *
112         * @param encryptionAtRest {@code true} to create the DynamoDB table
113         *                         with encryption at rest, {@code false} with
114         *                         no encryption.
115         *
116         * @return The builder.
117         */
118        DynamoDBStoreConfigurationChildBuilder tableWithEncryptionAtRest(final boolean encryptionAtRest);
119        
120        
121        /**
122         * Sets the DynamoDB table prefix.
123         *
124         * @param tablePrefix The table prefix, {@code null} if not specified.
125         *
126         * @return The builder.
127         */
128        DynamoDBStoreConfigurationChildBuilder tablePrefix(final String tablePrefix);
129
130        
131        /**
132         * Sets an explicit metric registry to use (other than singleton
133         * {@link com.nimbusds.common.monitor.MonitorRegistries}).
134         *
135         * @param metricRegistry The metric registry to use.
136         *
137         * @return The builder.
138         */
139        DynamoDBStoreConfigurationChildBuilder metricRegistry(final MetricRegistry metricRegistry);
140        
141        
142        /**
143         * Sets the name of the optional range key to apply to all DynamoDB
144         * operations.
145         *
146         * @param rangeKeyName The range key name, {@code null} if not
147         *                     specified.
148         *
149         * @return The builder.
150         */
151        DynamoDBStoreConfigurationChildBuilder applyRangeKey(final String rangeKeyName);
152        
153        
154        /**
155         * Sets the value of the optional range key.
156         *
157         * @param rangeKeyValue The range key value, {@code null} if not
158         *                      specified.
159         *
160         * @return The builder.
161         */
162        DynamoDBStoreConfigurationChildBuilder rangeKeyValue(final String rangeKeyValue);
163        
164        
165        /**
166         * Sets the enable stream flag.
167         *
168         * @param enable {@code true} to enable a stream for a global table,
169         *               {@code false} for a regular table.
170         *
171         * @return The builder.
172         */
173        DynamoDBStoreConfigurationChildBuilder enableStream(final boolean enable);
174        
175        
176        /**
177         * Sets the enable continuous backups / point in time recovery.
178         *
179         * @param enable {@code true} to enable continuous backups,
180         *               {@code false} without.
181         *
182         * @return The builder.
183         */
184        DynamoDBStoreConfigurationChildBuilder enableContinuousBackups(final boolean enable);
185        
186        
187        /**
188         * Sets the enable DynamoDB item expiration.
189         *
190         * @param enable {@code true} to enable item expiration, {@code false}
191         *               without.
192         *
193         * @return The builder.
194         */
195        DynamoDBStoreConfigurationChildBuilder enableTTL(final boolean enable);
196        
197        
198        /**
199         * Sets the limit of expired entries to purge during a run of the
200         * expired entry reaper task.
201         *
202         * @param purgeLimit The purge limit, -1 for no limit.
203         *
204         * @return The builder.
205         */
206        DynamoDBStoreConfigurationChildBuilder purgeLimit(final int purgeLimit);
207        
208        
209        /**
210         * Sets the HTTP proxy host.
211         *
212         * @param host The host, {@code null} if none.
213         *
214         * @return The builder.
215         */
216        DynamoDBStoreConfigurationChildBuilder httpProxyHost(final String host);
217        
218        
219        /**
220         * Sets the HTTP proxy port.
221         *
222         * @param port The port, -1 if none.
223         *
224         * @return The builder.
225         */
226        DynamoDBStoreConfigurationChildBuilder httpProxyPort(final int port);
227        
228        
229        /**
230         * Sets the HMAC SHA-256 key.
231         *
232         * @param key The HMAC SHA-256 key, {@code null} if none.
233         *
234         * @return The builder.
235         */
236        DynamoDBStoreConfigurationChildBuilder hmacSHA256Key(final String key);
237}