/**
Special OAM module which tracks a replica for a set of counter types for each different application message managed by the
- communication layer in a specific stack id. For example, if one process is managing CCR/A, RAR/A for Gx and AAR/A, RAR/A for Rx,
- then two counter scopes should be registered (one for Gx, another for Rx). Each scope will store counters sets for each diameter
- message. Having N counters within each scope (for example N=14), the total capacity is N/(number of counter types) different
- message codes:
+ communication layer and result code in case of answer, in a specific stack id. For example, if one process is managing CCR/A,
+ RAR/A for Gx and AAR/A, RAR/A for Rx, then two counter scopes should be registered (one for Gx, another for Rx). Each scope
+ will store counters sets for each diameter event (message and optionally result code description). Having N counters within
+ each scope (for example N=14), the total capacity is N/(number of counter types) different events:
<pre>
Scope for Gx:
Re-Auth-Request_Received_AsServer
Re-Auth-Answer_Received_AsServer
Re-Auth-Answer_UnknownReceived_AsServer
+
+ Note: all other combinations including the result code for answers
+ may be dynamically created.
+
</pre>
*/
class ApplicationMessageOamModule : public anna::oam::Module, public anna::Singleton <ApplicationMessageOamModule> {
- std::map<int /* message code */, int /* base offset */> a_messageMap;
+ std::map<std::string /* event id */, int /* base offset */> a_eventMap;
std::map<unsigned int /* stack id */, int /* scope id */> a_stackMap;
int a_counter_types;
void createStackCounterScope(int /* scope id */, unsigned int /* stack id */) throw(anna::RuntimeException);
// translate message code into offset and invoke parent class count method. The message applicationId will be used as stack id
- void count (int messageCode, unsigned int stackId, const int & type, const int & amount = 1) throw(anna::RuntimeException);
+ // resultCode shall be -1 for non-answers
+ void count (int messageCode, int resultCode, unsigned int stackId, const int & type, const int & amount = 1) throw(anna::RuntimeException);
// Number of different counter types for each message
int getCounterTypes() const throw() { return a_counter_types; }
+ // -1 if multistack
+ int monoStackScopeId() const throw() {
+ return ((a_stackMap.size() != 1) ? -1 : a_stackMap.begin()->second);
+ }
+
private:
// private constructor