org.jclouds.virtualbox.domain
Enum ErrorCode

java.lang.Object
  extended by java.lang.Enum<ErrorCode>
      extended by org.jclouds.virtualbox.domain.ErrorCode
All Implemented Interfaces:
Serializable, Comparable<ErrorCode>

public enum ErrorCode
extends Enum<ErrorCode>

Maps the error codes in the Virtual Box Java API into enum values.

To get the error code from a VBoxException, use:

 try {
    ...
    ...
 }
 catch (VBoxException vboxException) {
    RuntimeFaultMsg fault = (RuntimeFaultMsg) vboxException.getWrapped();
    int faultCode = fault.getFaultInfo().getResultCode();
    ErrorCode errorCode = ErrorCode.valueOf(faultCode);
 }
 

Author:
Mattias Holmqvist

Enum Constant Summary
VBOX_E_ACCESSDENIED
           
VBOX_E_ERROR_CODE_UNAVAILABLE
           
VBOX_E_FAIL
           
VBOX_E_FILE_ERROR
           
VBOX_E_HOST_ERROR
           
VBOX_E_INVALID_OBJECT_STATE
           
VBOX_E_INVALID_SESSION_STATE
           
VBOX_E_INVALID_VM_STATE
           
VBOX_E_INVALIDARG
           
VBOX_E_IPRT_ERROR
           
VBOX_E_NOT_SUPPORTED
           
VBOX_E_NOTIMPL
           
VBOX_E_OBJECT_IN_USE
           
VBOX_E_OBJECT_NOT_FOUND
           
VBOX_E_OUTOFMEMORY
           
VBOX_E_PDM_ERROR
           
VBOX_E_POINTER
           
VBOX_E_UNEXPECTED
           
VBOX_E_UNKNOWN_ERROR_CODE
           
VBOX_E_VM_ERROR
           
VBOX_E_XML_ERROR
           
 
Method Summary
static ErrorCode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ErrorCode valueOf(org.virtualbox_4_1.VBoxException vboxException)
          Returns an ErrorCode from the fault code given by the VirtualBox API.
static ErrorCode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

VBOX_E_OBJECT_NOT_FOUND

public static final ErrorCode VBOX_E_OBJECT_NOT_FOUND

VBOX_E_INVALID_VM_STATE

public static final ErrorCode VBOX_E_INVALID_VM_STATE

VBOX_E_VM_ERROR

public static final ErrorCode VBOX_E_VM_ERROR

VBOX_E_FILE_ERROR

public static final ErrorCode VBOX_E_FILE_ERROR

VBOX_E_IPRT_ERROR

public static final ErrorCode VBOX_E_IPRT_ERROR

VBOX_E_PDM_ERROR

public static final ErrorCode VBOX_E_PDM_ERROR

VBOX_E_INVALID_OBJECT_STATE

public static final ErrorCode VBOX_E_INVALID_OBJECT_STATE

VBOX_E_HOST_ERROR

public static final ErrorCode VBOX_E_HOST_ERROR

VBOX_E_NOT_SUPPORTED

public static final ErrorCode VBOX_E_NOT_SUPPORTED

VBOX_E_XML_ERROR

public static final ErrorCode VBOX_E_XML_ERROR

VBOX_E_INVALID_SESSION_STATE

public static final ErrorCode VBOX_E_INVALID_SESSION_STATE

VBOX_E_OBJECT_IN_USE

public static final ErrorCode VBOX_E_OBJECT_IN_USE

VBOX_E_ACCESSDENIED

public static final ErrorCode VBOX_E_ACCESSDENIED

VBOX_E_POINTER

public static final ErrorCode VBOX_E_POINTER

VBOX_E_FAIL

public static final ErrorCode VBOX_E_FAIL

VBOX_E_NOTIMPL

public static final ErrorCode VBOX_E_NOTIMPL

VBOX_E_OUTOFMEMORY

public static final ErrorCode VBOX_E_OUTOFMEMORY

VBOX_E_INVALIDARG

public static final ErrorCode VBOX_E_INVALIDARG

VBOX_E_UNEXPECTED

public static final ErrorCode VBOX_E_UNEXPECTED

VBOX_E_UNKNOWN_ERROR_CODE

public static final ErrorCode VBOX_E_UNKNOWN_ERROR_CODE

VBOX_E_ERROR_CODE_UNAVAILABLE

public static final ErrorCode VBOX_E_ERROR_CODE_UNAVAILABLE
Method Detail

values

public static ErrorCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ErrorCode c : ErrorCode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ErrorCode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

valueOf

public static ErrorCode valueOf(org.virtualbox_4_1.VBoxException vboxException)
Returns an ErrorCode from the fault code given by the VirtualBox API.

Parameters:
vboxException - the exception to get the error code from.
Returns:
an ErrorCode representing the given fault code.


Copyright © 2009-2012 jclouds. All Rights Reserved.