Class: Katello::Agent::BaseMessage

Inherits:
Object
  • Object
show all
Defined in:
app/lib/katello/agent/base_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dispatch_history_idObject

Returns the value of attribute dispatch_history_id.



4
5
6
# File 'app/lib/katello/agent/base_message.rb', line 4

def dispatch_history_id
  @dispatch_history_id
end

#recipient_addressObject

Returns the value of attribute recipient_address.



4
5
6
# File 'app/lib/katello/agent/base_message.rb', line 4

def recipient_address
  @recipient_address
end

#reply_toObject

Returns the value of attribute reply_to.



4
5
6
# File 'app/lib/katello/agent/base_message.rb', line 4

def reply_to
  @reply_to
end

Instance Method Details

#jsonObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/lib/katello/agent/base_message.rb', line 6

def json
  {
    data: {
      consumer_id: @consumer_id,
      dispatch_history_id: dispatch_history_id
    },
    replyto: reply_to,
    request: {
      args: [
        units, options
      ],
      classname: "Content",
      cntr: [[], {}],
      kws: {},
      method: @method
    },
    routing: [
      nil,
      recipient_address
    ],
    version: "2.0"
  }
end

#optionsObject

may be overridden by children



30
31
32
33
34
# File 'app/lib/katello/agent/base_message.rb', line 30

def options # may be overridden by children
  {
    importkeys: true
  }
end

#to_sObject



36
37
38
# File 'app/lib/katello/agent/base_message.rb', line 36

def to_s
  json.to_json
end