-
Notifications
You must be signed in to change notification settings - Fork 14
Home
Stu Arnett edited this page Jun 25, 2015
·
32 revisions
Maven coordinates:
Group | Artifact | Version |
---|---|---|
com.emc.ecs |
object-client |
1.2.0-rc.1 |
There are two ways to use the client: with or without the "Smart Client". If your system has a traditional load balancer set up behind a VIP and DNS, then configure with S3VHostConfig. If you want to use the software load balancer built-in to the client and have direct access to all the ECS nodes by IP, then use S3Config and the smart client will use the hosts you provide to discover all the ECS node IPs and load balance across them automatically.
S3Config config;
// with load balancer (and corresponding baseUrl/DNS setup)
config = new S3VHostConfig(new URI("https://s3.mycompany.com"));
// client-side load balancing (direct to individual nodes)
// single VDC
config = new S3Config("http", NODE_IP1, NODE_IP2);
// multiple VDCs
config = new S3Config("http", new Vdc("Boston", VDC1_NODE1, VDC1_NODE2),
new Vdc("Seattle", VDC2_NODE1, VDC2_NODE2));
config.withIdentity(S3_ACCESS_KEY_ID).withSecretKey(S3_SECRET_KEY);
S3Client s3Client = new S3JerseyClient(config);