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/ExceptionHolder.h"
00032
00033 namespace qpid {
00034 namespace framing {
00035
00036
00043 struct UnauthorizedAccessException:
00044 SessionException
00045 {
00046 std::string getPrefix() const { return "unauthorized-access"; }
00047 UnauthorizedAccessException(const std::string& msg=std::string()) : SessionException(403, ""+msg) {}
00048 };
00049
00055 struct NotFoundException:
00056 SessionException
00057 {
00058 std::string getPrefix() const { return "not-found"; }
00059 NotFoundException(const std::string& msg=std::string()) : SessionException(404, ""+msg) {}
00060 };
00061
00068 struct ResourceLockedException:
00069 SessionException
00070 {
00071 std::string getPrefix() const { return "resource-locked"; }
00072 ResourceLockedException(const std::string& msg=std::string()) : SessionException(405, ""+msg) {}
00073 };
00074
00080 struct PreconditionFailedException:
00081 SessionException
00082 {
00083 std::string getPrefix() const { return "precondition-failed"; }
00084 PreconditionFailedException(const std::string& msg=std::string()) : SessionException(406, ""+msg) {}
00085 };
00086
00092 struct ResourceDeletedException:
00093 SessionException
00094 {
00095 std::string getPrefix() const { return "resource-deleted"; }
00096 ResourceDeletedException(const std::string& msg=std::string()) : SessionException(408, ""+msg) {}
00097 };
00098
00104 struct IllegalStateException:
00105 SessionException
00106 {
00107 std::string getPrefix() const { return "illegal-state"; }
00108 IllegalStateException(const std::string& msg=std::string()) : SessionException(409, ""+msg) {}
00109 };
00110
00116 struct CommandInvalidException:
00117 SessionException
00118 {
00119 std::string getPrefix() const { return "command-invalid"; }
00120 CommandInvalidException(const std::string& msg=std::string()) : SessionException(503, ""+msg) {}
00121 };
00122
00128 struct ResourceLimitExceededException:
00129 SessionException
00130 {
00131 std::string getPrefix() const { return "resource-limit-exceeded"; }
00132 ResourceLimitExceededException(const std::string& msg=std::string()) : SessionException(506, ""+msg) {}
00133 };
00134
00141 struct NotAllowedException:
00142 SessionException
00143 {
00144 std::string getPrefix() const { return "not-allowed"; }
00145 NotAllowedException(const std::string& msg=std::string()) : SessionException(530, ""+msg) {}
00146 };
00147
00155 struct IllegalArgumentException:
00156 SessionException
00157 {
00158 std::string getPrefix() const { return "illegal-argument"; }
00159 IllegalArgumentException(const std::string& msg=std::string()) : SessionException(531, ""+msg) {}
00160 };
00161
00167 struct NotImplementedException:
00168 SessionException
00169 {
00170 std::string getPrefix() const { return "not-implemented"; }
00171 NotImplementedException(const std::string& msg=std::string()) : SessionException(540, ""+msg) {}
00172 };
00173
00180 struct InternalErrorException:
00181 SessionException
00182 {
00183 std::string getPrefix() const { return "internal-error"; }
00184 InternalErrorException(const std::string& msg=std::string()) : SessionException(541, ""+msg) {}
00185 };
00186
00194 struct InvalidArgumentException:
00195 SessionException
00196 {
00197 std::string getPrefix() const { return "invalid-argument"; }
00198 InvalidArgumentException(const std::string& msg=std::string()) : SessionException(542, ""+msg) {}
00199 };
00200
00207 struct ConnectionForcedException:
00208 ConnectionException
00209 {
00210 std::string getPrefix() const { return "connection-forced"; }
00211 ConnectionForcedException(const std::string& msg=std::string()) : ConnectionException(320, ""+msg) {}
00212 };
00213
00219 struct InvalidPathException:
00220 ConnectionException
00221 {
00222 std::string getPrefix() const { return "invalid-path"; }
00223 InvalidPathException(const std::string& msg=std::string()) : ConnectionException(402, ""+msg) {}
00224 };
00225
00231 struct FramingErrorException:
00232 ConnectionException
00233 {
00234 std::string getPrefix() const { return "framing-error"; }
00235 FramingErrorException(const std::string& msg=std::string()) : ConnectionException(501, ""+msg) {}
00236 };
00237
00243 struct SessionBusyException:
00244 ChannelException
00245 {
00246 std::string getPrefix() const { return "session-busy"; }
00247 SessionBusyException(const std::string& msg=std::string()) : ChannelException(1, ""+msg) {}
00248 };
00249
00255 struct TransportBusyException:
00256 ChannelException
00257 {
00258 std::string getPrefix() const { return "transport-busy"; }
00259 TransportBusyException(const std::string& msg=std::string()) : ChannelException(2, ""+msg) {}
00260 };
00261
00267 struct NotAttachedException:
00268 ChannelException
00269 {
00270 std::string getPrefix() const { return "not-attached"; }
00271 NotAttachedException(const std::string& msg=std::string()) : ChannelException(3, ""+msg) {}
00272 };
00273
00279 struct UnknownIdsException:
00280 ChannelException
00281 {
00282 std::string getPrefix() const { return "unknown-ids"; }
00283 UnknownIdsException(const std::string& msg=std::string()) : ChannelException(4, ""+msg) {}
00284 };
00285
00286 void throwExecutionException(int code, const std::string& text);
00287 void setExecutionException(ExceptionHolder& holder, int code, const std::string& text);
00288
00289 }}
00290
00291 #endif