version 1.64, 2003/07/15 16:53:03
|
version 1.77.2.1, 2007/03/27 17:26:13
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) | // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// Sushma Fernandes , Hewlett-Packard Company | // Sushma Fernandes , Hewlett-Packard Company |
// (sushma_fernandes@hp.com) | // (sushma_fernandes@hp.com) |
|
// Amit K Arora, IBM (amita@in.ibm.com) for bug# 1593 |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
{ | { |
_rep = new ExceptionRep(); | _rep = new ExceptionRep(); |
_rep->message = message; | _rep->message = message; |
_rep->contentLanguages = ContentLanguages::EMPTY; // l10n |
_rep->contentLanguages.clear(); |
} | } |
| |
Exception::Exception(const Exception& exception) | Exception::Exception(const Exception& exception) |
|
|
| |
Exception::Exception() | Exception::Exception() |
{ | { |
|
_rep = NULL; |
} | } |
| |
Exception::~Exception() | Exception::~Exception() |
|
|
} | } |
| |
// l10n | // l10n |
const ContentLanguages& Exception::getContentLanguages() const |
const ContentLanguageList& Exception::getContentLanguages() const |
{ | { |
return _rep->contentLanguages; | return _rep->contentLanguages; |
} | } |
| |
// l10n | // l10n |
void Exception::setContentLanguages(const ContentLanguages& langs) |
void Exception::setContentLanguages(const ContentLanguageList& langs) |
{ | { |
_rep->contentLanguages = langs; | _rep->contentLanguages = langs; |
} | } |
| |
// l10n TODO - finish the commented out constructors below |
/* |
|
|
IndexOutOfBoundsException::IndexOutOfBoundsException() | IndexOutOfBoundsException::IndexOutOfBoundsException() |
: Exception("index out of bounds") | : Exception("index out of bounds") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
IndexOutOfBoundsException::IndexOutOfBoundsException() | IndexOutOfBoundsException::IndexOutOfBoundsException() |
: Exception(MessageLoaderParms("key","index out of bounds")) |
: Exception(MessageLoaderParms("Common.Exception.INDEX_OUT_OF_BOUNDS_EXCEPTION","index out of bounds")) |
{ | { |
} | } |
*/ |
|
| |
|
/* |
AlreadyExistsException::AlreadyExistsException(const String& message) | AlreadyExistsException::AlreadyExistsException(const String& message) |
: Exception("already exists: " + message) | : Exception("already exists: " + message) |
{ | { |
} | } |
|
*/ |
| |
/* |
|
AlreadyExistsException::AlreadyExistsException(const String& message) | AlreadyExistsException::AlreadyExistsException(const String& message) |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.ALREADY_EXISTS_EXCEPTION", |
"already exists: $0", | "already exists: $0", |
DON'T FORGET THE $0 for the rest of these! |
|
message)) | message)) |
{ | { |
} | } |
| |
AlreadyExistsException::AlreadyExistsException(const MessageLoaderParms& msgParms) |
AlreadyExistsException::AlreadyExistsException(MessageLoaderParms& msgParms) |
: Exception(MessageLoaderParms("key2", |
: Exception(MessageLoaderParms("Common.Exception.ALREADY_EXISTS_EXCEPTION", |
"already exists: ")) |
"already exists: $0", |
|
MessageLoader::getMessage(msgParms))) |
{ | { |
_rep->message.append(MessageLoader.getMessage(msgParms)); |
|
} | } |
*/ |
|
| |
|
/* |
InvalidNameException::InvalidNameException(const String& name) | InvalidNameException::InvalidNameException(const String& name) |
: Exception("invalid CIM name: " + name) | : Exception("invalid CIM name: " + name) |
{ | { |
} | } |
|
*/ |
| |
/* |
|
InvalidNameException::InvalidNameException(const String& message) | InvalidNameException::InvalidNameException(const String& message) |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.INVALID_NAME_EXCEPTION", |
"invalid CIM name: ", |
"invalid CIM name: $0", |
message)) | message)) |
{ | { |
} | } |
| |
InvalidNameException::InvalidNameException(const MessageLoaderParms& msgParms) |
InvalidNameException::InvalidNameException(MessageLoaderParms& msgParms) |
: Exception(MessageLoaderParms("key2", |
: Exception(MessageLoaderParms("Common.Exception.INVALID_NAME_EXCEPTION", |
"invalid CIM name: ")) |
"invalid CIM name: $0", |
|
MessageLoader::getMessage(msgParms))) |
{ | { |
_rep->message.append(MessageLoader.getMessage(msgParms)); |
|
} | } |
*/ |
|
| |
|
/* |
InvalidNamespaceNameException::InvalidNamespaceNameException(const String& name) | InvalidNamespaceNameException::InvalidNamespaceNameException(const String& name) |
: Exception("invalid CIM namespace name: " + name) | : Exception("invalid CIM namespace name: " + name) |
{ | { |
} | } |
|
*/ |
|
|
| |
/* |
|
InvalidNamespaceNameException::InvalidNamespaceNameException(const String& name) | InvalidNamespaceNameException::InvalidNamespaceNameException(const String& name) |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.INVALID_NAMESACE_NAME_EXCEPTION", |
"invalid CIM namespace name: ", |
"invalid CIM namespace name: $0", |
name)) | name)) |
{ | { |
} | } |
| |
InvalidNamespaceNameException::InvalidNamespaceNameException(const MessageLoaderParms& msgParms) |
InvalidNamespaceNameException::InvalidNamespaceNameException(MessageLoaderParms& msgParms) |
: Exception(MessageLoaderParms("key2", |
: Exception(MessageLoaderParms("Common.Exception.INVALID_NAMESPACE_NAME_EXCEPTION", |
"invalid CIM namespace name: ")) |
"invalid CIM namespace name: $0", |
|
MessageLoader::getMessage(msgParms))) |
{ | { |
_rep->message.append(MessageLoader.getMessage(msgParms)); |
|
} | } |
*/ |
|
| |
|
/* |
UninitializedObjectException::UninitializedObjectException() | UninitializedObjectException::UninitializedObjectException() |
: Exception("uninitialized object") | : Exception("uninitialized object") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
UninitializedObjectException::UninitializedObjectException() | UninitializedObjectException::UninitializedObjectException() |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", |
"uninitialized object")) | "uninitialized object")) |
{ | { |
} | } |
*/ |
|
| |
|
/* |
TypeMismatchException::TypeMismatchException() | TypeMismatchException::TypeMismatchException() |
: Exception("type mismatch") | : Exception("type mismatch") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
TypeMismatchException::TypeMismatchException() | TypeMismatchException::TypeMismatchException() |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.TYPE_MISMATCH_EXCEPTION", |
"type mismatch")) | "type mismatch")) |
{ | { |
} | } |
*/ |
|
| |
|
TypeMismatchException::TypeMismatchException(const String& message) |
|
: Exception(MessageLoaderParms("Common.Exception.TYPE_MISMATCH_EXCEPTION", |
|
"type mismatch: $0",message)) |
|
{ |
|
|
|
} |
|
|
|
TypeMismatchException::TypeMismatchException(MessageLoaderParms& msgParms) |
|
: Exception(MessageLoaderParms("Common.Exception.TYPE_MISMATCH_EXCEPTION", |
|
"type mismatch: $0", |
|
MessageLoader::getMessage(msgParms))) |
|
{ |
|
} |
|
|
|
/* |
DynamicCastFailedException::DynamicCastFailedException() | DynamicCastFailedException::DynamicCastFailedException() |
: Exception("dynamic cast failed") | : Exception("dynamic cast failed") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
DynamicCastFailedException::DynamicCastFailedException() | DynamicCastFailedException::DynamicCastFailedException() |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.DYNAMIC_CAST_FAILED_EXCEPTION", |
"dynamic cast failed")) | "dynamic cast failed")) |
{ | { |
} | } |
*/ |
|
| |
|
/* |
InvalidDateTimeFormatException::InvalidDateTimeFormatException() | InvalidDateTimeFormatException::InvalidDateTimeFormatException() |
: Exception("invalid datetime format") | : Exception("invalid datetime format") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
InvalidDateTimeFormatException::InvalidDateTimeFormatException() | InvalidDateTimeFormatException::InvalidDateTimeFormatException() |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.INVALID_DATETIME_FORMAT_EXCEPTION", |
"invalid datetime format")) | "invalid datetime format")) |
{ | { |
} | } |
*/ |
|
| |
|
/* |
MalformedObjectNameException::MalformedObjectNameException( | MalformedObjectNameException::MalformedObjectNameException( |
const String& objectName) | const String& objectName) |
: Exception("malformed object name: " + objectName) | : Exception("malformed object name: " + objectName) |
{ | { |
} | } |
|
*/ |
| |
/* |
|
MalformedObjectNameException::MalformedObjectNameException(const String& message) | MalformedObjectNameException::MalformedObjectNameException(const String& message) |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.MALFORMED_OBJECT_NAME_EXCEPTION", |
"malformed object name: ", |
"malformed object name: $0", |
message)) | message)) |
{ | { |
} | } |
| |
MalformedObjectNameException::MalformedObjectNameException(const MessageLoaderParms& msgParms) |
MalformedObjectNameException::MalformedObjectNameException(MessageLoaderParms& msgParms) |
: Exception(MessageLoaderParms("key2", |
: Exception(MessageLoaderParms("Common.Exception.MALFORMED_OBJECT_NAME_EXCEPTION", |
"malformed object name: ")) |
"malformed object name: $0", |
|
MessageLoader::getMessage(msgParms))) |
{ | { |
_rep->message.append(MessageLoader.getMessage(msgParms)); |
|
} | } |
*/ |
|
| |
|
/* |
BindFailedException::BindFailedException(const String& message) | BindFailedException::BindFailedException(const String& message) |
: Exception("Bind failed: " + message) | : Exception("Bind failed: " + message) |
{ | { |
} | } |
|
*/ |
| |
/* |
|
BindFailedException::BindFailedException(const String& message) | BindFailedException::BindFailedException(const String& message) |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.BIND_FAILED_EXCEPTION", |
"Bind failed: ", |
"Bind failed: $0", |
message)) | message)) |
{ | { |
} | } |
| |
BindFailedException::BindFailedException(const MessageLoaderParms& msgParms) |
BindFailedException::BindFailedException(MessageLoaderParms& msgParms) |
: Exception(MessageLoaderParms("key2", |
: Exception(MessageLoaderParms("Common.Exception.BIND_FAILED_EXCEPTION", |
"Bind failed: ")) |
"Bind failed: $0", |
|
MessageLoader::getMessage(msgParms))) |
{ | { |
_rep->message.append(MessageLoader.getMessage(msgParms)); |
|
} | } |
*/ |
|
| |
|
/* |
InvalidLocatorException::InvalidLocatorException(const String& locator) | InvalidLocatorException::InvalidLocatorException(const String& locator) |
: Exception("Invalid locator: " + locator) | : Exception("Invalid locator: " + locator) |
{ | { |
} | } |
|
*/ |
| |
/* |
|
InvalidLocatorException::InvalidLocatorException(const String& message) | InvalidLocatorException::InvalidLocatorException(const String& message) |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.INVALID_LOCATOR_EXCEPTION", |
"Invalid locator: ", |
"Invalid locator: $0", |
message)) | message)) |
{ | { |
} | } |
| |
InvalidLocatorException::InvalidLocatorException(const MessageLoaderParms& msgParms) |
InvalidLocatorException::InvalidLocatorException(MessageLoaderParms& msgParms) |
: Exception(MessageLoaderParms("key2", |
: Exception(MessageLoaderParms("Common.Exception.INVALID_LOCATOR_EXCEPTION", |
"Invalid locator: ")) |
"Invalid locator: $0", |
|
MessageLoader::getMessage(msgParms))) |
{ | { |
_rep->message.append(MessageLoader.getMessage(msgParms)); |
|
} | } |
*/ |
|
| |
|
/* |
CannotCreateSocketException::CannotCreateSocketException() | CannotCreateSocketException::CannotCreateSocketException() |
: Exception("Cannot create socket") | : Exception("Cannot create socket") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
CannotCreateSocketException::CannotCreateSocketException() | CannotCreateSocketException::CannotCreateSocketException() |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.CANNOT_CREATE_SOCKET_EXCEPTION", |
"Cannot create socket")) | "Cannot create socket")) |
{ | { |
} | } |
*/ |
|
| |
CannotConnectException::CannotConnectException(const String& message) |
|
|
CannotConnectException::CannotConnectException(const String& message)//??? |
: Exception(message) | : Exception(message) |
{ | { |
} | } |
/* |
|
CannotConnectException::CannotConnectException(const MessageLoaderParms& msgParms) |
|
|
CannotConnectException::CannotConnectException(MessageLoaderParms& msgParms) |
: Exception(msgParms) | : Exception(msgParms) |
{ | { |
} | } |
*/ |
|
| |
|
/* |
AlreadyConnectedException::AlreadyConnectedException() | AlreadyConnectedException::AlreadyConnectedException() |
: Exception("already connected") | : Exception("already connected") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
AlreadyConnectedException::AlreadyConnectedException() | AlreadyConnectedException::AlreadyConnectedException() |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.ALREADY_CONNECTED_EXCEPTION", |
"already connected")) | "already connected")) |
{ | { |
} | } |
*/ |
|
| |
|
/* |
NotConnectedException::NotConnectedException() | NotConnectedException::NotConnectedException() |
: Exception("not connected") | : Exception("not connected") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
NotConnectedException::NotConnectedException() | NotConnectedException::NotConnectedException() |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.NOT_CONNECTED_EXCEPTION", |
"not connected")) | "not connected")) |
{ | { |
} | } |
*/ |
|
| |
|
/* |
ConnectionTimeoutException::ConnectionTimeoutException() | ConnectionTimeoutException::ConnectionTimeoutException() |
: Exception("connection timed out") | : Exception("connection timed out") |
{ | { |
} | } |
|
*/ |
| |
/* |
|
ConnectionTimeoutException::ConnectionTimeoutException() | ConnectionTimeoutException::ConnectionTimeoutException() |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.CONNECTION_TIMEOUT_EXCEPTION", |
"connection timed out")) | "connection timed out")) |
{ | { |
} | } |
*/ |
|
| |
|
/* |
SSLException::SSLException(const String& message) | SSLException::SSLException(const String& message) |
: Exception("SSL Exception: " + message) | : Exception("SSL Exception: " + message) |
{ | { |
} | } |
|
*/ |
| |
/* |
|
SSLException::SSLException(const String& message) | SSLException::SSLException(const String& message) |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.SSL_EXCEPTION", |
"SSL Exception: " , |
"SSL Exception: $0" , |
message)) | message)) |
{ | { |
} | } |
| |
SSLException::SSLException(const MessageLoaderParms& msgParms) |
SSLException::SSLException(MessageLoaderParms& msgParms) |
: Exception(MessageLoaderParms("key2", |
: Exception(MessageLoaderParms("Common.Exception.SSL_EXCEPTION", |
"SSL Exception: " )) |
"SSL Exception: $0", |
|
MessageLoader::getMessage(msgParms))) |
{ | { |
_rep->message.append(MessageLoader.getMessage(msgParms)); |
|
} | } |
*/ |
|
| |
|
/* |
DateTimeOutOfRangeException::DateTimeOutOfRangeException(const String& message) | DateTimeOutOfRangeException::DateTimeOutOfRangeException(const String& message) |
: Exception("DateTime is out of range : " + message) | : Exception("DateTime is out of range : " + message) |
{ | { |
} | } |
|
*/ |
| |
/* |
|
DateTimeOutOfRangeException::DateTimeOutOfRangeException(const String& message) | DateTimeOutOfRangeException::DateTimeOutOfRangeException(const String& message) |
: Exception(MessageLoaderParms("key1", |
: Exception(MessageLoaderParms("Common.Exception.DATETIME_OUT_OF_RANGE_EXCEPTION", |
"DateTime is out of range : " , |
"DateTime is out of range : $0" , |
message)) | message)) |
{ | { |
} | } |
| |
DateTimeOutOfRangeException::DateTimeOutOfRangeException(const MessageLoaderParms& msgParms) |
DateTimeOutOfRangeException::DateTimeOutOfRangeException(MessageLoaderParms& msgParms) |
: Exception(MessageLoaderParms("key2", |
: Exception(MessageLoaderParms("Common.Exception.DATETIME_OUT_OF_RANGE_EXCEPTION", |
"DateTime is out of range : " )) |
"DateTime is out of range : $0", |
|
MessageLoader::getMessage(msgParms))) |
{ | { |
_rep->message.append(MessageLoader.getMessage(msgParms)); |
|
} | } |
*/ |
|
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
|
|
tmp->code = code; | tmp->code = code; |
tmp->file = ""; | tmp->file = ""; |
tmp->line = 0; | tmp->line = 0; |
tmp->contentLanguages = ContentLanguages::EMPTY; |
tmp->contentLanguages.clear(); |
tmp->cimMessage = String::EMPTY; | tmp->cimMessage = String::EMPTY; |
_rep = tmp; | _rep = tmp; |
} | } |
|
|
| |
CIMException& CIMException::operator=(const CIMException & cimException) | CIMException& CIMException::operator=(const CIMException & cimException) |
{ | { |
|
if (&cimException != this) |
|
{ |
CIMExceptionRep* left; | CIMExceptionRep* left; |
CIMExceptionRep* right; | CIMExceptionRep* right; |
left = reinterpret_cast<CIMExceptionRep*>(this->_rep); | left = reinterpret_cast<CIMExceptionRep*>(this->_rep); |
|
|
left->code = right->code; | left->code = right->code; |
left->file = right->file; | left->file = right->file; |
left->line = right->line; | left->line = right->line; |
|
} |
return *this; | return *this; |
} | } |
| |