EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.vcloud.domain]

COVERAGE SUMMARY FOR SOURCE FILE [VCloudError.java]

nameclass, %method, %block, %line, %
VCloudError.java100% (1/1)100% (5/5)100% (147/147)100% (15/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VCloudError$MinorCode100% (1/1)100% (5/5)100% (147/147)100% (15/15)
<static initializer> 100% (1/1)100% (124/124)100% (12/12)
VCloudError$MinorCode (String, int): void 100% (1/1)100% (5/5)100% (1/1)
fromValue (String): VCloudError$MinorCode 100% (1/1)100% (9/9)100% (3/3)
valueOf (String): VCloudError$MinorCode 100% (1/1)100% (5/5)100% (1/1)
values (): VCloudError$MinorCode [] 100% (1/1)100% (4/4)100% (1/1)

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.vcloud.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import javax.annotation.Nullable;
24 
25import org.jclouds.vcloud.domain.internal.ErrorImpl;
26 
27import com.google.inject.ImplementedBy;
28 
29/**
30 * 
31 * 
32 * @author Adrian Cole
33 */
34@ImplementedBy(ErrorImpl.class)
35public interface VCloudError {
36   public static enum MinorCode {
37      /**
38       * The request was made by a user who had insufficient rights to the object or operation.
39       */
40      ACCESS_TO_RESOURCE_IS_FORBIDDEN,
41      /**
42       * The request could not be validated or contained invalid XML.
43       */
44      BAD_REQUEST,
45      /**
46       * A conflict was detected between sections of an OVF descriptor.
47       */
48      CONFLICT,
49      /**
50       * The entity is busy
51       */
52      BUSY_ENTITY,
53      /**
54       * An attempt to instantiate a vAppTemplate or use a vAppTemplate or a Vm in a composition did
55       * not include an AllEULAsAccepted element with a value of true.
56       */
57      EULA_NOT_ACCEPTED,
58      /**
59       * Returned for any failure that cannot be matched to another minor error code.
60       */
61      INTERNAL_SERVER_ERROR,
62      /**
63       * One or more references (href attribute values) supplied in the request could not be
64       * resolved to an object.
65       */
66      INVALID_REFERENCE,
67      /**
68       * The HTTP method (GET, PUT, POST, DELETE) is not allowed for the request.
69       */
70      METHOD_NOT_ALLOWED,
71      /**
72       * One or more references (href attribute values) supplied in the request could not be
73       * resolved to an object, or the Content?type of the request was incorrect.
74       */
75      RESOURCE_NOT_FOUND,
76      /**
77       * The request raised an exception that did not match any HTTP status code.
78       */
79      UNKNOWN,
80      /**
81       * The wrong content type was specified for the request.
82       */
83      UNSUPPORTED_MEDIA_TYPE, UNRECOGNIZED;
84 
85      public static MinorCode fromValue(String minorCode) {
86         try {
87            return valueOf(checkNotNull(minorCode, "minorCode"));
88         } catch (IllegalArgumentException e) {
89            return UNRECOGNIZED;
90         }
91      }
92   }
93 
94   /**
95    * 
96    * @return message describing the error
97    */
98   String getMessage();
99 
100   /**
101    * 
102    * @return matches the HTTP status code
103    */
104   int getMajorErrorCode();
105 
106   /**
107    * 
108    * @return error code specific to the failed operation or null if vcloud <0.9
109    */
110   @Nullable
111   MinorCode getMinorErrorCode();
112 
113   /**
114    * 
115    * @return optional additional information about the source of the error
116    */
117   @Nullable
118   String getVendorSpecificErrorCode();
119 
120   /**
121    * 
122    * @return stack trace of the error, if available. This attribute is returned only when a request
123    *         is made by the system administrator.
124    */
125   String getStackTrace();
126}

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