Class: MessageBufferPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/service_bus/message_buffer_policy.rb

Instance Method Summary collapse

Constructor Details

#initialize(authorization = "Required", transport_protection = "None", expires_after = "PT5M", max_message_count = 10) ⇒ MessageBufferPolicy

Initializes message buffer policy. Does not expect any parameters by default.

  • Authorization - DEFAULT = “Required”

  • Transport Protection - DEFAULT = “None”

  • Expires After - DEFAULT = “PT5M”

  • Max Message Count - DEFAULT = 10



32
33
34
35
36
37
38
# File 'lib/service_bus/message_buffer_policy.rb', line 32

def initialize(authorization = "Required", transport_protection = "None", expires_after = "PT5M", max_message_count = 10)
  @authorization = authorization
  @transport_protection = transport_protection
  @expires_after = expires_after
  @max_message_count = max_message_count
  @message_buffer_policy_name  = message_buffer_policy
end

Instance Method Details

#message_buffer_policyObject

Returns the message buffer policy in atom format



41
42
43
44
45
46
47
48
49
50
# File 'lib/service_bus/message_buffer_policy.rb', line 41

def message_buffer_policy
  xml_str = "<entry xmlns='http://www.w3.org/2005/Atom'><content type='text/xml'><MessageBufferPolicy xmlns:i='http://www.w3.org/2001/XMLSchema-instance' "
xml_str += "xmlns='#{MessageBufferConstants.message_buffer_policy_namespace}'>"
xml_str += "<Authorization>#{@authorization}</Authorization>"
xml_str += "<TransportProtection>#{@transport_protection}</TransportProtection>"
xml_str += "<ExpiresAfter>#{@expires_after}</ExpiresAfter>"
xml_str += "<MaxMessageCount>#{@max_message_count}</MaxMessageCount>"
xml_str += "</MessageBufferPolicy></content></entry>"
xml_str
end