All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.dynamodbv2.streams.connectors.DynamoDBStreamsConnectorConfiguration Maven / Gradle / Ivy

Go to download

The DynamoDB Cross-Region Replication library allows you to replicate DynamoDB tables in real-time with Streams.

There is a newer version: 1.2.1.19
Show newest version
/*
 * Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * SPDX-License-Identifier: Apache-2.0
 */
package com.amazonaws.services.dynamodbv2.streams.connectors;

import java.util.List;
import java.util.Map;
import java.util.Properties;

import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.services.kinesis.connectors.KinesisConnectorConfiguration;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;

/**
 * This class contains constants used to configure the DynamoDB Streams Connector. The user should use System properties
 * to set their proper configuration. An instance of DynamoDBStreamsConnectorConfiguration is created with System
 * properties and an AWSCredentialsProvider.
 */
public class DynamoDBStreamsConnectorConfiguration extends KinesisConnectorConfiguration {

    /**
     * Default cross region replication map of region to tables, containing a single default region and single default
     * test table.
     */
    public static final Map> DEFAULT_DYNAMODB_REGIONS_TO_TABLES =
            ImmutableMap.>of(DEFAULT_REGION_NAME, Lists.newArrayList(DEFAULT_DYNAMODB_DATA_TABLE_NAME));

    private final boolean publishCloudWatch;

    /**
     * Constructor for the DynamoDBStreamsConnectorConfiguration class.
     *
     * @param properties
     *            The system properties passed in.
     * @param credentialsProvider
     *            The AWS credentialsProvider
     * @param publishCloudWatch
     *            Publish cloudWatch or not
     */
    public DynamoDBStreamsConnectorConfiguration(final Properties properties,
        final AWSCredentialsProvider credentialsProvider, final boolean publishCloudWatch) {
        super(properties, credentialsProvider);
        this.publishCloudWatch = publishCloudWatch;
    }

    public DynamoDBStreamsConnectorConfiguration(final Properties properties,
                                                 final AWSCredentialsProvider credentialsProvider) {
        this(properties, credentialsProvider, false);
    }

    public boolean isPublishCloudWatch() {
        return publishCloudWatch;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy