org.sblim.wbem.cim

Class CIMException

Implemented Interfaces:
Serializable
Known Direct Subclasses:
CIMAuthenticationException, CIMSecurityException, CIMTransportException, CIMXMLBuilderException

public class CIMException
extends RuntimeException
implements Serializable

This class is the super class for classes used to describe exceptional CIM conditions. Standard status codes are marked starts with the CIM prefix as part of the status message. Extended status codes are start with the EXT_ prefix and must be added in classes extending the CIMException.

Field Summary

protected static String[]
CIM_ERROR_NAMES
static String
CIM_ERR_ACCESS_DENIED
CIM Status Code value: Access to a CIM resource is not available, or the logon attempt to the CIM Server failed.
static String
CIM_ERR_ALREADY_EXISTS
CIM Status Code value: The CIM object (class or instance) already exists.
static String
CIM_ERR_CLASS_HAS_CHILDREN
CIM Status Code value: The CIM class has subclasses.
static String
CIM_ERR_CLASS_HAS_INSTANCES
CIM Status Code value: One or more instances of this CIM class exist.
static String
CIM_ERR_FAILED
CIM Status Code value: General error without more specific information.
static String
CIM_ERR_INVALID_CLASS
CIM Status Code value: The CIM class does not exist in the target CIM namespace.
static String
CIM_ERR_INVALID_NAMESPACE
CIM Status Code value: The target CIM namespace does not exist in the CIM Server.
static String
CIM_ERR_INVALID_PARAMETER
CIM Status Code value: One or more parameter values passed to the CIM method or Java method are not valid.
static String
CIM_ERR_INVALID_QUERY
CIM Status Code value: The query is not valid for the specified query language.
static String
CIM_ERR_INVALID_SUPERCLASS
CIM Status Code value: The CIM superclass does not exist.
static String
CIM_ERR_LOW_ON_MEMORY
Origin: Not clear.
static String
CIM_ERR_METHOD_NOT_AVAILABLE
CIM Status Code value: The CIM method is not supported by the CIM Provider for the class.
static String
CIM_ERR_METHOD_NOT_FOUND
CIM Status Code value: The CIM method is not defined on the class.
static String
CIM_ERR_NOT_FOUND
CIM Status Code value: For CIM Server/Provider originated errors, the CIM object (instance or class) does not exist in the target CIM namespace.
static String
CIM_ERR_NOT_IMPLEMENTED
Origin: Not clear.
static String
CIM_ERR_NOT_SUPPORTED
CIM Status Code value: The CIM operation is not supported by the CIM Server/Provider.
static String
CIM_ERR_NO_SUCH_PROPERTY
CIM Status Code value: The CIM property is not defined on the class.
static String
CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
CIM Status Code value: The query language is not recognized or supported.
static String
CIM_ERR_TYPE_MISMATCH
CIM Status Code value: The value supplied is not compatible with the CIM type.
static String
IBM_ERR_TIMED_OUT
Origin: Not clear.
static String
IBM_ERR_VER_ERROR
Origin: Not clear.

Constructor Summary

CIMException()
Constructs a CIMException with no detail message.
CIMException(String pReason)
Constructs a CIMException with the specified message.
CIMException(String pReason, Object pExtendedReason)
Constructs a CIMException with the specified message and one extended reason parameter.
CIMException(String pReason, Object pExtendedReason1, Object pExtendedReason2)
Constructs a CIMException with the specified message and one extended reason parameter.
CIMException(String pReason, Object pExtendedReason1, Object pExtendedReason2, Object pExtendedReason3)
Constructs a CIMException with the specified message and one extended reason parameter.
CIMException(String pReason, Object[] pExtendedReason)
Constructs a CIMException with the specified message and one extended reason parameter.
CIMException(String pReason, Throwable pThrowable)
Constructs a CIMException with the specified message and one extended reason parameter.

Method Summary

boolean
equals(Object o)
Throwable
getCause()
Gets the thowable object which causes this exception.
String
getDescription()
Returns a description for this exception.
String
getID()
Gets the reason for this exception.
String
getMessage()
Gets the message associated to this exception.
Object[]
getParams()
Gets the extended reason for this exception.
int
getStatusCode()
Returns the status code that may be returned by a conforming CIM Server application as the value of the CODE attribute of an subelement within a or .
static int
getStatusCode(String pMessage)
Returns the status code that may be returned by a conforming CIM Server application as the value of the CODE attribute of an subelement within a or .
static String
getStatusFromCode(int i)
Returns the string representation of the status code.
int
hashCode()
Throwable
initCause(Throwable pCause)
void
setDescription(String pDescription)
Sets a description for this exception.
void
setParams(Object[] pReason)
Specifies the extended reason for this exception.
String
toString()

Field Details

CIM_ERROR_NAMES

protected static final String[] CIM_ERROR_NAMES

CIM_ERR_ACCESS_DENIED

public static final String CIM_ERR_ACCESS_DENIED
CIM Status Code value: Access to a CIM resource is not available, or the logon attempt to the CIM Server failed. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_ALREADY_EXISTS

public static final String CIM_ERR_ALREADY_EXISTS
CIM Status Code value: The CIM object (class or instance) already exists. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_CLASS_HAS_CHILDREN

public static final String CIM_ERR_CLASS_HAS_CHILDREN
CIM Status Code value: The CIM class has subclasses. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_CLASS_HAS_INSTANCES

public static final String CIM_ERR_CLASS_HAS_INSTANCES
CIM Status Code value: One or more instances of this CIM class exist. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_FAILED

public static final String CIM_ERR_FAILED
CIM Status Code value: General error without more specific information. Origin: CIM Server/Provider as well as CIM Client code. TODO Docu: How are description and extendedReason used ? TODO Can we change creaiton of exceptions with this status code in the CIM Client code so they use some other code ?

CIM_ERR_INVALID_CLASS

public static final String CIM_ERR_INVALID_CLASS
CIM Status Code value: The CIM class does not exist in the target CIM namespace. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_INVALID_NAMESPACE

public static final String CIM_ERR_INVALID_NAMESPACE
CIM Status Code value: The target CIM namespace does not exist in the CIM Server. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_INVALID_PARAMETER

public static final String CIM_ERR_INVALID_PARAMETER
CIM Status Code value: One or more parameter values passed to the CIM method or Java method are not valid. This includes cases of missing, duplicate, unrecognized or otherwise incorrect parameters. The description mentions in free form text which parameter is invalid for what reason. Origin: CIM Server/Provider as well as CIM Client code. TODO Docu: How is extendedReason used ? TODO Can we change creaiton of exceptions with this status code in the CIM Client code so they use some other code ?

CIM_ERR_INVALID_QUERY

public static final String CIM_ERR_INVALID_QUERY
CIM Status Code value: The query is not valid for the specified query language. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_INVALID_SUPERCLASS

public static final String CIM_ERR_INVALID_SUPERCLASS
CIM Status Code value: The CIM superclass does not exist. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_LOW_ON_MEMORY

public static final String CIM_ERR_LOW_ON_MEMORY
Origin: Not clear. TODO Not used anywhere in the CIM Client code, and also not a DMTF defined CIM status code.

CIM_ERR_METHOD_NOT_AVAILABLE

public static final String CIM_ERR_METHOD_NOT_AVAILABLE
CIM Status Code value: The CIM method is not supported by the CIM Provider for the class. Note that it is still be defined on the class. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_METHOD_NOT_FOUND

public static final String CIM_ERR_METHOD_NOT_FOUND
CIM Status Code value: The CIM method is not defined on the class. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_NOT_FOUND

public static final String CIM_ERR_NOT_FOUND
CIM Status Code value: For CIM Server/Provider originated errors, the CIM object (instance or class) does not exist in the target CIM namespace. For CIM Client originated errors, something has not been found. Origin: CIM Server/Provider as well as CIM Client code. TODO Docu: How are description and extendedReason used ? TODO Can we change creaiton of exceptions with this status code in the CIM Client code so they use some other code ?

CIM_ERR_NOT_IMPLEMENTED

public static final String CIM_ERR_NOT_IMPLEMENTED
Origin: Not clear. TODO Not used anywhere in the CIM Client code, and also not a DMTF defined CIM status code.

CIM_ERR_NOT_SUPPORTED

public static final String CIM_ERR_NOT_SUPPORTED
CIM Status Code value: The CIM operation is not supported by the CIM Server/Provider. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_NO_SUCH_PROPERTY

public static final String CIM_ERR_NO_SUCH_PROPERTY
CIM Status Code value: The CIM property is not defined on the class. Note that if the property is defined on the class but not supported by a CIM Provider, it is still supposed to be returned to the client with its class defined default value. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED

public static final String CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
CIM Status Code value: The query language is not recognized or supported. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

CIM_ERR_TYPE_MISMATCH

public static final String CIM_ERR_TYPE_MISMATCH
CIM Status Code value: The value supplied is not compatible with the CIM type. Origin: CIM Server/Provider only. TODO Docu: How are description and extendedReason used ?

IBM_ERR_TIMED_OUT

public static final String IBM_ERR_TIMED_OUT
Origin: Not clear. TODO Not used anywhere in the CIM Client code, and also not a DMTF defined CIM status code.

IBM_ERR_VER_ERROR

