00001 #ifndef QPID_FRAMING_REPLY_EXCEPTIONS_H
00002 #define QPID_FRAMING_REPLY_EXCEPTIONS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028
00029
00030 #include "qpid/Exception.h"
00031 #include "qpid/sys/ExceptionHolder.h"
00032 #include "qpid/framing/enum.h"
00033 #include "qpid/CommonImportExport.h"
00034
00035 namespace qpid {
00036 namespace framing {
00037
00038
00039 struct UnauthorizedAccessException:
00040 SessionException
00041 {
00042 std::string getPrefix() const { return "unauthorized-access"; }
00043 UnauthorizedAccessException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_UNAUTHORIZED_ACCESS, ""+msg) {}
00044 };
00045
00046 struct NotFoundException:
00047 SessionException
00048 {
00049 std::string getPrefix() const { return "not-found"; }
00050 NotFoundException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_NOT_FOUND, ""+msg) {}
00051 };
00052
00053 struct ResourceLockedException:
00054 SessionException
00055 {
00056 std::string getPrefix() const { return "resource-locked"; }
00057 ResourceLockedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_RESOURCE_LOCKED, ""+msg) {}
00058 };
00059
00060 struct PreconditionFailedException:
00061 SessionException
00062 {
00063 std::string getPrefix() const { return "precondition-failed"; }
00064 PreconditionFailedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_PRECONDITION_FAILED, ""+msg) {}
00065 };
00066
00067 struct ResourceDeletedException:
00068 SessionException
00069 {
00070 std::string getPrefix() const { return "resource-deleted"; }
00071 ResourceDeletedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_RESOURCE_DELETED, ""+msg) {}
00072 };
00073
00074 struct IllegalStateException:
00075 SessionException
00076 {
00077 std::string getPrefix() const { return "illegal-state"; }
00078 IllegalStateException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_ILLEGAL_STATE, ""+msg) {}
00079 };
00080
00081 struct CommandInvalidException:
00082 SessionException
00083 {
00084 std::string getPrefix() const { return "command-invalid"; }
00085 CommandInvalidException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_COMMAND_INVALID, ""+msg) {}
00086 };
00087
00088 struct ResourceLimitExceededException:
00089 SessionException
00090 {
00091 std::string getPrefix() const { return "resource-limit-exceeded"; }
00092 ResourceLimitExceededException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_RESOURCE_LIMIT_EXCEEDED, ""+msg) {}
00093 };
00094
00095 struct NotAllowedException:
00096 SessionException
00097 {
00098 std::string getPrefix() const { return "not-allowed"; }
00099 NotAllowedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_NOT_ALLOWED, ""+msg) {}
00100 };
00101
00102 struct IllegalArgumentException:
00103 SessionException
00104 {
00105 std::string getPrefix() const { return "illegal-argument"; }
00106 IllegalArgumentException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_ILLEGAL_ARGUMENT, ""+msg) {}
00107 };
00108
00109 struct NotImplementedException:
00110 SessionException
00111 {
00112 std::string getPrefix() const { return "not-implemented"; }
00113 NotImplementedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_NOT_IMPLEMENTED, ""+msg) {}
00114 };
00115
00116 struct InternalErrorException:
00117 SessionException
00118 {
00119 std::string getPrefix() const { return "internal-error"; }
00120 InternalErrorException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_INTERNAL_ERROR, ""+msg) {}
00121 };
00122
00123 struct InvalidArgumentException:
00124 SessionException
00125 {
00126 std::string getPrefix() const { return "invalid-argument"; }
00127 InvalidArgumentException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_INVALID_ARGUMENT, ""+msg) {}
00128 };
00129
00130 QPID_COMMON_EXTERN sys::ExceptionHolder createSessionException(int code, const std::string& text);
00131
00132 struct ConnectionForcedException:
00133 ConnectionException
00134 {
00135 std::string getPrefix() const { return "connection-forced"; }
00136 ConnectionForcedException(const std::string& msg=std::string()) : ConnectionException(connection::CLOSE_CODE_CONNECTION_FORCED, ""+msg) {}
00137 };
00138
00139 struct InvalidPathException:
00140 ConnectionException
00141 {
00142 std::string getPrefix() const { return "invalid-path"; }
00143 InvalidPathException(const std::string& msg=std::string()) : ConnectionException(connection::CLOSE_CODE_INVALID_PATH, ""+msg) {}
00144 };
00145
00146 struct FramingErrorException:
00147 ConnectionException
00148 {
00149 std::string getPrefix() const { return "framing-error"; }
00150 FramingErrorException(const std::string& msg=std::string()) : ConnectionException(connection::CLOSE_CODE_FRAMING_ERROR, ""+msg) {}
00151 };
00152
00153 QPID_COMMON_EXTERN sys::ExceptionHolder createConnectionException(int code, const std::string& text);
00154
00155 struct SessionBusyException:
00156 ChannelException
00157 {
00158 std::string getPrefix() const { return "session-busy"; }
00159 SessionBusyException(const std::string& msg=std::string()) : ChannelException(session::DETACH_CODE_SESSION_BUSY, ""+msg) {}
00160 };
00161
00162 struct TransportBusyException:
00163 ChannelException
00164 {
00165 std::string getPrefix() const { return "transport-busy"; }
00166 TransportBusyException(const std::string& msg=std::string()) : ChannelException(session::DETACH_CODE_TRANSPORT_BUSY, ""+msg) {}
00167 };
00168
00169 struct NotAttachedException:
00170 ChannelException
00171 {
00172 std::string getPrefix() const { return "not-attached"; }
00173 NotAttachedException(const std::string& msg=std::string()) : ChannelException(session::DETACH_CODE_NOT_ATTACHED, ""+msg) {}
00174 };
00175
00176 struct UnknownIdsException:
00177 ChannelException
00178 {
00179 std::string getPrefix() const { return "unknown-ids"; }
00180 UnknownIdsException(const std::string& msg=std::string()) : ChannelException(session::DETACH_CODE_UNKNOWN_IDS, ""+msg) {}
00181 };
00182
00183 QPID_COMMON_EXTERN sys::ExceptionHolder createChannelException(int code, const std::string& text);
00184
00185 }}
00186
00187 #endif