1 /*-----------------------------------------------------------------------------
2 Name: Constants.h
3 Project: xmlBlaster.org
4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
5 Comment: Holding some constants
6 -----------------------------------------------------------------------------*/
7
8 #ifndef _UTIL_CONSTANTS_H
9 #define _UTIL_CONSTANTS_H
10
11 #include <util/xmlBlasterDef.h>
12 #include <string>
13
14
15
16 namespace org { namespace xmlBlaster {
17 namespace util { namespace Constants {
18
19 /**
20 * Holding some Constants.
21 * <p />
22 * The natural place for those constants would be the xmlBlaster.idl,
23 * this way the constants from java would have been exported automatically
24 * to C++ as well. But we want to be independent from CORBA.
25 * @see xmlBlaster/src/java/org/xmlBlaster/util/def/Constants.java
26 */
27 //class Dll_Export Constants {
28
29 //public:
30
31 extern Dll_Export const char * DEFAULT_SECURITYPLUGIN_TYPE;
32 extern Dll_Export const char * DEFAULT_SECURITYPLUGIN_VERSION;
33
34 enum {
35 MINUTE_IN_MILLIS = 1000L*60,
36 HOUR_IN_MILLIS = MINUTE_IN_MILLIS*60,
37 DAY_IN_MILLIS = HOUR_IN_MILLIS * 24,
38 WEEK_IN_MILLIS = DAY_IN_MILLIS * 7
39 };
40
41
42 /**
43 * The IANA registered xmlBlaster port,
44 * see <a href="http://www.iana.org/assignments/port-numbers">IANA Port Numbers</a>
45 * and <a href="http://andrew.triumf.ca/cgi-bin/port">Network Service Query</a>.
46 * <pre>
47 * xmlblaster 3412/tcp xmlBlaster
48 * xmlblaster 3412/udp xmlBlaster
49 * # Marcel Ruff <xmlBlaster@marcelruff.info> February 2002
50 * </pre>
51 */
52 enum {
53 XMLBLASTER_PORT = 3412
54 };
55
56 /**
57 * The xmlBlaster SNMP node 11662 registered at IANA.
58 * <p />
59 * XmlBlaster has a registered SNMP number under iso.org.dod.internet.private.enterprise (1.3.6.1.4.1),
60 * our tree leaf is 1.3.6.1.4.1.11662
61 * @return 11662
62 * @see <a href="http://www.iana.org/assignments/enterprise-numbers" target="others">PRIVATE ENTERPRISE NUMBERS</a>
63 */
64 enum {
65 XMLBLASTER_SNMP = 11662
66 };
67
68 /**
69 * The xmlBlaster SNMP node 1.3.6.1.4.1.11662 as registered at IANA.
70 * @return a long array containing the SNMP hierarchy to xmlBlaster
71 */
72 extern Dll_Export long XMLBLASTER_OID_ROOT[];
73
74 // enum MessagePriority {
75 /**
76 * The minimum priority of a message (0).
77 */
78 // MIN_PRIORITY = 0,
79
80 /**
81 * The lower priority of a message (2).
82 */
83 // LOW_PRIORITY = 3,
84
85 /**
86 * The default priority of a message (5).
87 */
88 // NORM_PRIORITY = 5,
89
90 /**
91 * The higher priority of a message (7).
92 */
93 // HIGH_PRIORITY = 7,
94
95 /**
96 * The maximum priority of a message (9).
97 */
98 // MAX_PRIORITY = 9
99 // };
100
101
102 /**
103 * Parses given std::string to extract the priority of a message
104 * @param prio For example "HIGH" or 7
105 * @param defaultPriority Value to use if not parseable
106 * @return The int value for the message priority
107 */
108
109 /*const int getPriority(std::string prio, int defaultPriority);*/
110
111 // Status id, on error usually an exception is thrown so we don't need "ERROR":
112
113 /** The returned message status if OK */
114 extern Dll_Export const char * STATE_OK;
115 extern Dll_Export const char * RET_OK;
116
117 /** The returned message status if message timeout occured (but not erased) */
118 extern Dll_Export const char * STATE_TIMEOUT;
119 /** The returned message status if message is explicitly erased by a call to erase() */
120 extern Dll_Export const char * STATE_ERASED;
121 /** The returned message status if message couldn't be forwarded to the master cluster node */
122 extern Dll_Export const char * STATE_FORWARD_ERROR;
123
124 /** Additional info for state.
125 The returned message status if message couldn't be forwarded to the master cluster node but
126 is in the tail back queue to be delivered on reconnect or on client side message
127 recording.
128 */
129 extern Dll_Export const char * INFO_QUEUED;
130
131 // See org.xmlBlaster.engine.queuemsg.ServerEntryFactory.java ENTRY_TYPE_MSG_RAW
132 // for persistency serialization
133 extern Dll_Export const std::string ENTRY_TYPE_MSG_RAW; // "MSG_RAW"; msgUnit is dumped as specified in the protocol.socket requirement (see C persistent queue)
134
135
136 /** Type of a message queue */
137 extern Dll_Export const char * RELATING_CALLBACK;
138 /** Type of a message queue */
139 extern Dll_Export const char * RELATING_SUBJECT;
140 /** Type of a message queue */
141 extern Dll_Export const char * RELATING_UNRELATED;
142 /** Type of a message queue on client side */
143 extern Dll_Export const std::string RELATING_CLIENT;
144 /** Type of a history message queue containing references on messages */
145 extern Dll_Export const char * RELATING_HISTORY;
146 /** Message cache */
147 extern Dll_Export const char * RELATING_MSGUNITSTORE;
148 /** Persistency for topics */
149 extern Dll_Export const char * RELATING_TOPICSTORE;
150
151 /** message queue onOverflow handling, default is blocking until queue takes messages again */
152 extern Dll_Export const char * ONOVERFLOW_BLOCK;
153 /** message queue onOverflow handling */
154 extern Dll_Export const char * ONOVERFLOW_DEADLETTER;
155 /** message queue onOverflow handling */
156 extern Dll_Export const char * ONOVERFLOW_DISCARD;
157 /** message queue onOverflow handling */
158 extern Dll_Export const char * ONOVERFLOW_DISCARDOLDEST;
159 /** message queue onOverflow handling */
160 extern Dll_Export const char * ONOVERFLOW_EXCEPTION;
161 /** message queue onOverflow handling */
162 extern Dll_Export const char * ONOVERFLOW_DEADMESSAGE;
163
164
165 /** If callback fails more often than is configured the login session is destroyed */
166 extern Dll_Export const char * ONEXHAUST_KILL_SESSION;
167
168 /** JDBC access messages */
169 extern Dll_Export const char * JDBC_OID;
170
171 /** message queue onOverflow handling */
172 extern Dll_Export const char * OID_DEAD_LETTER;
173
174 /** XmlKey queryType enum */
175 extern Dll_Export const char * XPATH;
176 extern Dll_Export const char * EXACT;
177 // extern Dll_Export const char * DOMAIN; // doesn't compile with g++ 3.1.1
178 extern Dll_Export const char * D_O_M_A_I_N;
179 extern Dll_Export const char * REGEX;
180
181 extern Dll_Export const char * XPATH_URL_PREFIX;
182 extern Dll_Export const char * EXACT_URL_PREFIX;
183 extern Dll_Export const char * DOMAIN_URL_PREFIX;
184
185 extern Dll_Export const char * SOCKET;
186 extern Dll_Export const char * IOR;
187 extern Dll_Export const char * EMAIL;
188 extern Dll_Export const char * XML_RPC;
189
190 extern Dll_Export const char * RAM;
191 extern Dll_Export const char * CACHE;
192 extern Dll_Export const char * ODBC;
193 extern Dll_Export const char * SQLITE;
194
195 extern Dll_Export const char * OFFSET;
196 extern Dll_Export const char * INDENT;
197
198 extern Dll_Export const char * ENCODING_BASE64;
199 extern Dll_Export const char * ENCODING_NONE;
200
201 extern Dll_Export const char * TYPE_STRING; //< is default, "String"
202 extern Dll_Export const char * TYPE_BLOB;
203 extern Dll_Export const char * TYPE_BOOLEAN;
204 extern Dll_Export const char * TYPE_BYTE;
205 extern Dll_Export const char * TYPE_DOUBLE;
206 extern Dll_Export const char * TYPE_FLOAT;
207 extern Dll_Export const char * TYPE_INT;
208 extern Dll_Export const char * TYPE_SHORT;
209 extern Dll_Export const char * TYPE_LONG;
210
211
212
213 extern Dll_Export const org::xmlBlaster::util::Timestamp THOUSAND;
214 extern Dll_Export const org::xmlBlaster::util::Timestamp MILLION;
215 extern Dll_Export const org::xmlBlaster::util::Timestamp BILLION;
216
217 /** Prefix to create a sessionId */
218 extern Dll_Export const char* SESSIONID_PREFIX;
219 extern Dll_Export const char* SUBSCRIPTIONID_PREFIX;
220 extern Dll_Export const char* const SUBSCRIPTIONID_PtP;
221
222 /** If subscription ID is given by client, e.g. "__subId:/node/heron/client/joe/3/34"
223 * see Requirement engine.qos.subscribe.id
224 */
225 extern Dll_Export const char* SUBSCRIPTIONID_CLIENT_PREFIX;
226 extern Dll_Export const char* INTERNAL_OID_PREFIX_FOR_PLUGINS;
227 extern Dll_Export const char* INTERNAL_OID_ADMIN_CMD;
228 extern Dll_Export const char* INTERNAL_OID_PREFIX_FOR_CORE;
229 extern Dll_Export const char* INTERNAL_OID_PREFIX;
230 extern Dll_Export const char* INTERNAL_OID_CLUSTER_PREFIX;
231
232 /**
233 * Object keys for lifetime manager, needed for registration
234 */
235 extern Dll_Export const char* XB_GLOBAL_KEY;
236 extern Dll_Export const char* XB_XMLPARSERFACTORY_KEY;
237 extern Dll_Export const char* JMS_PREFIX;
238
239 /** Request/Reply pattern */
240 extern Dll_Export const char * JMS_REPLY_TO;
241
242 extern Dll_Export const char* UPDATE_BULK_ACK;
243
244 extern Dll_Export const char* JMSX_GROUP_ID;
245 extern Dll_Export const char* JMSX_GROUP_SEQ;
246 extern Dll_Export const char* JMSX_GROUP_EOF;
247 extern Dll_Export const char* JMSX_GROUP_EX;
248
249 extern Dll_Export const char* FILENAME_ATTR;
250 extern Dll_Export const char* TIMESTAMP_ATTR;
251 extern Dll_Export const char* FILE_DATE;
252
253 //};
254
255
256 }}}} // namespace
257
258 #endif
syntax highlighted by Code2HTML, v. 0.9.1