public static final String IBM_ERR_VER_ERROR
Origin: Not clear. TODO Not used anywhere in the CIM Client code, and also not a DMTF defined CIM status code.

Constructor Details

CIMException

public CIMException()
Constructs a CIMException with no detail message.

CIMException

public CIMException(String pReason)
Constructs a CIMException with the specified message.
Parameters:
pReason - - a symbolic name of the CIMException. e.g. CIM_ERR_FAILED, CIM_ERR_NOT_FOUND, etc.

CIMException

public CIMException(String pReason,
                    Object pExtendedReason)
Constructs a CIMException with the specified message and one extended reason parameter.
Parameters:
pReason - - a symbolic name of the CIMException. e.g. CIM_ERR_FAILED, CIM_ERR_NOT_FOUND, etc.
pExtendedReason - extended reason describing the exception.

CIMException

public CIMException(String pReason,
                    Object pExtendedReason1,
                    Object pExtendedReason2)
Constructs a CIMException with the specified message and one extended reason parameter.
Parameters:
pReason - - a symbolic name of the CIMException. e.g. CIM_ERR_FAILED, CIM_ERR_NOT_FOUND, etc.
pExtendedReason1 - first extended reason describing the exception.
pExtendedReason2 - second extended reason describing the exception.

CIMException

public CIMException(String pReason,
                    Object pExtendedReason1,
                    Object pExtendedReason2,
                    Object pExtendedReason3)
Constructs a CIMException with the specified message and one extended reason parameter.
Parameters:
pReason - - a symbolic name of the CIMException. e.g. CIM_ERR_FAILED, CIM_ERR_NOT_FOUND, etc.
pExtendedReason1 - first extended reason describing the exception.
pExtendedReason2 - second extended reason describing the exception.
pExtendedReason3 - third extended reason describing the exception.

CIMException

public CIMException(String pReason,
                    Object[] pExtendedReason)
Constructs a CIMException with the specified message and one extended reason parameter.
Parameters:
pReason - - a symbolic name of the CIMException. e.g. CIM_ERR_FAILED, CIM_ERR_NOT_FOUND, etc.
pExtendedReason - an array of extended reasons describing the exception.

CIMException

public CIMException(String pReason,
                    Throwable pThrowable)
Constructs a CIMException with the specified message and one extended reason parameter.
Parameters:
pReason - - a symbolic name of the CIMException. e.g. CIM_ERR_FAILED, CIM_ERR_NOT_FOUND, etc.
pThrowable - the original cause for this exception.

Method Details

equals

public boolean equals(Object o)

getCause

public Throwable getCause()
Gets the thowable object which causes this exception.
Returns:
The cause

getDescription

public String getDescription()
Returns a description for this exception. If no description is specified, a description is formulated from the reason and extended reasons.
Returns:
The description

getID

public String getID()
Gets the reason for this exception.
Returns:
The reason

getMessage

public String getMessage()
Gets the message associated to this exception.
Returns:
The message

getParams

public Object[] getParams()
Gets the extended reason for this exception.
Returns:
The extended reason

getStatusCode

public int getStatusCode()
Returns the status code that may be returned by a conforming CIM Server application as the value of the CODE attribute of an subelement within a or . This method returns the status code assigned to the CIMException. If the status message is a standard status code defined by the specification, it will return the corresponding value. (i.e "CIM_ERR_FAILED" = 1, "CIM_ERR_ACCESS_DENIED" =2), otherwise it will return -1
Returns:
an integer value associated to the cim status code

getStatusCode

public static int getStatusCode(String pMessage)
Returns the status code that may be returned by a conforming CIM Server application as the value of the CODE attribute of an subelement within a or . This method returns the status code for a given string value. If the status message is a standard status code defined by the specification, it will return the corresponding value. (i.e "CIM_ERR_FAILED" = 1, "CIM_ERR_ACCESS_DENIED" =2), otherwise it will return -1
Parameters:
pMessage - The status code string (i.e. "CIM_ERR_FAILED")
Returns:
an integer value associated to the cim status code

getStatusFromCode

public static String getStatusFromCode(int i)
Returns the string representation of the status code. (i.e. status code 6 will return "CIM_ERR_NOT_FOUND". If the status code is not a standard status code then "CIM_ERR_FAILED" is returned.
Parameters:
i - an integer representing the status code
Returns:
the string representation of the status code

hashCode

public int hashCode()

initCause

public Throwable initCause(Throwable pCause)

setDescription

public void setDescription(String pDescription)
Sets a description for this exception.
Parameters:
pDescription -

setParams

public void setParams(Object[] pReason)
Specifies the extended reason for this exception.
Parameters:
pReason - The extended reason

toString

public String toString()

Copyright © 2005, 2006 IBM Corporation. All Rights Reserved.