Module: RightScale::ProtocolVersionMixin

Extended by:
ProtocolVersionMixin
Included in:
AgentIdentity, Dispatcher, EnrollmentResult, ProtocolVersionMixin, SecureSerializer
Defined in:
lib/right_agent/protocol_version_mixin.rb

Overview

Mixin for testing for availability of features in agents based on protocol version

Instance Method Summary collapse

Instance Method Details

#can_handle_http?(version) ⇒ Boolean

Test whether given version of agent can handle HTTP communication mode

Returns:

  • (Boolean)


65
# File 'lib/right_agent/protocol_version_mixin.rb', line 65

def can_handle_http?(version); version && version >= 23 end

#can_handle_msgpack_result?(version) ⇒ Boolean

Test whether given version of agent can handle msgpack encoding

Returns:

  • (Boolean)


58
# File 'lib/right_agent/protocol_version_mixin.rb', line 58

def can_handle_msgpack_result?(version); version && version >= 12 end

#can_handle_multicast_result?(version) ⇒ Boolean

Test whether given version of agent can handle receipt of a result containing an OperationResult with MULTICAST status

Returns:

  • (Boolean)


55
# File 'lib/right_agent/protocol_version_mixin.rb', line 55

def can_handle_multicast_result?(version); version && [10, 11].include?(version) end

#can_handle_non_delivery_result?(version) ⇒ Boolean

Test whether given version of agent can handle receipt of a result containing an OperationResult with NON_DELIVERY status

Returns:

  • (Boolean)


62
# File 'lib/right_agent/protocol_version_mixin.rb', line 62

def can_handle_non_delivery_result?(version); version && version >= 13 end

#can_handle_non_nanite_ids?(version) ⇒ Boolean

Test whether given version of agent can handle serialized identity and queue name that does not incorporate ‘nanite’

Returns:

  • (Boolean)


47
# File 'lib/right_agent/protocol_version_mixin.rb', line 47

def can_handle_non_nanite_ids?(version); version && version >= 10 end

#can_handle_request_retries?(version) ⇒ Boolean

Test whether given version of agent can handle a request that is being retried as indicated by a retries count in the Request packet

Returns:

  • (Boolean)


43
# File 'lib/right_agent/protocol_version_mixin.rb', line 43

def can_handle_request_retries?(version); version && version >= 9 end

#can_put_version_in_packet?(version) ⇒ Boolean

Test whether given version of agent has the protocol version embedded in each packet (this is generally inferred by the version in the received packet not being Packet::DEFAULT_VERSION, which is true of all with version >= 12)

Returns:

  • (Boolean)


35
# File 'lib/right_agent/protocol_version_mixin.rb', line 35

def can_put_version_in_packet?(version); version && version != 0 end

#can_route_to_response_queue?(version) ⇒ Boolean

Test whether given version of agent supports routing results to mapper response queue rather than to the identity queue of the mapper that routed the request

Returns:

  • (Boolean)


51
# File 'lib/right_agent/protocol_version_mixin.rb', line 51

def can_route_to_response_queue?(version); version && version >= 10 end

#can_use_router_query_tags?(version) ⇒ Boolean

Test whether given version of agent uses /router/query_tags or /mapper/query_tags

rather than the deprecated TagQuery packet

Returns:

  • (Boolean)


39
# File 'lib/right_agent/protocol_version_mixin.rb', line 39

def can_use_router_query_tags?(version); version && version >= 8 end