1 /*-----------------------------------------------------------------------------
  2 Name:      Constants.cpp
  3 Project:   xmlBlaster.org
  4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
  5 Comment:   Holding some constants, see Constants.h for a description
  6 -----------------------------------------------------------------------------*/
  7 #if defined(_WINDOWS)
  8 #pragma warning(disable:4786)
  9 #endif
 10 
 11 
 12 #include <util/Constants.h>
 13 
 14 
 15 namespace org { namespace xmlBlaster {
 16   namespace util { namespace Constants {
 17 
 18 const char * DEFAULT_SECURITYPLUGIN_TYPE = "htpasswd";
 19 const char * DEFAULT_SECURITYPLUGIN_VERSION = "1.0";
 20 
 21 long XMLBLASTER_OID_ROOT[] = { 1, 3, 6, 1, 4, 1, XMLBLASTER_SNMP }; // 11662
 22 
 23 const char * STATE_OK = "OK";
 24 const char * RET_OK = "<qos><state id='OK'/></qos>";
 25 
 26 const char * STATE_TIMEOUT = "TIMEOUT";
 27 const char * STATE_ERASED = "ERASED";
 28 const char * STATE_FORWARD_ERROR = "FORWARD_ERROR";
 29 
 30 const char * INFO_QUEUED = "QUEUED";
 31 
 32 const std::string ENTRY_TYPE_MSG_RAW = "MSG_RAW"; // msgUnit is dumped as specified in the protocol.socket requirement (see C persistent queue)
 33 
 34 const char * RELATING_CALLBACK   = "callback";
 35 const char * RELATING_SUBJECT    = "subject";
 36 const char * RELATING_UNRELATED  = "unrelated";
 37 const std::string RELATING_CLIENT     = "connection";
 38 const char * RELATING_HISTORY    = "history";
 39 const char * RELATING_MSGUNITSTORE="msgUnitStore";
 40 const char * RELATING_TOPICSTORE = "topicStore";
 41 
 42 const char * ONOVERFLOW_BLOCK = "block";
 43 const char * ONOVERFLOW_DEADLETTER = "deadLetter";
 44 const char * ONOVERFLOW_DISCARD = "discard";
 45 const char * ONOVERFLOW_DISCARDOLDEST = "discardOldest";
 46 const char * ONOVERFLOW_EXCEPTION = "exception";
 47 const char * ONOVERFLOW_DEADMESSAGE = "deadMessage";
 48 const char * ONEXHAUST_KILL_SESSION = "killSession";
 49 
 50 /** If subscription ID is given by client, e.g. "__subId:/node/heron/client/joe/3/34"
 51   * see Requirement engine.qos.subscribe.id
 52   */
 53 const char* SUBSCRIPTIONID_CLIENT_PREFIX    = "__subId:/node/";
 54 const char* INTERNAL_OID_PREFIX_FOR_PLUGINS = "_";
 55 const char* INTERNAL_OID_ADMIN_CMD          = "__cmd:";
 56 const char* INTERNAL_OID_PREFIX_FOR_CORE    = "__";
 57 const char* INTERNAL_OID_PREFIX             = "__sys__";  // Should be replaced by INTERNAL_OID_PREFIX_FOR_CORE in future
 58 const char* INTERNAL_OID_CLUSTER_PREFIX     = "__sys__cluster";  // "__sys__cluster"
 59 
 60 const char * JDBC_OID = "__sys__jdbc";
 61 
 62 const char * OID_DEAD_LETTER = "__sys__deadLetter";
 63 
 64 const char * XPATH = "XPATH";
 65 const char * EXACT = "EXACT";
 66 //const char * DOMAIN = "DOMAIN"; // doesn't compile with g++ 3.1.1
 67 const char * D_O_M_A_I_N = "DOMAIN";
 68 const char * REGEX       = "REGEX";
 69 
 70 const char * XPATH_URL_PREFIX = "xpath:";
 71 const char * EXACT_URL_PREFIX = "exact:";
 72 const char * DOMAIN_URL_PREFIX = "domain:";
 73 
 74 const char * SOCKET  = "SOCKET";
 75 const char * IOR     = "IOR";
 76 const char * EMAIL   = "EMAIL";
 77 const char * XML_RPC = "XMLRPC";
 78 
 79 const char * RAM = "RAM";
 80 const char * CACHE = "CACHE";
 81 const char * ODBC = "ODBC";
 82 const char * SQLITE = "SQLite";
 83 
 84 const char * INDENT  = " ";
 85 const char * OFFSET  = "\n ";
 86 
 87 const char * ENCODING_BASE64  = "base64";
 88 const char * ENCODING_NONE  = "";
 89 
 90 const char * TYPE_STRING = "String"; // is default
 91 const char * TYPE_BLOB = "byte[]";
 92 const char * TYPE_BOOLEAN = "boolean";
 93 const char * TYPE_BYTE = "byte";
 94 const char * TYPE_DOUBLE = "double";
 95 const char * TYPE_FLOAT = "float";
 96 const char * TYPE_INT = "int";
 97 const char * TYPE_SHORT = "short";
 98 const char * TYPE_LONG = "long";
 99 
100 const Timestamp THOUSAND = 1000;
101 const Timestamp MILLION  = 1000 * THOUSAND;
102 const Timestamp BILLION  = 1000 * MILLION;
103 
104 /** Prefix to create a sessionId */
105 const char* SESSIONID_PREFIX = "sessionId:";
106 const char* SUBSCRIPTIONID_PREFIX = "__subId:";
107 const char* const SUBSCRIPTIONID_PtP = "__subId:PtP";
108 
109 
110 const char* XB_GLOBAL_KEY = "XB_Global"; // For registration with lifetime manager
111 const char* XB_XMLPARSERFACTORY_KEY = "XB_XmlParserFactory"; // For registration with lifetime manager
112 
113 const char* JMS_PREFIX = "__jms:";
114 const char* JMS_REPLY_TO = "__jms:JMSReplyTo";
115 const char* UPDATE_BULK_ACK = "__updateBulkAck";
116 const char* JMSX_GROUP_ID = "__jms:JMSXGroupID";
117 const char* JMSX_GROUP_SEQ = "__jms:JMSXGroupSeq";
118 const char* JMSX_GROUP_EOF = "__jms:JMSXGroupEof";
119 const char* JMSX_GROUP_EX = "__jms:JMSXGroupEx";
120 
121 const char* FILENAME_ATTR = "_filename";
122 const char* TIMESTAMP_ATTR = "_timestamp";
123 const char* FILE_DATE = "_fileDate";
124 
125 /*
126 const int getPriority(string prio, int defaultPriority)
127 {
128   if (prio != null) {
129      prio = prio.trim();
130      try {
131         return new Integer(prio).intValue();
132      } catch (NumberFormatException e) {
133         prio = prio.toUpperCase();
134         if (prio.startsWith("MIN"))
135            return Constants.MIN_PRIORITY;
136         else if (prio.startsWith("LOW"))
137            return Constants.LOW_PRIORITY;
138         else if (prio.startsWith("NORM"))
139            return Constants.NORM_PRIORITY;
140         else if (prio.startsWith("HIGH"))
141            return Constants.HIGH_PRIORITY;
142         else if (prio.startsWith("MAX"))
143            return Constants.MAX_PRIORITY;
144         else
145            Global.instance().getLog("org.xmlBlaster").warn(ME, "Wrong format of <priority>" + prio +
146                 "</priority>, expected a number between (inclusiv) 0 - 9, setting to message priority to "
147                 + defaultPriority);
148      }
149   }
150   if (defaultPriority < Constants.MIN_PRIORITY || defaultPriority > Constants.MAX_PRIORITY) {
151       Global.instance().getLog("org.xmlBlaster").warn(ME, "Wrong message defaultPriority=" + defaultPriority + " given, setting to NORM_PRIORITY");
152       return Constants.NORM_PRIORITY;
153   }
154   return defaultPriority;
155 }
156 */
157 
158 }}}} // namespace 


syntax highlighted by Code2HTML, v. 0.9.1