25 #ifndef TRANSPORTHELPER_H
26 #define TRANSPORTHELPER_H
29 #define DEPRECATED(func) func __attribute__ ((deprecated))
30 #elif defined(_MSC_VER)
31 #define DEPRECATED(func) __declspec(deprecated) func
33 #define DEPRECATED(func) func
38 #include "WorkItemPool.h"
40 #include "AbstractLogPublisher.h"
56 #define MAX_REPLY_OPTIONS 7
79 int getSize()
const {
return m_Options.size(); }
82 bool isReplyOption(
const string& replyValue )
const;
83 bool optionsSet()
const;
84 string ToString()
const;
85 void Parse(
const string& options);
169 virtual void connect(
const string& queueManagerName =
"",
const string& transportUri =
"",
bool force =
false ) = 0;
170 virtual void connect(
const string& queueManagerName,
const string& transportUri,
const string& keyRepository ,
const string& sslCypherSpec ,
const string& sslPeerName ,
bool force =
false ) {} ;
172 virtual void disconnect() = 0;
173 virtual bool commit() = 0;
174 virtual bool rollback() = 0;
177 virtual long getOne(
unsigned char* buffer,
size_t maxSize,
bool syncpoint =
true ) = 0;
186 virtual long getOne( ManagedBuffer* buffer,
bool syncpoint =
true,
bool keepJMSHeader =
true ) = 0;
191 virtual long getGroupMessage( ManagedBuffer* groupMessageBuffer,
const string& groupId,
bool& isCleaningUp ) = 0;
193 virtual void putOne(
unsigned char* buffer,
size_t bufferSize,
bool syncpoint =
true ) = 0;
196 virtual void putGroupMessage( ManagedBuffer* buffer,
const string& batchId,
long messageSequence,
bool isLast ) = 0;
198 virtual void putSAAmessage(
const TransportReplyOptions& replyOptions,
const string& replyQueue, ManagedBuffer* buffer,
const string& batchId,
long messageSequence,
bool isLast );
201 virtual void putOneRequest(
unsigned char* buffer,
size_t bufferSize,
const string& rtqName,
const string& rtqmName,
TransportReplyOptions& replyOptions ) = 0;
202 virtual void putOneReply(
unsigned char* buffer,
size_t bufferSize = 0,
long feedback = 0, TRANSPORT_MESSAGE_TYPE replyType = TMT_REPLY ) = 0;
205 virtual long peek(
const string& queue =
"",
bool first =
true ) = 0;
208 virtual long getQueueDepth(
const string& queueName ) = 0;
209 virtual TRANSPORT_MESSAGE_TYPE getLastMessageType() = 0;
210 virtual void clearMessages() = 0;
215 virtual string getApplicationName()
const = 0;
216 virtual void setApplicationName(
const string& applicationName ) = 0;
222 virtual string getLastReplyQueueManager()
const = 0;
223 virtual void clearSSLOptions() = 0;
228 DEPRECATED(
virtual void openQueue(
const string& queueName ) ){ m_QueueName = queueName; }
230 virtual long getOne( ManagedBuffer* buffer )
232 return getOne(buffer,
true);
235 virtual void setMessageId(
const string& messageId );
238 virtual void setCorrelationId(
const string& correlId );
241 virtual void setGroupId(
const string& groupId );
245 virtual void setMessageFormat(
const string& format ) = 0;
246 virtual string getLastMessageFormat()
const = 0;
251 time_t getMessagePutTime();
257 virtual void setAutoAbandon(
const int retries );
259 virtual void setBackupQueue(
const string& queueName );
262 static AbstractLogPublisher* createMqLogPublisher(
const NameValueCollection& propSettings,
bool& isDefault );