util/Constants.cpp

Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------------
00002 Name:      Constants.cpp
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 Comment:   Holding some constants, see Constants.h for a description
00006 -----------------------------------------------------------------------------*/
00007 #if defined(_WINDOWS)
00008 #pragma warning(disable:4786)
00009 #endif
00010 
00011 
00012 #include <util/Constants.h>
00013 
00014 
00015 namespace org { namespace xmlBlaster {
00016   namespace util { namespace Constants {
00017 
00018 const char * DEFAULT_SECURITYPLUGIN_TYPE = "htpasswd";
00019 const char * DEFAULT_SECURITYPLUGIN_VERSION = "1.0";
00020 
00021 long XMLBLASTER_OID_ROOT[] = { 1, 3, 6, 1, 4, 1, XMLBLASTER_SNMP }; // 11662
00022 
00023 const char * STATE_OK = "OK";
00024 const char * RET_OK = "<qos><state id='OK'/></qos>";
00025 
00026 const char * STATE_TIMEOUT = "TIMEOUT";
00027 const char * STATE_ERASED = "ERASED";
00028 const char * STATE_FORWARD_ERROR = "FORWARD_ERROR";
00029 
00030 const char * INFO_QUEUED = "QUEUED";
00031 
00032 const std::string ENTRY_TYPE_MSG_RAW = "MSG_RAW"; // msgUnit is dumped as specified in the protocol.socket requirement (see C persistent queue)
00033 
00034 const char * RELATING_CALLBACK   = "callback";
00035 const char * RELATING_SUBJECT    = "subject";
00036 const char * RELATING_UNRELATED  = "unrelated";
00037 const std::string RELATING_CLIENT     = "connection";
00038 const char * RELATING_HISTORY    = "history";
00039 const char * RELATING_MSGUNITSTORE="msgUnitStore";
00040 const char * RELATING_TOPICSTORE = "topicStore";
00041 
00042 const char * ONOVERFLOW_BLOCK = "block";
00043 const char * ONOVERFLOW_DEADLETTER = "deadLetter";
00044 const char * ONOVERFLOW_DISCARD = "discard";
00045 const char * ONOVERFLOW_DISCARDOLDEST = "discardOldest";
00046 const char * ONOVERFLOW_EXCEPTION = "exception";
00047 const char * ONOVERFLOW_DEADMESSAGE = "deadMessage";
00048 const char * ONEXHAUST_KILL_SESSION = "killSession";
00049 
00053 const char* SUBSCRIPTIONID_CLIENT_PREFIX    = "__subId:/node/";
00054 const char* INTERNAL_OID_PREFIX_FOR_PLUGINS = "_";
00055 const char* INTERNAL_OID_ADMIN_CMD          = "__cmd:";
00056 const char* INTERNAL_OID_PREFIX_FOR_CORE    = "__";
00057 const char* INTERNAL_OID_PREFIX             = "__sys__";  // Should be replaced by INTERNAL_OID_PREFIX_FOR_CORE in future
00058 const char* INTERNAL_OID_CLUSTER_PREFIX     = "__sys__cluster";  // "__sys__cluster"
00059 
00060 const char * JDBC_OID = "__sys__jdbc";
00061 
00062 const char * OID_DEAD_LETTER = "__sys__deadLetter";
00063 
00064 const char * XPATH = "XPATH";
00065 const char * EXACT = "EXACT";
00066 //const char * DOMAIN = "DOMAIN"; // doesn't compile with g++ 3.1.1
00067 const char * D_O_M_A_I_N = "DOMAIN";
00068 const char * REGEX       = "REGEX";
00069 
00070 const char * XPATH_URL_PREFIX = "xpath:";
00071 const char * EXACT_URL_PREFIX = "exact:";
00072 const char * DOMAIN_URL_PREFIX = "domain:";
00073 
00074 const char * SOCKET  = "SOCKET";
00075 const char * IOR     = "IOR";
00076 const char * EMAIL   = "EMAIL";
00077 const char * XML_RPC = "XMLRPC";
00078 
00079 const char * RAM = "RAM";
00080 const char * CACHE = "CACHE";
00081 const char * ODBC = "ODBC";
00082 const char * SQLITE = "SQLite";
00083 
00084 const char * INDENT  = " ";
00085 const char * OFFSET  = "\n ";
00086 
00087 const char * ENCODING_BASE64  = "base64";
00088 const char * ENCODING_NONE  = "";
00089 
00090 const char * TYPE_STRING = "String"; // is default
00091 const char * TYPE_BLOB = "byte[]";
00092 const char * TYPE_BOOLEAN = "boolean";
00093 const char * TYPE_BYTE = "byte";
00094 const char * TYPE_DOUBLE = "double";
00095 const char * TYPE_FLOAT = "float";
00096 const char * TYPE_INT = "int";
00097 const char * TYPE_SHORT = "short";
00098 const char * TYPE_LONG = "long";
00099 
00100 const Timestamp THOUSAND = 1000;
00101 const Timestamp MILLION  = 1000 * THOUSAND;
00102 const Timestamp BILLION  = 1000 * MILLION;
00103 
00105 const char* SESSIONID_PREFIX = "sessionId:";
00106 const char* SUBSCRIPTIONID_PREFIX = "__subId:";
00107 const char* const SUBSCRIPTIONID_PtP = "__subId:PtP";
00108 
00109 
00110 const char* XB_GLOBAL_KEY = "XB_Global"; // For registration with lifetime manager
00111 const char* XB_XMLPARSERFACTORY_KEY = "XB_XmlParserFactory"; // For registration with lifetime manager
00112 
00113 const char* JMS_PREFIX = "__jms:";
00114 const char* JMSX_GROUP_ID = "__jms:JMSXGroupID";
00115 const char* JMSX_GROUP_SEQ = "__jms:JMSXGroupSeq";
00116 const char* JMSX_GROUP_EOF = "__jms:JMSXGroupEof";
00117 const char* JMSX_GROUP_EX = "__jms:JMSXGroupEx";
00118 
00119 const char* FILENAME_ATTR = "_filename";
00120 const char* TIMESTAMP_ATTR = "_timestamp";
00121 const char* FILE_DATE = "_fileDate";
00122 
00123 /*
00124 const int getPriority(string prio, int defaultPriority)
00125 {
00126   if (prio != null) {
00127      prio = prio.trim();
00128      try {
00129         return new Integer(prio).intValue();
00130      } catch (NumberFormatException e) {
00131         prio = prio.toUpperCase();
00132         if (prio.startsWith("MIN"))
00133            return Constants.MIN_PRIORITY;
00134         else if (prio.startsWith("LOW"))
00135            return Constants.LOW_PRIORITY;
00136         else if (prio.startsWith("NORM"))
00137            return Constants.NORM_PRIORITY;
00138         else if (prio.startsWith("HIGH"))
00139            return Constants.HIGH_PRIORITY;
00140         else if (prio.startsWith("MAX"))
00141            return Constants.MAX_PRIORITY;
00142         else
00143            Global.instance().getLog("org.xmlBlaster").warn(ME, "Wrong format of <priority>" + prio +
00144                 "</priority>, expected a number between (inclusiv) 0 - 9, setting to message priority to "
00145                 + defaultPriority);
00146      }
00147   }
00148   if (defaultPriority < Constants.MIN_PRIORITY || defaultPriority > Constants.MAX_PRIORITY) {
00149       Global.instance().getLog("org.xmlBlaster").warn(ME, "Wrong message defaultPriority=" + defaultPriority + " given, setting to NORM_PRIORITY");
00150       return Constants.NORM_PRIORITY;
00151   }
00152   return defaultPriority;
00153 }
00154 */
00155 
00156 }}}} // namespace 
00157 
00158