Class: SmscManager::SmsStatisticsListener
- Inherits:
-
StompMessage::StompStatisticsServer
- Object
- StompMessage::StompStatisticsServer
- SmscManager::SmsStatisticsListener
- Defined in:
- lib/smsc_manager/sms_statistics_listener.rb
Instance Method Summary collapse
- #create_m_statistics(sms) ⇒ Object
-
#initialize(options = {}) ⇒ SmsStatisticsListener
constructor
A new instance of SmsStatisticsListener.
-
#stomp_REPORT(msg, stomp_msg) ⇒ Object
self.source = 0 if !self.source.key?(sms.source) self.source += 1.
- #stomp_SMS(msg, stomp_msg) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ SmsStatisticsListener
Returns a new instance of SmsStatisticsListener.
14 15 16 17 18 19 20 |
# File 'lib/smsc_manager/sms_statistics_listener.rb', line 14 def initialize(={}) super() # self.source ={} puts "finished initializing" end |
Instance Method Details
#create_m_statistics(sms) ⇒ Object
21 22 23 24 |
# File 'lib/smsc_manager/sms_statistics_listener.rb', line 21 def create_m_statistics(sms) # self.source[sms.source] = 0 if !self.source.key?(sms.source) # self.source[sms.source] += 1 end |
#stomp_REPORT(msg, stomp_msg) ⇒ Object
self.source = 0 if !self.source.key?(sms.source) self.source += 1
25 26 27 28 29 30 31 |
# File 'lib/smsc_manager/sms_statistics_listener.rb', line 25 def stomp_REPORT(msg, stomp_msg) result = super(msg, stomp_msg) #puts " --------------------------------- details" # self.source.each_pair { |key,val| puts " key: #{key} value: #{val}"} # puts " --------------------------------- " end |
#stomp_SMS(msg, stomp_msg) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/smsc_manager/sms_statistics_listener.rb', line 32 def stomp_SMS(msg, stomp_msg) puts "msg command #{msg.command} msg body #{msg.body}" if @debug sms=SmscManager::Sms.load_xml(msg.body) create_m_statistics(sms) puts "#{self.topic} OM report stomp_SMS" if @debug # stomp_REPORT(msg) if self.msg_count % 100 == 0 end |