EMMA Coverage Report (generated Fri Aug 26 14:14:05 EDT 2011)
[all classes][org.jclouds.aws.config]

COVERAGE SUMMARY FOR SOURCE FILE [FormSigningRestClientModule.java]

nameclass, %method, %block, %line, %
FormSigningRestClientModule.java100% (1/1)25%  (1/4)20%  (5/25)33%  (2/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FormSigningRestClientModule100% (1/1)25%  (1/4)20%  (5/25)33%  (2/6)
FormSigningRestClientModule (Class, Class, Map): void 0%   (0/1)0%   (0/6)0%   (0/2)
provideRequestSigner (FormSigner): RequestSigner 0%   (0/1)0%   (0/2)0%   (0/1)
provideTimeStamp (DateService, int): String 0%   (0/1)0%   (0/12)0%   (0/1)
FormSigningRestClientModule (Class, Class): void 100% (1/1)100% (5/5)100% (2/2)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.aws.config;
20 
21import java.util.Date;
22import java.util.Map;
23 
24import javax.inject.Named;
25import javax.inject.Singleton;
26 
27import org.jclouds.Constants;
28import org.jclouds.aws.filters.FormSigner;
29import org.jclouds.date.DateService;
30import org.jclouds.date.TimeStamp;
31import org.jclouds.http.RequiresHttp;
32import org.jclouds.rest.ConfiguresRestClient;
33import org.jclouds.rest.RequestSigner;
34 
35import com.google.inject.Provides;
36 
37/**
38 * 
39 * @author Adrian Cole
40 */
41@ConfiguresRestClient
42@RequiresHttp
43public class FormSigningRestClientModule<S, A> extends AWSRestClientModule<S, A> {
44 
45   public FormSigningRestClientModule(Class<S> syncClientType, Class<A> asyncClientType,
46         Map<Class<?>, Class<?>> delegates) {
47      super(syncClientType, asyncClientType, delegates);
48   }
49 
50   public FormSigningRestClientModule(Class<S> syncClientType, Class<A> asyncClientType) {
51      super(syncClientType, asyncClientType);
52   }
53 
54   @Provides
55   @TimeStamp
56   protected String provideTimeStamp(final DateService dateService,
57            @Named(Constants.PROPERTY_SESSION_INTERVAL) final int expiration) {
58      return dateService.iso8601DateFormat(new Date(System.currentTimeMillis() + (expiration * 1000)));
59   }
60 
61   @Provides
62   @Singleton
63   RequestSigner provideRequestSigner(FormSigner in) {
64      return in;
65   }
66 
67}

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