00001 /*------------------------------------------------------------------------------ 00002 Name: ErrorCode.h 00003 Project: xmlBlaster.org 00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file 00005 Comment: Basic xmlBlaster exception ErrorCode definitions. 00006 ------------------------------------------------------------------------------*/ 00007 00042 #ifndef _UTIL_ERRORCODE_H 00043 #define _UTIL_ERRORCODE_H 00044 00045 #include <string> 00046 #include <util/Timestamp.h> 00047 00048 namespace org { namespace xmlBlaster { namespace util { 00049 00050 struct Dll_Export ErrorCode { 00051 std::string errorCode; 00052 std::string description; 00053 ErrorCode(const std::string &ec, const std::string &desc) 00054 : errorCode(ec), description(desc) 00055 { 00056 } 00057 }; 00058 00059 const ErrorCode LEGACY("legacy", 00060 std::string("This error code marks all old style org::xmlBlaster::util::XmlBlasterExceptions ") + 00061 std::string("until they are ported to the new behaviour.") 00062 ); 00063 00064 const ErrorCode INTERNAL_UNKNOWN("internal.unknown", 00065 std::string("This is an unknown and unexpected error, usually a runtime ") + 00066 std::string("exception, please post it to the mailing list.") 00067 ); 00068 00069 const ErrorCode INTERNAL_NULLPOINTER("internal.nullpointer", 00070 std::string("A null pointer is an xmlBlaster internal programming error, ") + 00071 std::string("please post it to the mailing list.") 00072 ); 00073 00074 const ErrorCode INTERNAL_ILLEGALARGUMENT("internal.illegalArgument", 00075 std::string("An illegal argument is an xmlBlaster internal programming ") + 00076 std::string("error, please post it to the mailing list.") 00077 ); 00078 00079 const ErrorCode INTERNAL_NOTIMPLEMENTED("internal.notImplemented", 00080 std::string("The feature is not implemented yet.") 00081 ); 00082 00083 const ErrorCode INTERNAL_CONNECTIONFAILURE("internal.connectionFailure", 00084 std::string("An internal error occurred, we were not able to access the ") + 00085 std::string("server handle.") 00086 ); 00087 00088 const ErrorCode INTERNAL_DISCONNECT("internal.disconnect", 00089 std::string("An internal error occurred when processing a disconnect() request.") 00090 ); 00091 00092 const ErrorCode INTERNAL_SUBSCRIBE("internal.subscribe", 00093 "An internal error occurred when processing a subscribe() request." 00094 ); 00095 00096 const ErrorCode INTERNAL_UNSUBSCRIBE("internal.unSubscribe", 00097 "An internal error occurred when processing an unSubscribe() request." 00098 ); 00099 00100 const ErrorCode INTERNAL_PUBLISH("internal.publish", 00101 "An internal error occurred when processing a publish() request." 00102 ); 00103 00104 const ErrorCode INTERNAL_ERASE("internal.erase", 00105 "An internal error occurred when processing a erase() request." 00106 ); 00107 00108 const ErrorCode INTERNAL_GET("internal.get", 00109 "An internal error occurred when processing a get() request." 00110 ); 00111 00112 const ErrorCode RESOURCE_OUTOFMEMORY("resource.outOfMemory", 00113 std::string("The JVM has no more RAM memory, try increasing it like 'java ") + 00114 std::string("-Xms18M -Xmx256M org.xmlBlaster.Main'") 00115 ); 00116 00117 const ErrorCode RESOURCE_TOO_MANY_THREADS("resource.tooManyThreads", 00118 std::string("The number of threads used is exceeded, try increasing the ") + 00119 std::string("number of threads in the properties") 00120 ); 00121 00122 const ErrorCode RESOURCE_CALLBACKSERVER_CREATION("resource.callbackServer.creation", 00123 "The callback server can't be created" 00124 ); 00125 00126 const ErrorCode RESOURCE_OVERFLOW_QUEUE_BYTES("resource.overflow.queue.bytes", 00127 "The maximum size in bytes of a queue is exhausted" 00128 ); 00129 00130 const ErrorCode RESOURCE_OVERFLOW_QUEUE_ENTRIES("resource.overflow.queue.entries", 00131 "The maximum number of entries of a queue is exhausted" 00132 ); 00133 00134 const ErrorCode RESOURCE_DB_UNAVAILABLE("resource.db.unavailable", 00135 "There is no connection to a backend database using JDBC" 00136 ); 00137 00138 const ErrorCode RESOURCE_CONFIGURATION_PLUGINFAILED("resource.configuration.pluginFailed", 00139 "A plugin required couldn't be loaded, please check your configuration." 00140 ); 00141 00142 const ErrorCode RESOURCE_CONFIGURATION_ADDRESS("resource.configuration.address", 00143 "A remote address you passed is invalid, please check your configuration." 00144 ); 00145 00146 const ErrorCode RESOURCE_FILEIO("resource.fileIO", "A file access failed."); 00147 00148 const ErrorCode RESOURCE_FILEIO_FILELOST("resource.fileIO.fileLost", 00149 "A file disappeared, access failed." 00150 ); 00151 00152 const ErrorCode RESOURCE_CLUSTER_NOTAVAILABLE("resource.cluster.notAvailable", 00153 "A remote cluster node is not reachable." 00154 ); 00155 00156 const ErrorCode COMMUNICATION_NOCONNECTION("communication.noConnection", 00157 "A method invocation on a remote connection failed." 00158 ); 00159 00160 const ErrorCode COMMUNICATION_TIMEOUT("communication.timeout", 00161 "The socket call blocked until a timeout occurred." 00162 ); 00163 00164 const ErrorCode COMMUNICATION_RESPONSETIMEOUT("communication.responseTimeout", 00165 "A method call blocked when waiting on the ACK/NAK return message." 00166 ); 00167 00168 const ErrorCode COMMUNICATION_NOCONNECTION_POLLING("communication.noConnection.polling", 00169 "The remote connection is not established and we are currently polling for it." 00170 ); 00171 00172 const ErrorCode COMMUNICATION_NOCONNECTION_DEAD("communication.noConnection.dead", 00173 "The remote connection is not established and we have given up to poll for it." 00174 ); 00175 00176 const ErrorCode USER_WRONG_API_USAGE("user.wrongApiUsage", 00177 "Please check your code." 00178 ); 00179 00180 const ErrorCode USER_CONFIGURATION("user.configuration", 00181 "Login to xmlBlaster failed due to configuration problems." 00182 ); 00183 00184 const ErrorCode USER_SECURITY_AUTHENTICATION_ACCESSDENIED("user.security.authentication.accessDenied", 00185 "Login to xmlBlaster failed due to missing privileges." 00186 ); 00187 00188 const ErrorCode USER_SECURITY_AUTHENTICATION_ILLEGALARGUMENT("user.security.authentication.illegalArgument", 00189 "Login to xmlBlaster failed due to illegal arguments." 00190 ); 00191 00192 const ErrorCode USER_SECURITY_AUTHORIZATION_NOTAUTHORIZED("user.security.authorization.notAuthorized", 00193 "Login to xmlBlaster failed due to missing privileges." 00194 ); 00195 00196 const ErrorCode USER_UPDATE_ERROR("user.update.error", 00197 "Exception thrown by client on callback update invocation." 00198 ); 00199 00200 const ErrorCode USER_UPDATE_INTERNALERROR("user.update.internalError", 00201 "Unexpected exception thrown by client code on programming error." 00202 ); 00203 00204 const ErrorCode USER_UPDATE_ILLEGALARGUMENT("user.update.illegalArgument", 00205 "The update method was invoked without useful data." 00206 ); 00207 00208 const ErrorCode USER_ILLEGALARGUMENT("user.illegalArgument", 00209 "You have invoked a server method with illegal arguments." 00210 ); 00211 00212 const ErrorCode USER_UPDATE_HOLDBACK("user.update.holdback", 00213 "You can throw this on client side in your update() method: Like this the server queues the message and sets the dispatcActive to false. You need to manually activate the dispatcher again." 00214 ); 00215 00216 const ErrorCode USER_UPDATE_SECURITY_AUTHENTICATION_ACCESSDENIED("user.update.security.authentication.accessDenied", 00217 "The update method was invoked with an invalid callback session ID." 00218 ); 00219 00220 const ErrorCode USER_OID_UNKNOWN("user.oid.unknown", 00221 "You passed a message oid which is not known." 00222 ); 00223 00224 const ErrorCode USER_JDBC_INVALID("user.jdbc.invalid", 00225 "You have invoked get() with an illegal JDBC query." 00226 ); 00227 00228 const ErrorCode USER_PUBLISH("user.publish", 00229 "Your published message could not be handled, check your QoS" 00230 ); 00231 00232 const ErrorCode USER_SUBSCRIBE_ID("user.subscribe.id", 00233 "Your subscription tries to pass an illegal subscriptionId." 00234 ); 00235 00236 const ErrorCode USER_CONNECT("user.connect", 00237 "Your connection request could not be handled, check your QoS" 00238 ); 00239 00240 const ErrorCode USER_PTP_UNKNOWNSESSION("user.ptp.unknownSession", 00241 std::string("You have send a point to point message to a specific user ") + 00242 std::string("session but the receiver is not known.") 00243 ); 00244 00245 const ErrorCode USER_PTP_UNKNOWNDESTINATION("user.ptp.unknownDestination", 00246 std::string("You have send a point to point message but the receiver is not ") + 00247 std::string("known and <destination forceQueuing='true'> is not set.") 00248 ); 00249 00250 const ErrorCode USER_QUERY_TYPE_INVALID("user.query.type.invalid", 00251 std::string("You have invoked get(), subscribe(), unSubscribe() or erase() ") + 00252 std::string("with an illegal query type, try EXACT or XPATH.") 00253 ); 00254 00255 const ErrorCode USER_NOT_CONNECTED("user.notConnected", 00256 "Your operation is not possible, please login with connect() first" 00257 ); 00258 00259 00260 }}} // namespaces 00261 00262 #endif