qpid/framing/reply_exceptions.h Source File

Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

qpid/framing/reply_exceptions.h
Go to the documentation of this file.

    00001 #ifndef QPID_FRAMING_REPLY_EXCEPTIONS_H
    00002 #define QPID_FRAMING_REPLY_EXCEPTIONS_H
    00003 /*
    00004  *
    00005  * Licensed to the Apache Software Foundation (ASF) under one
    00006  * or more contributor license agreements.  See the NOTICE file
    00007  * distributed with this work for additional information
    00008  * regarding copyright ownership.  The ASF licenses this file
    00009  * to you under the Apache License, Version 2.0 (the
    00010  * "License"); you may not use this file except in compliance
    00011  * with the License.  You may obtain a copy of the License at
    00012  *
    00013  *   http://www.apache.org/licenses/LICENSE-2.0
    00014  *
    00015  * Unless required by applicable law or agreed to in writing,
    00016  * software distributed under the License is distributed on an
    00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    00018  * KIND, either express or implied.  See the License for the
    00019  * specific language governing permissions and limitations
    00020  * under the License.
    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
    00045 struct UnauthorizedAccessException:
    00046     SessionException
    00047 {
    00048     std::string getPrefix() const { return "unauthorized-access"; }
    00049     UnauthorizedAccessException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_UNAUTHORIZED_ACCESS, ""+msg) {}
    00050 };
    00051
    00057 struct NotFoundException:
    00058     SessionException
    00059 {
    00060     std::string getPrefix() const { return "not-found"; }
    00061     NotFoundException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_NOT_FOUND, ""+msg) {}
    00062 };
    00063
    00070 struct ResourceLockedException:
    00071     SessionException
    00072 {
    00073     std::string getPrefix() const { return "resource-locked"; }
    00074     ResourceLockedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_RESOURCE_LOCKED, ""+msg) {}
    00075 };
    00076
    00082 struct PreconditionFailedException:
    00083     SessionException
    00084 {
    00085     std::string getPrefix() const { return "precondition-failed"; }
    00086     PreconditionFailedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_PRECONDITION_FAILED, ""+msg) {}
    00087 };
    00088
    00094 struct ResourceDeletedException:
    00095     SessionException
    00096 {
    00097     std::string getPrefix() const { return "resource-deleted"; }
    00098     ResourceDeletedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_RESOURCE_DELETED, ""+msg) {}
    00099 };
    00100
    00106 struct IllegalStateException:
    00107     SessionException
    00108 {
    00109     std::string getPrefix() const { return "illegal-state"; }
    00110     IllegalStateException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_ILLEGAL_STATE, ""+msg) {}
    00111 };
    00112
    00118 struct CommandInvalidException:
    00119     SessionException
    00120 {
    00121     std::string getPrefix() const { return "command-invalid"; }
    00122     CommandInvalidException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_COMMAND_INVALID, ""+msg) {}
    00123 };
    00124
    00130 struct ResourceLimitExceededException:
    00131     SessionException
    00132 {
    00133     std::string getPrefix() const { return "resource-limit-exceeded"; }
    00134     ResourceLimitExceededException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_RESOURCE_LIMIT_EXCEEDED, ""+msg) {}
    00135 };
    00136
    00143 struct NotAllowedException:
    00144     SessionException
    00145 {
    00146     std::string getPrefix() const { return "not-allowed"; }
    00147     NotAllowedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_NOT_ALLOWED, ""+msg) {}
    00148 };
    00149
    00157 struct IllegalArgumentException:
    00158     SessionException
    00159 {
    00160     std::string getPrefix() const { return "illegal-argument"; }
    00161     IllegalArgumentException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_ILLEGAL_ARGUMENT, ""+msg) {}
    00162 };
    00163
    00169 struct NotImplementedException:
    00170     SessionException
    00171 {
    00172     std::string getPrefix() const { return "not-implemented"; }
    00173     NotImplementedException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_NOT_IMPLEMENTED, ""+msg) {}
    00174 };
    00175
    00182 struct InternalErrorException:
    00183     SessionException
    00184 {
    00185     std::string getPrefix() const { return "internal-error"; }
    00186     InternalErrorException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_INTERNAL_ERROR, ""+msg) {}
    00187 };
    00188
    00196 struct InvalidArgumentException:
    00197     SessionException
    00198 {
    00199     std::string getPrefix() const { return "invalid-argument"; }
    00200     InvalidArgumentException(const std::string& msg=std::string()) : SessionException(execution::ERROR_CODE_INVALID_ARGUMENT, ""+msg) {}
    00201 };
    00202
    00203 QPID_COMMON_EXTERN sys::ExceptionHolder createSessionException(int code, const std::string& text);
    00204
    00211 struct ConnectionForcedException:
    00212     ConnectionException
    00213 {
    00214     std::string getPrefix() const { return "connection-forced"; }
    00215     ConnectionForcedException(const std::string& msg=std::string()) : ConnectionException(connection::CLOSE_CODE_CONNECTION_FORCED, ""+msg) {}
    00216 };
    00217
    00223 struct InvalidPathException:
    00224     ConnectionException
    00225 {
    00226     std::string getPrefix() const { return "invalid-path"; }
    00227     InvalidPathException(const std::string& msg=std::string()) : ConnectionException(connection::CLOSE_CODE_INVALID_PATH, ""+msg) {}
    00228 };
    00229
    00235 struct FramingErrorException:
    00236     ConnectionException
    00237 {
    00238     std::string getPrefix() const { return "framing-error"; }
    00239     FramingErrorException(const std::string& msg=std::string()) : ConnectionException(connection::CLOSE_CODE_FRAMING_ERROR, ""+msg) {}
    00240 };
    00241
    00242 QPID_COMMON_EXTERN sys::ExceptionHolder createConnectionException(int code, const std::string& text);
    00243
    00249 struct SessionBusyException:
    00250     ChannelException
    00251 {
    00252     std::string getPrefix() const { return "session-busy"; }
    00253     SessionBusyException(const std::string& msg=std::string()) : ChannelException(session::DETACH_CODE_SESSION_BUSY, ""+msg) {}
    00254 };
    00255
    00261 struct TransportBusyException:
    00262     ChannelException
    00263 {
    00264     std::string getPrefix() const { return "transport-busy"; }
    00265     TransportBusyException(const std::string& msg=std::string()) : ChannelException(session::DETACH_CODE_TRANSPORT_BUSY, ""+msg) {}
    00266 };
    00267
    00273 struct NotAttachedException:
    00274     ChannelException
    00275 {
    00276     std::string getPrefix() const { return "not-attached"; }
    00277     NotAttachedException(const std::string& msg=std::string()) : ChannelException(session::DETACH_CODE_NOT_ATTACHED, ""+msg) {}
    00278 };
    00279
    00285 struct UnknownIdsException:
    00286     ChannelException
    00287 {
    00288     std::string getPrefix() const { return "unknown-ids"; }
    00289     UnknownIdsException(const std::string& msg=std::string()) : ChannelException(session::DETACH_CODE_UNKNOWN_IDS, ""+msg) {}
    00290 };
    00291
    00292 QPID_COMMON_EXTERN sys::ExceptionHolder createChannelException(int code, const std::string& text);
    00293
    00294 }} // namespace qpid::framing
    00295
    00296 #endif