Java 类com.amazonaws.services.kinesis.AmazonKinesisClientBuilder 实例源码

项目:konker-platform    文件:EventPublisherAmazonKinesis.java   
public com.amazonaws.services.kinesis.AmazonKinesis build(AmazonKinesis kinesisProperties) {

            com.amazonaws.services.kinesis.AmazonKinesisClientBuilder clientBuilder = com.amazonaws.services.kinesis.AmazonKinesisClientBuilder.standard();

            clientBuilder.setRegion(kinesisProperties.getRegion());
            clientBuilder.setCredentials(new AWSCredentialsProvider() {
                @Override
                public AWSCredentials getCredentials() {
                    return new BasicAWSCredentials(kinesisProperties.getKey(), kinesisProperties.getSecret());
                }
                @Override
                public void refresh() {
                }
            });
            clientBuilder.setClientConfiguration(new ClientConfiguration());

            return clientBuilder.build();
        }
项目:flink    文件:AWSUtil.java   
/**
 * Creates an AmazonKinesis client.
 * @param configProps configuration properties containing the access key, secret key, and region
 * @return a new AmazonKinesis client
 */
public static AmazonKinesis createKinesisClient(Properties configProps) {
    // set a Flink-specific user agent
    ClientConfiguration awsClientConfig = new ClientConfigurationFactory().getConfig()
            .withUserAgentPrefix(String.format(USER_AGENT_FORMAT,
                                                    EnvironmentInformation.getVersion(),
                                                    EnvironmentInformation.getRevisionInformation().commitId));

    // utilize automatic refreshment of credentials by directly passing the AWSCredentialsProvider
    AmazonKinesisClientBuilder builder = AmazonKinesisClientBuilder.standard()
            .withCredentials(AWSUtil.getCredentialsProvider(configProps))
            .withClientConfiguration(awsClientConfig)
            .withRegion(Regions.fromName(configProps.getProperty(AWSConfigConstants.AWS_REGION)));

    if (configProps.containsKey(AWSConfigConstants.AWS_ENDPOINT)) {
        // Set signingRegion as null, to facilitate mocking Kinesis for local tests
        builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(
                                                configProps.getProperty(AWSConfigConstants.AWS_ENDPOINT),
                                                null));
    }
    return builder.build();
}
项目:log4j-aws-appenders    文件:KinesisAppenderIntegrationTest.java   
/**
 *  Loads the test-specific Log4J configuration and resets the environment.
 */
public void setUp(String propertiesName, String streamName) throws Exception
{
    URL config = ClassLoader.getSystemResource(propertiesName);
    assertNotNull("missing configuration: " + propertiesName, config);

    LogManager.resetConfiguration();
    PropertyConfigurator.configure(config);

    localLogger = Logger.getLogger(getClass());

    localClient = AmazonKinesisClientBuilder.defaultClient();

    deleteStreamIfExists(streamName);
}
项目:kafka-connect-kinesis    文件:KinesisClientFactoryImpl.java   
@Override
public AmazonKinesis create(KinesisSourceConnectorConfig config) {
  AmazonKinesisClientBuilder builder = AmazonKinesisClient.builder()
      .withCredentials(config.awsCredentialsProvider())
      .withRegion(config.kinesisRegion);
  return builder.build();
}
项目:beam    文件:KinesisIO.java   
@Override
public AmazonKinesis getKinesisClient() {
  AmazonKinesisClientBuilder clientBuilder =
      AmazonKinesisClientBuilder.standard().withCredentials(getCredentialsProvider());
  if (serviceEndpoint == null) {
    clientBuilder.withRegion(region);
  } else {
    clientBuilder.withEndpointConfiguration(
        new AwsClientBuilder.EndpointConfiguration(serviceEndpoint, region.getName()));
  }
  return clientBuilder.build();
}
项目:datacollector    文件:KinesisUtil.java   
private static AmazonKinesis getKinesisClient(ClientConfiguration awsClientConfig, KinesisConfigBean conf) throws StageException {

    AmazonKinesisClientBuilder builder = AmazonKinesisClientBuilder
        .standard()
        .withClientConfiguration(checkNotNull(awsClientConfig))
        .withCredentials(AWSUtil.getCredentialsProvider(conf.awsConfig));

    if (AWSRegions.OTHER == conf.region) {
      builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(conf.endpoint, null));
    } else {
      builder.withRegion(conf.region.getLabel());
    }

    return builder.build();
  }
项目:miru    文件:HttpKinesisLogAppenderTest.java   
@BeforeClass
public void beforeClass() {
    String awsRegion = "us-east-1";
    String awsAccessKeyId = "<access key id>";
    String awsSecretAccessKey = "<secret access key>";

    BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(awsAccessKeyId, awsSecretAccessKey);
    client = AmazonKinesisClientBuilder.standard()
        .withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials))
        .withRegion(awsRegion)
        .build();
}
项目:wildfly-camel    文件:KinesisUtils.java   
public static AmazonKinesisClient createKinesisClient() {
    BasicCredentialsProvider credentials = BasicCredentialsProvider.standard();
    AmazonKinesisClient client = !credentials.isValid() ? null : (AmazonKinesisClient)
            AmazonKinesisClientBuilder.standard()
            .withCredentials(credentials)
            .withRegion("eu-west-1").build();
    return client;
}
项目:flink-stream-processing-refarch    文件:WatermarkTracker.java   
public WatermarkTracker(String region, String streamName) {
  this.streamName = streamName;
  this.kinesisClient = AmazonKinesisClientBuilder.standard().withRegion(region).build();
}
项目:log4j-aws-appenders    文件:KinesisAppenderIntegrationTest.java   
/**
 *  Factory method called by smoketest
 */
public static AmazonKinesis createClient()
{
    return AmazonKinesisClientBuilder.defaultClient();
}
项目:konker-platform    文件:EventPublisherAmazonKinesis.java   
public void setClientBuilder(AmazonKinesisClientBuilder clientBuilder) {
    this.clientBuilder = clientBuilder;
}