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

COVERAGE SUMMARY FOR SOURCE FILE [CloudSigmaRestClientModule.java]

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CloudSigmaRestClientModule100% (1/1)100% (4/4)100% (106/106)100% (17/17)
CloudSigmaRestClientModule (): 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 CloudSigmaRestClientModule$1100% (1/1)100% (1/1)100% (6/6)100% (1/1)
CloudSigmaRestClientModule$1 (CloudSigmaRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class CloudSigmaRestClientModule$2100% (1/1)100% (1/1)100% (6/6)100% (1/1)
CloudSigmaRestClientModule$2 (CloudSigmaRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class CloudSigmaRestClientModule$3100% (1/1)100% (1/1)100% (6/6)100% (1/1)
CloudSigmaRestClientModule$3 (CloudSigmaRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class CloudSigmaRestClientModule$4100% (1/1)100% (1/1)100% (6/6)100% (1/1)
CloudSigmaRestClientModule$4 (CloudSigmaRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class CloudSigmaRestClientModule$5100% (1/1)100% (1/1)100% (6/6)100% (1/1)
CloudSigmaRestClientModule$5 (CloudSigmaRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class CloudSigmaRestClientModule$6100% (1/1)100% (1/1)100% (6/6)100% (1/1)
CloudSigmaRestClientModule$6 (CloudSigmaRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class CloudSigmaRestClientModule$7100% (1/1)100% (1/1)100% (6/6)100% (1/1)
CloudSigmaRestClientModule$7 (CloudSigmaRestClientModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class CloudSigmaRestClientModule$8100% (1/1)100% (1/1)100% (6/6)100% (1/1)
CloudSigmaRestClientModule$8 (CloudSigmaRestClientModule): 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.cloudsigma.config;
20 
21import java.util.List;
22import java.util.Map;
23 
24import org.jclouds.cloudsigma.CloudSigmaAsyncClient;
25import org.jclouds.cloudsigma.CloudSigmaClient;
26import org.jclouds.cloudsigma.domain.Device;
27import org.jclouds.cloudsigma.domain.Drive;
28import org.jclouds.cloudsigma.domain.DriveData;
29import org.jclouds.cloudsigma.domain.DriveMetrics;
30import org.jclouds.cloudsigma.domain.NIC;
31import org.jclouds.cloudsigma.domain.Server;
32import org.jclouds.cloudsigma.domain.ServerMetrics;
33import org.jclouds.cloudsigma.functions.BaseDriveToMap;
34import org.jclouds.cloudsigma.functions.DriveDataToMap;
35import org.jclouds.cloudsigma.functions.MapToDevices;
36import org.jclouds.cloudsigma.functions.MapToDevices.DeviceToId;
37import org.jclouds.cloudsigma.functions.MapToDriveMetrics;
38import org.jclouds.cloudsigma.functions.MapToNICs;
39import org.jclouds.cloudsigma.functions.MapToServerMetrics;
40import org.jclouds.cloudsigma.functions.ServerToMap;
41import org.jclouds.cloudsigma.handlers.CloudSigmaErrorHandler;
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 CloudSigma connection.
55 * 
56 * @author Adrian Cole
57 */
58@RequiresHttp
59@ConfiguresRestClient
60public class CloudSigmaRestClientModule extends RestClientModule<CloudSigmaClient, CloudSigmaAsyncClient> {
61 
62   public CloudSigmaRestClientModule() {
63      super(CloudSigmaClient.class, CloudSigmaAsyncClient.class);
64   }
65 
66   @Override
67   protected void bindErrorHandlers() {
68      bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(CloudSigmaErrorHandler.class);
69      bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(CloudSigmaErrorHandler.class);
70      bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(CloudSigmaErrorHandler.class);
71   }
72 
73   @Override
74   protected void configure() {
75      super.configure();
76      bind(new TypeLiteral<Function<Drive, Map<String, String>>>() {
77      }).to(BaseDriveToMap.class);
78      bind(new TypeLiteral<Function<DriveData, Map<String, String>>>() {
79      }).to(DriveDataToMap.class);
80      bind(new TypeLiteral<Function<Map<String, String>, List<NIC>>>() {
81      }).to(MapToNICs.class);
82      bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends Device>>>() {
83      }).to(MapToDevices.class);
84      bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends DriveMetrics>>>() {
85      }).to(MapToDriveMetrics.class);
86      bind(new TypeLiteral<Function<Map<String, String>, ServerMetrics>>() {
87      }).to(MapToServerMetrics.class);
88      bind(new TypeLiteral<Function<Device, String>>() {
89      }).to(DeviceToId.class);
90      bind(new TypeLiteral<Function<Server, Map<String, String>>>() {
91      }).to(ServerToMap.class);
92   }
93 
94   @Override
95   protected void bindRetryHandlers() {
96      // TODO
97   }
98 
99}

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