EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.elasticstack.config]

COVERAGE SUMMARY FOR SOURCE FILE [ElasticStackRestClientModule.java]

nameclass, %method, %block, %line, %
ElasticStackRestClientModule.java100% (9/9)100% (12/12)100% (154/154)100% (17/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ElasticStackRestClientModule100% (1/1)100% (4/4)100% (106/106)100% (17/17)
ElasticStackRestClientModule (): void 100% (1/1)100% (5/5)100% (2/2)
bindErrorHandlers (): void 100% (1/1)100% (25/25)100% (4/4)
bindRetryHandlers (): void 100% (1/1)100% (1/1)100% (1/1)
configure (): void 100% (1/1)100% (75/75)100% (10/10)
     
class ElasticStackRestClientModule$1100% (1/1)100% (1/1)100% (6/6)100% (1/1)
ElasticStackRestClientModule$1 (ElasticStackRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class ElasticStackRestClientModule$2100% (1/1)100% (1/1)100% (6/6)100% (1/1)
ElasticStackRestClientModule$2 (ElasticStackRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class ElasticStackRestClientModule$3100% (1/1)100% (1/1)100% (6/6)100% (1/1)
ElasticStackRestClientModule$3 (ElasticStackRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class ElasticStackRestClientModule$4100% (1/1)100% (1/1)100% (6/6)100% (1/1)
ElasticStackRestClientModule$4 (ElasticStackRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class ElasticStackRestClientModule$5100% (1/1)100% (1/1)100% (6/6)100% (1/1)
ElasticStackRestClientModule$5 (ElasticStackRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class ElasticStackRestClientModule$6100% (1/1)100% (1/1)100% (6/6)100% (1/1)
ElasticStackRestClientModule$6 (ElasticStackRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class ElasticStackRestClientModule$7100% (1/1)100% (1/1)100% (6/6)100% (1/1)
ElasticStackRestClientModule$7 (ElasticStackRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class ElasticStackRestClientModule$8100% (1/1)100% (1/1)100% (6/6)100% (1/1)
ElasticStackRestClientModule$8 (ElasticStackRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)

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 */
19package org.jclouds.elasticstack.config;
20 
21import java.util.List;
22import java.util.Map;
23 
24import org.jclouds.elasticstack.ElasticStackAsyncClient;
25import org.jclouds.elasticstack.ElasticStackClient;
26import org.jclouds.elasticstack.domain.Device;
27import org.jclouds.elasticstack.domain.Drive;
28import org.jclouds.elasticstack.domain.DriveData;
29import org.jclouds.elasticstack.domain.DriveMetrics;
30import org.jclouds.elasticstack.domain.NIC;
31import org.jclouds.elasticstack.domain.Server;
32import org.jclouds.elasticstack.domain.ServerMetrics;
33import org.jclouds.elasticstack.functions.CreateDriveRequestToMap;
34import org.jclouds.elasticstack.functions.DriveDataToMap;
35import org.jclouds.elasticstack.functions.MapToDevices;
36import org.jclouds.elasticstack.functions.ServerToMap;
37import org.jclouds.elasticstack.functions.MapToDevices.DeviceToId;
38import org.jclouds.elasticstack.functions.MapToDriveMetrics;
39import org.jclouds.elasticstack.functions.MapToNICs;
40import org.jclouds.elasticstack.functions.MapToServerMetrics;
41import org.jclouds.elasticstack.handlers.ElasticStackErrorHandler;
42import org.jclouds.http.HttpErrorHandler;
43import org.jclouds.http.RequiresHttp;
44import org.jclouds.http.annotation.ClientError;
45import org.jclouds.http.annotation.Redirection;
46import org.jclouds.http.annotation.ServerError;
47import org.jclouds.rest.ConfiguresRestClient;
48import org.jclouds.rest.config.RestClientModule;
49 
50import com.google.common.base.Function;
51import com.google.inject.TypeLiteral;
52 
53/**
54 * Configures the elasticstack connection.
55 * 
56 * @author Adrian Cole
57 */
58@RequiresHttp
59@ConfiguresRestClient
60public class ElasticStackRestClientModule extends RestClientModule<ElasticStackClient, ElasticStackAsyncClient> {
61 
62   public ElasticStackRestClientModule() {
63      super(ElasticStackClient.class, ElasticStackAsyncClient.class);
64   }
65 
66   @Override
67   protected void configure() {
68      super.configure();
69      bind(new TypeLiteral<Function<Drive, Map<String, String>>>() {
70      }).to(CreateDriveRequestToMap.class);
71      bind(new TypeLiteral<Function<DriveData, Map<String, String>>>() {
72      }).to(DriveDataToMap.class);
73      bind(new TypeLiteral<Function<Map<String, String>, List<NIC>>>() {
74      }).to(MapToNICs.class);
75      bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends Device>>>() {
76      }).to(MapToDevices.class);
77      bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends DriveMetrics>>>() {
78      }).to(MapToDriveMetrics.class);
79      bind(new TypeLiteral<Function<Map<String, String>, ServerMetrics>>() {
80      }).to(MapToServerMetrics.class);
81      bind(new TypeLiteral<Function<Device, String>>() {
82      }).to(DeviceToId.class);
83      bind(new TypeLiteral<Function<Server, Map<String, String>>>() {
84      }).to(ServerToMap.class);
85   }
86 
87   @Override
88   protected void bindErrorHandlers() {
89      bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ElasticStackErrorHandler.class);
90      bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ElasticStackErrorHandler.class);
91      bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ElasticStackErrorHandler.class);
92   }
93 
94   @Override
95   protected void bindRetryHandlers() {
96      // TODO
97   }
98 
99}

[all classes][org.jclouds.elasticstack.config]
EMMA 2.0.5312 (C) Vladimir Roubtsov