def update( *args )
key =args[0]
content = args[1]
qos = args[2]
@audit.info( "XMLBlasterCallbackClient: Received UPDATE." )
begin
qos_xml = REXML::Document.new args[2]
rescue => e
@audit.warn( "XMLBlasterCallbackClient: Could not open QOS of message." )
end
if qos_xml.elements['qos'].elements['state'] != nil then
begin
value = qos_xml.elements['qos'].elements['state'].attributes['id'].to_s
if value == "ERASED" then
@audit.debug( "XMLBlasterCallbackClient: TOPIC GOT ERASED" )
else
@audit.debug( "XMLBlasterCallbackClient: SOMETHING STRANGE" )
end
rescue => e
@audit.warn( "XMLBlasterCallbackClient: Error: #{e}" )
end
end
begin
key_xml = REXML::Document.new key
topic = key_xml.elements['key'].attributes["oid"]
@audit.debug( "Topic #{topic}" )
puts "-----------------------------------"
puts "Received message in topic: #{topic}"
puts "#{content}"
puts "-----------------------------------"
Adaptation::Base.new.process content
rescue => e
@audit.warn( "XMLBlasterCallbackClient: Could not access content of message." )
end
return "<qos><state>OK</state></qos>"
end