Class: MessageBufferPolicy
- Inherits:
-
Object
- Object
- MessageBufferPolicy
- Defined in:
- lib/service_bus/message_buffer_policy.rb
Instance Method Summary collapse
-
#initialize(authorization = "Required", transport_protection = "None", expires_after = "PT5M", max_message_count = 10) ⇒ MessageBufferPolicy
constructor
Initializes message buffer policy.
-
#message_buffer_policy ⇒ Object
Returns the message buffer policy in atom format.
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( = "Required", transport_protection = "None", expires_after = "PT5M", = 10) @authorization = @transport_protection = transport_protection @expires_after = expires_after @max_message_count = @message_buffer_policy_name = end |
Instance Method Details
#message_buffer_policy ⇒ Object
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 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.}'>" 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 |