21 #ifndef ROUTINGMESSAGEEVALUATOR_H 
   22 #define ROUTINGMESSAGEEVALUATOR_H 
   36 #include "Collections.h" 
   40 #include "WSRM/SequenceResponse.h" 
   42 #define FEEDBACK_PROVIDER_COUNT 8 
   43 #define INTERNALXMLPAYLOAD_FIELDCOUNT 20 
   83                 static string getFieldName( 
const int field );
 
   93                         SAA_METHOD_MQID = 100,
 
   95                         SAA_METHOD_CORRELID = 102
 
  102                         METHOD_CORRELID = 152
 
  109                         TMETHOD_CORRELID = 202
 
  123                                         throw invalid_argument( 
"SAA ACK method is invalid" );
 
  138                                         throw invalid_argument( 
"SWIFT ACK method is invalid" );
 
  153                                         throw invalid_argument( 
"TFD ACK method is invalid" );
 
  162 #if defined( TESTDLL_EXPORT ) || defined ( TESTDLL_IMPORT ) 
  163                 friend class RoutingPayloadEvalTest;
 
  183                         FEEDBACKPROVIDER_FTP = 0,
 
  184                         FEEDBACKPROVIDER_MQ = 1,
 
  185                         FEEDBACKPROVIDER_TFD = 2,
 
  186                         FEEDBACKPROVIDER_UNK = 3
 
  261                 static map<Plugin*, HMODULE> m_RegisteredPlugins;
 
  273                 virtual string internalToString() = 0;
 
  274                 string internalGetField( 
const int field );
 
  275                 string internalGetField( 
const string& field );
 
  283                 const XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *
m_Document;
 
  285                 void setNamespace( 
const string& namespaceValue ){ m_Namespace = namespaceValue; }
 
  287                 static string getOriginalRef( 
const string& reference, 
const string& batchId );
 
  288                 static string getBatchType( 
const string& batchId, 
const string& tableName = 
"BATCHJOBS", 
const string& sender = 
"" );
 
  292                 static string (*m_GetOriginalRefFunction)( 
const string& reference, 
const string& batchId );
 
  293                 static string (*m_GetBatchTypeFunction)( 
const string& batchId, 
const string& tableName, 
const string& sender );
 
  294                 virtual string getMessageType() = 0;
 
  298                 static void setGetOriginalRefFunction( 
string (*
function)( 
const string& reference, 
const string& batchId ) );
 
  299                 static void setGetBatchTypeFunction( 
string (*
function)(
const string& batchId, 
const string& tableName, 
const string& sender) );
 
  302                 void setKeywordMappings( 
const map<string, string> keywordMappings ) { m_KeywordMappings = keywordMappings; }
 
  304                 const vector<string> getKeywordNames(); 
 
  306                 void setIsoTypes( 
const bool isoMessageType ) { m_IsoMessageType = isoMessageType; }
 
  308                 string GetKeywordXPath( 
const string& messageType, 
const string& keyword );
 
  309                 string EvaluateKeywordValue( 
const string& messageType, 
const string& value, 
const string& keyword, 
const string& field = 
"value" );
 
  310                 pair< string, RoutingKeyword::EVALUATOR_TYPE > Evaluate( 
const string& value, 
const string& keyword, 
const string& field );
 
  312                 static void setSwiftACKMethod( 
const string& method )
 
  314                         if ( method == 
"TRN" )
 
  316                         else if ( method == 
"CORRELID" )
 
  321                 static void setSAAACKMethod( 
const string& method )
 
  323                         if ( method == 
"TRN" )
 
  325                         else if ( method == 
"CORRELID" )
 
  330                 static void setTFDACKMethod( 
const string& method )
 
  332                         if ( method == 
"MQID" )
 
  334                         else if ( method == 
"CORRELID" )
 
  339                 static void setMarkApproved( 
bool markAchApproved ){ m_MarkACHApproved = markAchApproved; }
 
  345                 static void ReadEvaluators( 
const string& location );
 
  346                 static void EvaluatorsCleanup();
 
  352                 static string getNamespaceByMessageType( 
const string& messageType );
 
  363                 static bool isIso( 
const string& msgNamespace );
 
  365                 virtual bool isIso()
 const { 
return false; } 
 
  367                 bool isBusinessFormat() 
const; 
 
  370                 void setValid( 
const bool validStatus ) { m_Valid = validStatus; }
 
  373                 string getField( 
const int field );
 
  374                 string getField( 
const string& field );
 
  375                 string getCustomXPath( 
const string& xpath, 
const bool noCache = 
false );
 
  385                 virtual FinTP::NameValueCollection getAddParams( 
const string& ref )
 
  387                         return FinTP::NameValueCollection();
 
  390                 virtual bool isReply() = 0;
 
  391                 virtual bool isAck() = 0;
 
  392                 virtual bool isNack() = 0;
 
  393                 virtual bool isAck( 
const string ns )
 
  395                         if ( ns.length() == 0 )
 
  397                         return ( isAck() && ( ns == m_Namespace ) );
 
  399                 virtual bool isNack( 
const string ns )
 
  401                         if ( ns.length() == 0 )
 
  403                         return ( isNack() && ( ns == m_Namespace ) );
 
  405                 virtual bool isBatch() = 0;
 
  409                 virtual bool isDD() { 
return false; }
 
  410                 virtual bool isID() { 
return false; }
 
  417                 const XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* 
getDocument()
 const { 
return m_Document; }
 
  421                 virtual wsrm::SequenceResponse* getSequenceResponse() = 0;
 
  424                 virtual void UpdateMessage( RoutingMessage* message );
 
  440                         Plugin( 
const std::string& name, 
const std::string& version ): m_Name( name ), m_Version( version ){}
 
  441                         const std::string& 
getName() { 
return m_Name; }
 
  443                         virtual bool hasNamespace( 
const string& aNamespace ) = 0;
 
  444                         virtual RoutingMessageEvaluator* newInstance( 
const XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* document ) = 0;
 
  449 #endif //ROUTINGMESSAGEEVALUATOR_H