View Javadoc

1   /**
2    * Licensed to jclouds, Inc. (jclouds) under one or more
3    * contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  jclouds licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.jclouds.aws.cloudwatch;
20  
21  import static org.jclouds.Constants.PROPERTY_API_VERSION;
22  import static org.jclouds.Constants.PROPERTY_ENDPOINT;
23  import static org.jclouds.aws.reference.AWSConstants.PROPERTY_AUTH_TAG;
24  import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
25  import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION;
26  
27  import java.util.Properties;
28  
29  import org.jclouds.aws.domain.Region;
30  import org.jclouds.cloudwatch.CloudWatchAsyncClient;
31  import org.jclouds.cloudwatch.CloudWatchPropertiesBuilder;
32  
33  /**
34   * Builds properties used in CloudWatch Clients
35   * 
36   * @author Adrian Cole
37   */
38  public class AWSCloudWatchPropertiesBuilder extends CloudWatchPropertiesBuilder {
39  
40     @Override
41     protected Properties defaultProperties() {
42        Properties properties = super.defaultProperties();
43        properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
44        properties.setProperty(PROPERTY_HEADER_TAG, "amz");
45        properties.setProperty(PROPERTY_API_VERSION, CloudWatchAsyncClient.VERSION);
46        properties.putAll(Region.regionProperties());
47        properties.setProperty(PROPERTY_ENDPOINT, "https://monitoring.us-east-1.amazonaws.com");
48        properties.setProperty(PROPERTY_REGION + "." + Region.US_EAST_1 + ".endpoint",
49              "https://monitoring.us-east-1.amazonaws.com");
50        properties.setProperty(PROPERTY_REGION + "." + Region.US_WEST_1 + ".endpoint",
51              "https://monitoring.us-west-1.amazonaws.com");
52        properties.setProperty(PROPERTY_REGION + "." + Region.EU_WEST_1 + ".endpoint",
53              "https://monitoring.eu-west-1.amazonaws.com");
54        properties.setProperty(PROPERTY_REGION + "." + Region.AP_SOUTHEAST_1 + ".endpoint",
55              "https://monitoring.ap-southeast-1.amazonaws.com");
56        properties.setProperty(PROPERTY_REGION + "." + Region.AP_NORTHEAST_1 + ".endpoint",
57              "https://monitoring.ap-northeast-1.amazonaws.com");
58        return properties;
59     }
60  
61     public AWSCloudWatchPropertiesBuilder() {
62        super();
63     }
64  
65     public AWSCloudWatchPropertiesBuilder(Properties properties) {
66        super(properties);
67     }
68  
69  }