fintp_routingengine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RoutingAggregationManager.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 ROUTINGCORRELATIONMANAGER_H
22 #define ROUTINGCORRELATIONMANAGER_H
23 
24 #include <map>
25 #include <vector>
26 #include <string>
27 using namespace std;
28 
29 #include "RoutingAggregationCode.h"
30 
31 typedef std::map<std::string, std::string> RoutingAggregationFieldArray;
32 typedef std::map<std::string, std::string> RoutingAggregationConditionArray;
33 
34 #define DEFAULT_AGGTABLE "FEEDBACKAGG"
35 
37 {
38  public:
39 
40  typedef enum
41  {
42  /*
43  Tries to update ( based on trim match ), if that fails, it inserts
44  */
46  /*
47  Tries to update, if that fails, it inserts
48  */
50  /*
51  Tries to insert, if that fails, it updates
52  */
54  /*
55  Finds if the information needs updated/inserted
56  */
58  /*
59  Fails if no records to update
60  */
61  UpdateOrFail
62  } REQUEST_MODE;
63 
64  public:
65 
67 
68  //Group: Static methods
69  /*
70  Function: Request
71  Stores a request that will eventually receive one/more reply(ies).
72  Matching is done against the aggregation token.
73 
74  Parameters:
75  correlationToken - Key for the request. Any reply having the same correlationToken will match this request.
76  request - A collection of name-value pairs relevant to a certain request.
77 
78  */
79  // atentie : nu adauga parametrii cu valori implicite inaintea altor param. cu valori implicite
80  //( altfel, trebuie verificat peste tot unde se folosesc valorile implicite )
81  static void AddRequest( const RoutingAggregationCode& request,
82  const REQUEST_MODE requestMode = RoutingAggregationManager::InsertOrUpdate, string aggregationTable = DEFAULT_AGGTABLE );
83 
84  static string GetAggregationField( RoutingAggregationCode& request, string requestedToken,
85  string aggregationTable = DEFAULT_AGGTABLE );
86 
87  static bool GetAggregationFields( RoutingAggregationCode& request, string aggregationTable = DEFAULT_AGGTABLE );
88  //static vector< RoutingAggregationFieldArray > GetAggregationRecords( RoutingAggregationCode& request, string aggregationTable = DEFAULT_AGGTABLE );
89 
90  //static void UpdateAggregationField( const RoutingAggregationCode& request, string aggregationTable = DEFAULT_AGGTABLE );
91 
92  private:
93 
95 };
96 
97 #endif // ROUTINGCORRELATIONMANAGER_H