fintp_base
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BatchConfig.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 BATCHCONFIG_H
22 #define BATCHCONFIG_H
23 
24 //#include <xercesc/dom/DOM.hpp>
25 #include <vector>
26 #include <map>
27 
28 //XERCES_CPP_NAMESPACE_USE;
29 using namespace std;
30 
31 #include "DllMain.h"
32 
33 namespace FinTP
34 {
36  {
37  public:
38 
40  {
42  Batch
43  };
44 
45  BatchRequestTransform() : m_Type( BatchRequestTransform::SingleTemplate ), m_File( "" ) {};
46  BatchRequestTransform( const BatchRequestTransform::TransformType type, const string& file ) :
47  m_Type( type ), m_File( file ) {};
48 
50  m_Type( source.getType() ), m_File( source.getFile() ) {};
51 
52  BatchRequestTransform& operator=( const BatchRequestTransform& source )
53  {
54  if ( this == &source )
55  return *this;
56 
57  m_Type = source.getType();
58  m_File = source.getFile();
59 
60  return *this;
61  }
62 
63  string getFile() const { return m_File; }
64  BatchRequestTransform::TransformType getType() const { return m_Type; }
65 
66  static BatchRequestTransform::TransformType Parse( const string& type );
67 
68  private :
69 
71  string m_File;
72  };
73 
74  //EXPIMP_TEMPLATE template class ExportedObject std::vector< BatchRequestTransform >;
75 
77  {
78  public:
79 
80  enum OrderType
81  {
83  Sequence
84  };
85 
86  BatchRequest( const string& messageType, const BatchRequest::OrderType order, const string& storage ) :
87  m_MessageType( messageType ), m_Order( order ), m_Storage( storage ) {};
88 
89  string getMessageType() const { return m_MessageType; }
90  string getStorage() const { return m_Storage; }
91  BatchRequest::OrderType getOrder() const { return m_Order; }
92 
93  static BatchRequest::OrderType Parse( const string& order );
94 
95  void AddTransform( const BatchRequestTransform& transform );
96  const BatchRequestTransform& GetTransform();
97 
98  private :
99 
100  vector< BatchRequestTransform > m_Transforms;
103  string m_Storage;
104  };
105 
106  //EXPIMP_TEMPLATE template class ExportedObject std::map< string, BatchRequest >;
107 
109  {
110  public:
111 
112  BatchConfig();
113  ~BatchConfig();
114 
115  const BatchRequest& GetRequest( const string& queue, const string& messageType = "*" );
116 
117  void setConfigFile( const string& configFilename );
118 
119  private :
120 
121  map< string, BatchRequest > m_Requests;
122  };
123 }
124 
125 #endif // BATCHCONFIG_H