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

COVERAGE SUMMARY FOR SOURCE FILE [OpenStackAuthAsyncClient.java]

nameclass, %method, %block, %line, %
OpenStackAuthAsyncClient.java0%   (0/1)0%   (0/7)0%   (0/62)0%   (0/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OpenStackAuthAsyncClient$AuthenticationResponse0%   (0/1)0%   (0/7)0%   (0/62)0%   (0/13)
OpenStackAuthAsyncClient$AuthenticationResponse (String, Map): void 0%   (0/1)0%   (0/16)0%   (0/4)
equals (Object): boolean 0%   (0/1)0%   (0/10)0%   (0/3)
getAuthToken (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getServices (): Map 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/14)0%   (0/1)
setEndpoints (Map): void 0%   (0/1)0%   (0/4)0%   (0/2)
toString (): String 0%   (0/1)0%   (0/12)0%   (0/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.openstack;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.net.URI;
24import java.util.Map;
25 
26import javax.ws.rs.GET;
27import javax.ws.rs.HeaderParam;
28import javax.ws.rs.Path;
29 
30import org.jclouds.Constants;
31import org.jclouds.openstack.functions.ParseAuthenticationResponseFromHeaders;
32import org.jclouds.openstack.reference.AuthHeaders;
33import org.jclouds.rest.annotations.ResponseParser;
34 
35import com.google.common.base.Objects;
36import com.google.common.collect.ImmutableMap;
37import com.google.common.util.concurrent.ListenableFuture;
38 
39/**
40 * Provides access to Rackspace resources via their REST API.
41 * <p/>
42 * 
43 * @see <a href="http://docs.rackspacecloud.com/servers/api/cs-devguide-latest.pdf" />
44 * @author Adrian Cole
45 */
46@Path("/v{" + Constants.PROPERTY_API_VERSION + "}")
47public interface OpenStackAuthAsyncClient {
48   public static final String VERSION = "1.0";
49 
50   public static class AuthenticationResponse {
51      private final String authToken;
52      private Map<String, URI> services;
53 
54      public AuthenticationResponse(String authToken, Map<String, URI> services) {
55         this.authToken = checkNotNull(authToken, "authToken");
56         this.services = ImmutableMap.copyOf(checkNotNull(services, "services"));
57      }
58 
59      public Map<String, URI> getServices() {
60         return services;
61      }
62 
63      public void setEndpoints(Map<String, URI> services) {
64         this.services = services;
65      }
66 
67      public String getAuthToken() {
68         return authToken;
69      }
70 
71      // performance isn't a concern on a infrequent object like this, so using shortcuts;
72 
73      @Override
74      public int hashCode() {
75         return Objects.hashCode(authToken, services);
76      }
77 
78      @Override
79      public boolean equals(Object that) {
80         if (that == null)
81            return false;
82         return Objects.equal(this.toString(), that.toString());
83      }
84 
85      @Override
86      public String toString() {
87         return Objects.toStringHelper(this).add("authToken", authToken).add("services", services).toString();
88      }
89 
90   }
91 
92   @GET
93   @ResponseParser(ParseAuthenticationResponseFromHeaders.class)
94   ListenableFuture<AuthenticationResponse> authenticate(@HeaderParam(AuthHeaders.AUTH_USER) String user,
95            @HeaderParam(AuthHeaders.AUTH_KEY) String key);
96   
97 
98   @GET
99   @ResponseParser(ParseAuthenticationResponseFromHeaders.class)
100   ListenableFuture<AuthenticationResponse> authenticateStorage(@HeaderParam(AuthHeaders.STORAGE_USER) String user,
101            @HeaderParam(AuthHeaders.STORAGE_PASS) String key);
102}

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