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

COVERAGE SUMMARY FOR SOURCE FILE [AtmosResponseException.java]

nameclass, %method, %block, %line, %
AtmosResponseException.java0%   (0/1)0%   (0/6)0%   (0/79)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AtmosResponseException0%   (0/1)0%   (0/6)0%   (0/79)0%   (0/15)
AtmosResponseException (HttpCommand, HttpResponse, AtmosError): void 0%   (0/1)0%   (0/29)0%   (0/3)
AtmosResponseException (HttpCommand, HttpResponse, AtmosError, Throwable): void 0%   (0/1)0%   (0/24)0%   (0/3)
AtmosResponseException (String, HttpCommand, HttpResponse, AtmosError): void 0%   (0/1)0%   (0/9)0%   (0/3)
AtmosResponseException (String, HttpCommand, HttpResponse, AtmosError, Throwa... 0%   (0/1)0%   (0/10)0%   (0/3)
getError (): AtmosError 0%   (0/1)0%   (0/3)0%   (0/1)
setError (AtmosError): void 0%   (0/1)0%   (0/4)0%   (0/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.atmos;
20 
21import org.jclouds.atmos.domain.AtmosError;
22import org.jclouds.atmos.handlers.ParseAtmosErrorFromXmlContent;
23import org.jclouds.http.HttpCommand;
24import org.jclouds.http.HttpResponse;
25import org.jclouds.http.HttpResponseException;
26 
27/**
28 * Encapsulates an Error from Atmos Storage Services.
29 * 
30 * @see AtmosError
31 * @see ParseAtmosErrorFromXmlContent
32 * @author Adrian Cole
33 * 
34 */
35public class AtmosResponseException extends HttpResponseException {
36 
37   private static final long serialVersionUID = 1L;
38 
39   private AtmosError error;
40 
41   public AtmosResponseException(HttpCommand command, HttpResponse response,
42            AtmosError error) {
43      super(String.format("command %s failed with code %s, error: %s", command.getCurrentRequest()
44               .getRequestLine(), response.getStatusCode(), error.toString()), command, response);
45      this.setError(error);
46 
47   }
48 
49   public AtmosResponseException(HttpCommand command, HttpResponse response,
50            AtmosError error, Throwable cause) {
51      super(String.format("command %1$s failed with error: %2$s", command.getCurrentRequest()
52               .getRequestLine(), error.toString()), command, response, cause);
53      this.setError(error);
54 
55   }
56 
57   public AtmosResponseException(String message, HttpCommand command, HttpResponse response,
58            AtmosError error) {
59      super(message, command, response);
60      this.setError(error);
61 
62   }
63 
64   public AtmosResponseException(String message, HttpCommand command, HttpResponse response,
65            AtmosError error, Throwable cause) {
66      super(message, command, response, cause);
67      this.setError(error);
68 
69   }
70 
71   public void setError(AtmosError error) {
72      this.error = error;
73   }
74 
75   public AtmosError getError() {
76      return error;
77   }
78 
79}

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