Class: WinRM::WSMV::ReceiveResponseReader
- Inherits:
-
Object
- Object
- WinRM::WSMV::ReceiveResponseReader
- Defined in:
- lib/winrm/wsmv/receive_response_reader.rb
Overview
Class for reading wsmv Receive_Response messages
Direct Known Subclasses
Constant Summary
Constants included from Header
Header::RESOURCE_URI_CMD, Header::RESOURCE_URI_POWERSHELL
Constants included from SOAP
SOAP::NS_ADDRESSING, SOAP::NS_CIMBINDING, SOAP::NS_ENUM, SOAP::NS_SCHEMA_INST, SOAP::NS_SOAP_ENV, SOAP::NS_TRANSFER, SOAP::NS_WIN_SHELL, SOAP::NS_WSMAN_CONF, SOAP::NS_WSMAN_DMTF, SOAP::NS_WSMAN_FAULT, SOAP::NS_WSMAN_MSFT
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(transport, logger) ⇒ ReceiveResponseReader
constructor
Creates a new ReceiveResponseReader.
-
#read_output(wsmv_message) {|standard, standard| ... } ⇒ Object
Reads streams and returns decoded output.
-
#read_response(wsmv_message, wait_for_done_state = false) {|Hash, Complete| ... } ⇒ Object
Reads streams sent in one or more receive response messages.
Methods included from Header
#action_command, #action_delete, #action_enumerate, #action_enumerate_pull, #action_get, #action_receive, #action_send, #action_signal, #merge_headers, #resource_uri_cmd, #resource_uri_shell, #resource_uri_wmi, #selector_shell_id, #shared_headers
Methods included from SOAP
Constructor Details
#initialize(transport, logger) ⇒ ReceiveResponseReader
Creates a new ReceiveResponseReader
30 31 32 33 34 |
# File 'lib/winrm/wsmv/receive_response_reader.rb', line 30 def initialize(transport, logger) @transport = transport @logger = logger @output_decoder = CommandOutputDecoder.new end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
36 37 38 |
# File 'lib/winrm/wsmv/receive_response_reader.rb', line 36 def logger @logger end |
Instance Method Details
#read_output(wsmv_message) {|standard, standard| ... } ⇒ Object
Reads streams and returns decoded output
43 44 45 46 47 48 49 50 |
# File 'lib/winrm/wsmv/receive_response_reader.rb', line 43 def read_output() with_output do |output| read_response(, true) do |stream, doc| handled_out = handle_stream(stream, output, doc) yield handled_out if handled_out && block_given? end end end |
#read_response(wsmv_message, wait_for_done_state = false) {|Hash, Complete| ... } ⇒ Object
Reads streams sent in one or more receive response messages
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/winrm/wsmv/receive_response_reader.rb', line 57 def read_response(, wait_for_done_state = false) resp_doc = nil until command_done?(resp_doc, wait_for_done_state) logger.debug('[WinRM] Waiting for output...') resp_doc = (.build) logger.debug('[WinRM] Processing output') read_streams(resp_doc) do |stream| yield stream, resp_doc end end end |