class SIF::Infra::Common::Message

Public Instance Methods

content() click to toggle source
# File lib/sif/infra/common/message.rb, line 69
def content
  ack || event || provide || provision ||
  register || request || response || subscribe ||
  system_control || unprovide || unregister || unsubscribe
end
datatype() click to toggle source
# File lib/sif/infra/common/message.rb, line 61
def datatype
  if response? && !response_objects.empty?
    inner_message.response.object_data.datatype
  elsif event? && event_object
    event_object.datatype
  end
end
event?() click to toggle source
# File lib/sif/infra/common/message.rb, line 33
def event?
  inner_message && !inner_message.event.nil?
end
event_object() click to toggle source
# File lib/sif/infra/common/message.rb, line 51
def event_object
  inner_message.event.object_data.event_object
rescue NoMethodError
  nil
end
final_packet?() click to toggle source
# File lib/sif/infra/common/message.rb, line 37
def final_packet?
  response? && !inner_message.response.more_packets?
end
inner_message() click to toggle source
# File lib/sif/infra/common/message.rb, line 23
def inner_message
  ack.status.data.message
rescue NoMethodError
  nil
end
msg_id() click to toggle source
# File lib/sif/infra/common/message.rb, line 79
def msg_id
  content && content.header.msg_id
end
request_msg_id() click to toggle source
# File lib/sif/infra/common/message.rb, line 41
def request_msg_id
  response? && inner_message.response.request_msg_id
end
response?() click to toggle source
# File lib/sif/infra/common/message.rb, line 29
def response?
  inner_message && !inner_message.response.nil?
end
response_objects() click to toggle source
# File lib/sif/infra/common/message.rb, line 45
def response_objects
  inner_message.response.object_data.objects
rescue NoMethodError
  nil
end
source_id() click to toggle source
# File lib/sif/infra/common/message.rb, line 75
def source_id
  content && content.header.source_id
end
status_code() click to toggle source
# File lib/sif/infra/common/message.rb, line 87
def status_code
  ack && ack.status.code
end
timestamp() click to toggle source
# File lib/sif/infra/common/message.rb, line 83
def timestamp
  content && content.header.timestamp
end
type() click to toggle source
# File lib/sif/infra/common/message.rb, line 57
def type
  if event then :event else :response end
end