fintp_base
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BatchMQStorage.h
Go to the documentation of this file.
1 /*
2 * FinTP - Financial Transactions Processing Application
3 * Copyright (C) 2013 Business Information Systems (Allevo) S.R.L.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>
17 * or contact Allevo at : 031281 Bucuresti, 23C Calea Vitan, Romania,
18 * phone +40212554577, office@allevo.ro <mailto:office@allevo.ro>, www.allevo.ro.
19 */
20 
21 #ifndef BATCHMQSTORAGE_H
22 #define BATCHMQSTORAGE_H
23 
24 #include "../BatchStorageBase.h"
25 #include "TransportHelper.h"
26 
27 namespace FinTP
28 {
30  {
31  public:
32 
34  ~BatchMQStorage();
35 
36  void enqueue( BatchResolution& resolution );
37  BatchItem dequeue();
38 
39  // open/close storage
40  void open( const string& storageId, ios_base::openmode openMode );
41  void close( const string& storageId );
42 
43  void commit() { m_CrtHelper->commit(); }
44  void rollback() { m_CrtHelper->rollback(); };
45 
46  long size() const { return 0; }
47 
48  // particular sets/flags
49  void setQueue( const string& queue ){ m_Queue = queue; }
50  void setQueueManager( const string& queueManager ){ m_QueueManager = queueManager; }
51  void setBackupQueue( const string& queue ){ m_BackupQueue = queue; }
52  void setTransportURI( const string& chDef ){ m_ChDef = chDef; }
53  void initialize( TransportHelper::TRANSPORT_HELPER_TYPE );
54 
55  // SAA-MQHA way for replies
56  void setReplyOptions( const string& replyOptions ){ m_ReplyOptions = replyOptions; };
57  void setReplyQueue( const string& replyQueue ){ m_ReplyQueue = replyQueue; }
58 
59  void setAutoAbandon( const int& retries ){ m_CrtHelper->setAutoAbandon( retries ); }
60  void setCleaningUp( bool cleanFlag ){ m_IsCleaningUp = cleanFlag; }
61  bool getCleaningUp(){ return m_IsCleaningUp; }
62  void setBufferSize( const unsigned long buffersize ){ m_BufferSize = buffersize; }
63 
64  private :
65 
66  TransportHelper* m_CrtHelper;
67  unsigned long m_BufferSize;
69  string m_Queue, m_BackupQueue, m_QueueManager, m_ChDef, m_ReplyQueue, m_ReplyOptions;
71  };
72 }
73 
74 #endif // BATCHMQSTORAGE_H