EMMA Coverage Report (generated Mon Oct 17 05:41:20 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 * 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.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