1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8 <title>Class: MCollective::Message</title>
10 <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
12 <script src="../js/jquery.js" type="text/javascript"
13 charset="utf-8"></script>
14 <script src="../js/thickbox-compressed.js" type="text/javascript"
15 charset="utf-8"></script>
16 <script src="../js/quicksearch.js" type="text/javascript"
17 charset="utf-8"></script>
18 <script src="../js/darkfish.js" type="text/javascript"
19 charset="utf-8"></script>
25 <div id="file-metadata">
26 <div id="file-list-section" class="section">
27 <h3 class="section-header">In Files</h3>
28 <div class="section-body">
31 <li><a href="../lib/mcollective/message_rb.html?TB_iframe=true&height=550&width=785"
32 class="thickbox" title="lib/mcollective/message.rb">lib/mcollective/message.rb</a></li>
41 <div id="class-metadata">
45 <div id="parent-class-section" class="section">
46 <h3 class="section-header">Parent</h3>
48 <p class="link"><a href="../Object.html">Object</a></p>
53 <!-- Namespace Contents -->
56 <!-- Method Quickref -->
58 <div id="method-list-section" class="section">
59 <h3 class="section-header">Methods</h3>
60 <ul class="link-list">
62 <li><a href="#M000051">::new</a></li>
64 <li><a href="#M000061">#base64?</a></li>
66 <li><a href="#M000058">#base64_decode!</a></li>
68 <li><a href="#M000060">#base64_encode!</a></li>
70 <li><a href="#M000068">#create_reqid</a></li>
72 <li><a href="#M000064">#decode!</a></li>
74 <li><a href="#M000062">#encode!</a></li>
76 <li><a href="#M000057">#expected_msgid=</a></li>
78 <li><a href="#M000067">#publish</a></li>
80 <li><a href="#M000056">#reply_to=</a></li>
82 <li><a href="#M000055">#type=</a></li>
84 <li><a href="#M000066">#validate</a></li>
86 <li><a href="#M000063">#validate_compound_filter</a></li>
92 <!-- Included Modules -->
96 <div id="project-metadata">
99 <div id="fileindex-section" class="section project-section">
100 <h3 class="section-header">Files</h3>
103 <li class="file"><a href="../COPYING.html">COPYING</a></li>
105 <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
107 <li class="file"><a href="../README.html">README</a></li>
109 <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
111 <li class="file"><a href="../etc/client_cfg_dist.html">client.cfg.dist</a></li>
113 <li class="file"><a href="../etc/data-help_erb.html">data-help.erb</a></li>
115 <li class="file"><a href="../etc/discovery-help_erb.html">discovery-help.erb</a></li>
117 <li class="file"><a href="../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
119 <li class="file"><a href="../etc/metadata-help_erb.html">metadata-help.erb</a></li>
121 <li class="file"><a href="../etc/msg-help_erb.html">msg-help.erb</a></li>
123 <li class="file"><a href="../etc/rpc-help_erb.html">rpc-help.erb</a></li>
125 <li class="file"><a href="../etc/server_cfg_dist.html">server.cfg.dist</a></li>
127 <li class="file"><a href="../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
129 <li class="file"><a href="../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
131 <li class="file"><a href="../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
133 <li class="file"><a href="../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
135 <li class="file"><a href="../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
137 <li class="file"><a href="../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
139 <li class="file"><a href="../lib/mcollective/locales/en_yml.html">en.yml</a></li>
141 <li class="file"><a href="../mcollective_init.html">mcollective.init</a></li>
147 <div id="classindex-section" class="section project-section">
148 <h3 class="section-header">Class Index
149 <span class="search-toggle"><img src="../images/find.png"
150 height="16" width="16" alt="[+]"
151 title="show/hide quicksearch" /></span></h3>
152 <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
154 <legend>Quicksearch</legend>
155 <input type="text" name="quicksearch" value=""
156 class="quicksearch-field" />
160 <ul class="link-list">
162 <li><a href="../MCollective.html">MCollective</a></li>
164 <li><a href="../MCollective/Agent.html">MCollective::Agent</a></li>
166 <li><a href="../MCollective/Agents.html">MCollective::Agents</a></li>
168 <li><a href="../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
170 <li><a href="../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
172 <li><a href="../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
174 <li><a href="../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
176 <li><a href="../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
178 <li><a href="../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
180 <li><a href="../MCollective/Application.html">MCollective::Application</a></li>
182 <li><a href="../MCollective/Applications.html">MCollective::Applications</a></li>
184 <li><a href="../MCollective/Cache.html">MCollective::Cache</a></li>
186 <li><a href="../MCollective/Client.html">MCollective::Client</a></li>
188 <li><a href="../MCollective/CodedError.html">MCollective::CodedError</a></li>
190 <li><a href="../MCollective/Config.html">MCollective::Config</a></li>
192 <li><a href="../MCollective/Connector.html">MCollective::Connector</a></li>
194 <li><a href="../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
196 <li><a href="../MCollective/DDL.html">MCollective::DDL</a></li>
198 <li><a href="../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
200 <li><a href="../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
202 <li><a href="../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
204 <li><a href="../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
206 <li><a href="../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
208 <li><a href="../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
210 <li><a href="../MCollective/Data.html">MCollective::Data</a></li>
212 <li><a href="../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
214 <li><a href="../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
216 <li><a href="../MCollective/Discovery.html">MCollective::Discovery</a></li>
218 <li><a href="../MCollective/Facts.html">MCollective::Facts</a></li>
220 <li><a href="../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
222 <li><a href="../MCollective/Generators.html">MCollective::Generators</a></li>
224 <li><a href="../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
226 <li><a href="../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
228 <li><a href="../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
230 <li><a href="../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
232 <li><a href="../MCollective/Log.html">MCollective::Log</a></li>
234 <li><a href="../MCollective/Logger.html">MCollective::Logger</a></li>
236 <li><a href="../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
238 <li><a href="../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
240 <li><a href="../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
242 <li><a href="../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
244 <li><a href="../MCollective/Matcher.html">MCollective::Matcher</a></li>
246 <li><a href="../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
248 <li><a href="../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
250 <li><a href="../MCollective/Message.html">MCollective::Message</a></li>
252 <li><a href="../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
254 <li><a href="../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
256 <li><a href="../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
258 <li><a href="../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
260 <li><a href="../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
262 <li><a href="../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
264 <li><a href="../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
266 <li><a href="../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
268 <li><a href="../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
270 <li><a href="../MCollective/RPC.html">MCollective::RPC</a></li>
272 <li><a href="../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
274 <li><a href="../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
276 <li><a href="../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
278 <li><a href="../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
280 <li><a href="../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
282 <li><a href="../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
284 <li><a href="../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
286 <li><a href="../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
288 <li><a href="../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
290 <li><a href="../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
292 <li><a href="../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
294 <li><a href="../MCollective/RPCError.html">MCollective::RPCError</a></li>
296 <li><a href="../MCollective/Registration.html">MCollective::Registration</a></li>
298 <li><a href="../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
300 <li><a href="../MCollective/Runner.html">MCollective::Runner</a></li>
302 <li><a href="../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
304 <li><a href="../MCollective/SSL.html">MCollective::SSL</a></li>
306 <li><a href="../MCollective/Security.html">MCollective::Security</a></li>
308 <li><a href="../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
310 <li><a href="../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
312 <li><a href="../MCollective/Shell.html">MCollective::Shell</a></li>
314 <li><a href="../MCollective/Translatable.html">MCollective::Translatable</a></li>
316 <li><a href="../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
318 <li><a href="../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
320 <li><a href="../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
322 <li><a href="../MCollective/Util.html">MCollective::Util</a></li>
324 <li><a href="../MCollective/Validator.html">MCollective::Validator</a></li>
326 <li><a href="../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
328 <li><a href="../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
330 <li><a href="../Array.html">Array</a></li>
332 <li><a href="../Dir.html">Dir</a></li>
334 <li><a href="../Object.html">Object</a></li>
336 <li><a href="../String.html">String</a></li>
338 <li><a href="../Symbol.html">Symbol</a></li>
341 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
348 <div id="documentation">
349 <h1 class="class">MCollective::Message</h1>
351 <div id="description">
353 container for a message, its headers, agent, collective and other meta data
360 <div id="constants-list" class="section">
361 <h3 class="section-header">Constants</h3>
364 <dt><a name="VALIDTYPES">VALIDTYPES</a></dt>
366 <dd class="description missing-docs">(Not documented)</dd>
375 <div id="attribute-method-details" class="method-section section">
376 <h3 class="section-header">Attributes</h3>
379 <div id="message-attribute-method" class="method-detail">
380 <a name="message"></a>
382 <div class="method-heading attribute-method-heading">
383 <span class="method-name">message</span><span
384 class="attribute-access-type">[R]</span>
387 <div class="method-description">
389 <p class="missing-docs">(Not documented)</p>
394 <div id="request-attribute-method" class="method-detail">
395 <a name="request"></a>
397 <div class="method-heading attribute-method-heading">
398 <span class="method-name">request</span><span
399 class="attribute-access-type">[R]</span>
402 <div class="method-description">
404 <p class="missing-docs">(Not documented)</p>
409 <div id="validated-attribute-method" class="method-detail">
410 <a name="validated"></a>
412 <div class="method-heading attribute-method-heading">
413 <span class="method-name">validated</span><span
414 class="attribute-access-type">[R]</span>
417 <div class="method-description">
419 <p class="missing-docs">(Not documented)</p>
424 <div id="msgtime-attribute-method" class="method-detail">
425 <a name="msgtime"></a>
427 <div class="method-heading attribute-method-heading">
428 <span class="method-name">msgtime</span><span
429 class="attribute-access-type">[R]</span>
432 <div class="method-description">
434 <p class="missing-docs">(Not documented)</p>
439 <div id="payload-attribute-method" class="method-detail">
440 <a name="payload"></a>
442 <div class="method-heading attribute-method-heading">
443 <span class="method-name">payload</span><span
444 class="attribute-access-type">[R]</span>
447 <div class="method-description">
449 <p class="missing-docs">(Not documented)</p>
454 <div id="type-attribute-method" class="method-detail">
457 <div class="method-heading attribute-method-heading">
458 <span class="method-name">type</span><span
459 class="attribute-access-type">[R]</span>
462 <div class="method-description">
464 <p class="missing-docs">(Not documented)</p>
469 <div id="expected-msgid-attribute-method" class="method-detail">
470 <a name="expected_msgid"></a>
472 <div class="method-heading attribute-method-heading">
473 <span class="method-name">expected_msgid</span><span
474 class="attribute-access-type">[R]</span>
477 <div class="method-description">
479 <p class="missing-docs">(Not documented)</p>
484 <div id="reply-to-attribute-method" class="method-detail">
485 <a name="reply_to"></a>
487 <div class="method-heading attribute-method-heading">
488 <span class="method-name">reply_to</span><span
489 class="attribute-access-type">[R]</span>
492 <div class="method-description">
494 <p class="missing-docs">(Not documented)</p>
499 <div id="headers-attribute-method" class="method-detail">
500 <a name="headers"></a>
502 <a name="headers="></a>
504 <div class="method-heading attribute-method-heading">
505 <span class="method-name">headers</span><span
506 class="attribute-access-type">[RW]</span>
509 <div class="method-description">
511 <p class="missing-docs">(Not documented)</p>
516 <div id="agent-attribute-method" class="method-detail">
519 <a name="agent="></a>
521 <div class="method-heading attribute-method-heading">
522 <span class="method-name">agent</span><span
523 class="attribute-access-type">[RW]</span>
526 <div class="method-description">
528 <p class="missing-docs">(Not documented)</p>
533 <div id="collective-attribute-method" class="method-detail">
534 <a name="collective"></a>
536 <a name="collective="></a>
538 <div class="method-heading attribute-method-heading">
539 <span class="method-name">collective</span><span
540 class="attribute-access-type">[RW]</span>
543 <div class="method-description">
545 <p class="missing-docs">(Not documented)</p>
550 <div id="filter-attribute-method" class="method-detail">
551 <a name="filter"></a>
553 <a name="filter="></a>
555 <div class="method-heading attribute-method-heading">
556 <span class="method-name">filter</span><span
557 class="attribute-access-type">[RW]</span>
560 <div class="method-description">
562 <p class="missing-docs">(Not documented)</p>
567 <div id="requestid-attribute-method" class="method-detail">
568 <a name="requestid"></a>
570 <a name="requestid="></a>
572 <div class="method-heading attribute-method-heading">
573 <span class="method-name">requestid</span><span
574 class="attribute-access-type">[RW]</span>
577 <div class="method-description">
579 <p class="missing-docs">(Not documented)</p>
584 <div id="discovered-hosts-attribute-method" class="method-detail">
585 <a name="discovered_hosts"></a>
587 <a name="discovered_hosts="></a>
589 <div class="method-heading attribute-method-heading">
590 <span class="method-name">discovered_hosts</span><span
591 class="attribute-access-type">[RW]</span>
594 <div class="method-description">
596 <p class="missing-docs">(Not documented)</p>
601 <div id="options-attribute-method" class="method-detail">
602 <a name="options"></a>
604 <a name="options="></a>
606 <div class="method-heading attribute-method-heading">
607 <span class="method-name">options</span><span
608 class="attribute-access-type">[RW]</span>
611 <div class="method-description">
613 <p class="missing-docs">(Not documented)</p>
618 <div id="ttl-attribute-method" class="method-detail">
623 <div class="method-heading attribute-method-heading">
624 <span class="method-name">ttl</span><span
625 class="attribute-access-type">[RW]</span>
628 <div class="method-description">
630 <p class="missing-docs">(Not documented)</p>
640 <div id="public-class-method-details" class="method-section section">
641 <h3 class="section-header">Public Class Methods</h3>
644 <div id="new-method" class="method-detail ">
645 <a name="M000051"></a>
647 <div class="method-heading">
649 <span class="method-name">new</span><span
650 class="method-args">(payload, message, options = {})</span>
651 <span class="method-click-advice">click to toggle source</span>
655 <div class="method-description">
658 payload - the message body without headers etc, just the text message - the
659 original message received from the middleware options[:base64] - if the
660 body base64 encoded? options[:agent] - the agent the message is for/from
661 options[:collective] - the collective its for/from options[:headers] - the
662 message headers options[:type] - an indicator about the type of message,
663 :message, :request, :direct_request or :reply options[:request] - if this
664 is a reply this should old the message we are replying to options[:filter]
665 - for requests, the filter to encode into the message options[:options] -
666 the normal client options hash options[:ttl] - the maximum amount of
667 seconds this message can be valid for options[:<a
668 href="Message.html#expected_msgid">expected_msgid</a>] - in the case of
669 replies this is the msgid it is expecting in the replies
670 options[:requestid] - specific request id to use else one will be generated
675 <div class="method-source-code"
678 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 23</span>
679 23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">payload</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">options</span> = {})
680 24: <span class="ruby-identifier">options</span> = {<span class="ruby-identifier">:base64</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>,
681 25: <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
682 26: <span class="ruby-identifier">:headers</span> =<span class="ruby-operator">></span> {},
683 27: <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:message</span>,
684 28: <span class="ruby-identifier">:request</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
685 29: <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>,
686 30: <span class="ruby-identifier">:options</span> =<span class="ruby-operator">></span> {},
687 31: <span class="ruby-identifier">:ttl</span> =<span class="ruby-operator">></span> <span class="ruby-value">60</span>,
688 32: <span class="ruby-identifier">:expected_msgid</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
689 33: <span class="ruby-identifier">:requestid</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
690 34: <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
692 36: <span class="ruby-ivar">@payload</span> = <span class="ruby-identifier">payload</span>
693 37: <span class="ruby-ivar">@message</span> = <span class="ruby-identifier">message</span>
694 38: <span class="ruby-ivar">@requestid</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:requestid</span>]
695 39: <span class="ruby-ivar">@discovered_hosts</span> = <span class="ruby-keyword kw">nil</span>
696 40: <span class="ruby-ivar">@reply_to</span> = <span class="ruby-keyword kw">nil</span>
698 42: <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:type</span>]
699 43: <span class="ruby-ivar">@headers</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:headers</span>]
700 44: <span class="ruby-ivar">@base64</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base64</span>]
701 45: <span class="ruby-ivar">@filter</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>]
702 46: <span class="ruby-ivar">@expected_msgid</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:expected_msgid</span>]
703 47: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:options</span>]
705 49: <span class="ruby-ivar">@ttl</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:ttl</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">ttl</span>
706 50: <span class="ruby-ivar">@msgtime</span> = <span class="ruby-value">0</span>
708 52: <span class="ruby-ivar">@validated</span> = <span class="ruby-keyword kw">false</span>
710 54: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:request</span>]
711 55: <span class="ruby-ivar">@request</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:request</span>]
712 56: <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">agent</span>
713 57: <span class="ruby-ivar">@collective</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">collective</span>
714 58: <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">:reply</span>
715 59: <span class="ruby-keyword kw">else</span>
716 60: <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:agent</span>]
717 61: <span class="ruby-ivar">@collective</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:collective</span>]
718 62: <span class="ruby-keyword kw">end</span>
720 64: <span class="ruby-identifier">base64_decode!</span>
721 65: <span class="ruby-keyword kw">end</span></pre>
732 <div id="public-instance-method-details" class="method-section section">
733 <h3 class="section-header">Public Instance Methods</h3>
736 <div id="base--method" class="method-detail ">
737 <a name="M000061"></a>
739 <div class="method-heading">
741 <span class="method-name">base64?</span><span
742 class="method-args">()</span>
743 <span class="method-click-advice">click to toggle source</span>
747 <div class="method-description">
749 <p class="missing-docs">(Not documented)</p>
753 <div class="method-source-code"
756 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 129</span>
757 129: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64?</span>
758 130: <span class="ruby-ivar">@base64</span>
759 131: <span class="ruby-keyword kw">end</span></pre>
768 <div id="base-decode--method" class="method-detail ">
769 <a name="M000058"></a>
771 <div class="method-heading">
773 <span class="method-name">base64_decode!</span><span
774 class="method-args">()</span>
775 <span class="method-click-advice">click to toggle source</span>
779 <div class="method-description">
781 <p class="missing-docs">(Not documented)</p>
785 <div class="method-source-code"
786 id="base-decode--source">
788 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 115</span>
789 115: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64_decode!</span>
790 116: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@base64</span>
792 118: <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">base64_decode</span>(<span class="ruby-ivar">@payload</span>)
793 119: <span class="ruby-ivar">@base64</span> = <span class="ruby-keyword kw">false</span>
794 120: <span class="ruby-keyword kw">end</span></pre>
803 <div id="base-encode--method" class="method-detail ">
804 <a name="M000060"></a>
806 <div class="method-heading">
808 <span class="method-name">base64_encode!</span><span
809 class="method-args">()</span>
810 <span class="method-click-advice">click to toggle source</span>
814 <div class="method-description">
816 <p class="missing-docs">(Not documented)</p>
820 <div class="method-source-code"
821 id="base-encode--source">
823 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 122</span>
824 122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64_encode!</span>
825 123: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@base64</span>
827 125: <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">base64_encode</span>(<span class="ruby-ivar">@payload</span>)
828 126: <span class="ruby-ivar">@base64</span> = <span class="ruby-keyword kw">true</span>
829 127: <span class="ruby-keyword kw">end</span></pre>
838 <div id="create-reqid-method" class="method-detail ">
839 <a name="M000068"></a>
841 <div class="method-heading">
843 <span class="method-name">create_reqid</span><span
844 class="method-args">()</span>
845 <span class="method-click-advice">click to toggle source</span>
849 <div class="method-description">
851 <p class="missing-docs">(Not documented)</p>
855 <div class="method-source-code"
856 id="create-reqid-source">
858 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 226</span>
859 226: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_reqid</span>
860 227: <span class="ruby-comment cmt"># we gsub out the -s so that the format of the id does not</span>
861 228: <span class="ruby-comment cmt"># change from previous versions, these should just be more</span>
862 229: <span class="ruby-comment cmt"># unique than previous ones</span>
863 230: <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">uuid</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">"-"</span>, <span class="ruby-value str">""</span>)
864 231: <span class="ruby-keyword kw">end</span></pre>
873 <div id="decode--method" class="method-detail ">
874 <a name="M000064"></a>
876 <div class="method-heading">
878 <span class="method-name">decode!</span><span
879 class="method-args">()</span>
880 <span class="method-click-advice">click to toggle source</span>
884 <div class="method-description">
886 <p class="missing-docs">(Not documented)</p>
890 <div class="method-source-code"
893 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 175</span>
894 175: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decode!</span>
895 176: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Cannot decode message type #{type}"</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:reply</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>)
897 178: <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"security_plugin"</span>].<span class="ruby-identifier">decodemsg</span>(<span class="ruby-keyword kw">self</span>)
899 180: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:request</span>
900 181: <span class="ruby-identifier">raise</span> <span class="ruby-value str">'callerid in request is not valid, surpressing reply to potentially forged request'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"security_plugin"</span>].<span class="ruby-identifier">valid_callerid?</span>(<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:callerid</span>])
901 182: <span class="ruby-keyword kw">end</span>
903 184: [<span class="ruby-identifier">:collective</span>, <span class="ruby-identifier">:agent</span>, <span class="ruby-identifier">:filter</span>, <span class="ruby-identifier">:requestid</span>, <span class="ruby-identifier">:ttl</span>, <span class="ruby-identifier">:msgtime</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">prop</span><span class="ruby-operator">|</span>
904 185: <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">"@#{prop}"</span>, <span class="ruby-identifier">payload</span>[<span class="ruby-identifier">prop</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">payload</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">prop</span>)
905 186: <span class="ruby-keyword kw">end</span>
906 187: <span class="ruby-keyword kw">end</span></pre>
915 <div id="encode--method" class="method-detail ">
916 <a name="M000062"></a>
918 <div class="method-heading">
920 <span class="method-name">encode!</span><span
921 class="method-args">()</span>
922 <span class="method-click-advice">click to toggle source</span>
926 <div class="method-description">
928 <p class="missing-docs">(Not documented)</p>
932 <div class="method-source-code"
935 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 133</span>
936 133: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode!</span>
937 134: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span>
938 135: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:reply</span>
939 136: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Cannot encode a reply message if no request has been associated with it"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">request</span>
940 137: <span class="ruby-identifier">raise</span> <span class="ruby-value str">'callerid in original request is not valid, surpressing reply to potentially forged request'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"security_plugin"</span>].<span class="ruby-identifier">valid_callerid?</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:callerid</span>])
942 139: <span class="ruby-ivar">@requestid</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:requestid</span>]
943 140: <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"security_plugin"</span>].<span class="ruby-identifier">encodereply</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">payload</span>, <span class="ruby-identifier">requestid</span>, <span class="ruby-identifier">request</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:callerid</span>])
944 141: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:direct_request</span>
945 142: <span class="ruby-identifier">validate_compound_filter</span>(<span class="ruby-ivar">@filter</span>[<span class="ruby-value str">"compound"</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">"compound"</span>].<span class="ruby-identifier">empty?</span>
947 144: <span class="ruby-ivar">@requestid</span> = <span class="ruby-identifier">create_reqid</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@requestid</span>
948 145: <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"security_plugin"</span>].<span class="ruby-identifier">encoderequest</span>(<span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">identity</span>, <span class="ruby-identifier">payload</span>, <span class="ruby-identifier">requestid</span>, <span class="ruby-identifier">filter</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">collective</span>, <span class="ruby-identifier">ttl</span>)
949 146: <span class="ruby-keyword kw">else</span>
950 147: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Cannot encode #{type} messages"</span>
951 148: <span class="ruby-keyword kw">end</span>
952 149: <span class="ruby-keyword kw">end</span></pre>
961 <div id="expected-msgid--method" class="method-detail ">
962 <a name="M000057"></a>
964 <div class="method-heading">
966 <span class="method-name">expected_msgid=</span><span
967 class="method-args">(msgid)</span>
968 <span class="method-click-advice">click to toggle source</span>
972 <div class="method-description">
975 in the case of reply messages we are expecting replies to a previously
976 created message. This stores a hint to that previously sent message id and
977 can be used by other classes like the security plugins as a means of
978 optimizing their behavior like by ignoring messages not directed at us.
983 <div class="method-source-code"
984 id="expected-msgid--source">
986 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 110</span>
987 110: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expected_msgid=</span>(<span class="ruby-identifier">msgid</span>)
988 111: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Can only store the expected msgid for reply messages"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:reply</span>
989 112: <span class="ruby-ivar">@expected_msgid</span> = <span class="ruby-identifier">msgid</span>
990 113: <span class="ruby-keyword kw">end</span></pre>
999 <div id="publish-method" class="method-detail ">
1000 <a name="M000067"></a>
1002 <div class="method-heading">
1004 <span class="method-name">publish</span><span
1005 class="method-args">()</span>
1006 <span class="method-click-advice">click to toggle source</span>
1010 <div class="method-description">
1013 publish a reply message by creating a target name and sending it
1018 <div class="method-source-code"
1019 id="publish-source">
1021 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 213</span>
1022 213: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">publish</span>
1023 214: <span class="ruby-comment cmt"># If we've been specificaly told about hosts that were discovered</span>
1024 215: <span class="ruby-comment cmt"># use that information to do P2P calls if appropriate else just</span>
1025 216: <span class="ruby-comment cmt"># send it as is.</span>
1026 217: <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
1027 218: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@discovered_hosts</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">direct_addressing</span> <span class="ruby-operator">&&</span> (<span class="ruby-ivar">@discovered_hosts</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">direct_addressing_threshold</span>)
1028 219: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:direct_request</span>
1029 220: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Handling #{requestid} as a direct request"</span>)
1030 221: <span class="ruby-keyword kw">end</span>
1032 223: <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">'connector_plugin'</span>].<span class="ruby-identifier">publish</span>(<span class="ruby-keyword kw">self</span>)
1033 224: <span class="ruby-keyword kw">end</span></pre>
1042 <div id="reply-to--method" class="method-detail ">
1043 <a name="M000056"></a>
1045 <div class="method-heading">
1047 <span class="method-name">reply_to=</span><span
1048 class="method-args">(target)</span>
1049 <span class="method-click-advice">click to toggle source</span>
1053 <div class="method-description">
1056 Sets a custom reply-to target for requests. The connector plugin should
1057 inspect this when constructing requests and set this header ensuring
1058 replies will go to the custom target otherwise the connector should just do
1059 what it usually does
1064 <div class="method-source-code"
1065 id="reply-to--source">
1067 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 99</span>
1068 99: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reply_to=</span>(<span class="ruby-identifier">target</span>)
1069 100: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Custom reply targets can only be set on requests"</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:direct_request</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@type</span>)
1071 102: <span class="ruby-ivar">@reply_to</span> = <span class="ruby-identifier">target</span>
1072 103: <span class="ruby-keyword kw">end</span></pre>
1081 <div id="type--method" class="method-detail ">
1082 <a name="M000055"></a>
1084 <div class="method-heading">
1086 <span class="method-name">type=</span><span
1087 class="method-args">(type)</span>
1088 <span class="method-click-advice">click to toggle source</span>
1092 <div class="method-description">
1095 Sets the message type to one of the known types. In the case of
1096 :direct_request the list of hosts to communicate with should have been set
1097 with <a href="Message.html#discovered_hosts">discovered_hosts</a> else an
1098 exception will be raised. This is for extra security, we never accidentally
1099 want to send a direct request without a list of hosts or something weird
1100 like that as it might result in a filterless broadcast being sent.
1103 Additionally you simply cannot set :direct_request if direct_addressing was
1104 not enabled this is to force a workflow that doesnt not yield in a mistake
1105 when someone might assume direct_addressing is enabled when its not.
1110 <div class="method-source-code"
1113 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 76</span>
1114 76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type=</span>(<span class="ruby-identifier">type</span>)
1115 77: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Unknown message type #{type}"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">VALIDTYPES</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>)
1117 79: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:direct_request</span>
1118 80: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Direct requests is not enabled using the direct_addressing config option"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
1120 82: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@discovered_hosts</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@discovered_hosts</span>.<span class="ruby-identifier">empty?</span>
1121 83: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Can only set type to :direct_request if discovered_hosts have been set"</span>
1122 84: <span class="ruby-keyword kw">end</span>
1124 86: <span class="ruby-comment cmt"># clear out the filter, custom discovery sources might interpret the filters</span>
1125 87: <span class="ruby-comment cmt"># different than the remote mcollectived and in directed mode really the only</span>
1126 88: <span class="ruby-comment cmt"># filter that matters is the agent filter</span>
1127 89: <span class="ruby-ivar">@filter</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
1128 90: <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">"agent"</span>] <span class="ruby-operator"><<</span> <span class="ruby-ivar">@agent</span>
1129 91: <span class="ruby-keyword kw">end</span>
1131 93: <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">type</span>
1132 94: <span class="ruby-keyword kw">end</span></pre>
1141 <div id="validate-method" class="method-detail ">
1142 <a name="M000066"></a>
1144 <div class="method-heading">
1146 <span class="method-name">validate</span><span
1147 class="method-args">()</span>
1148 <span class="method-click-advice">click to toggle source</span>
1152 <div class="method-description">
1155 Perform validation against the message by checking filters and ttl
1160 <div class="method-source-code"
1161 id="validate-source">
1163 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 190</span>
1164 190: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate</span>
1165 191: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Can only validate request messages"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:request</span>
1167 193: <span class="ruby-identifier">msg_age</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">utc</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">msgtime</span>
1169 195: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg_age</span> <span class="ruby-operator">></span> <span class="ruby-identifier">ttl</span>
1170 196: <span class="ruby-identifier">cid</span> = <span class="ruby-value str">""</span>
1171 197: <span class="ruby-identifier">cid</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:callerid</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">"@"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">payload</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:callerid</span>)
1172 198: <span class="ruby-identifier">cid</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:senderid</span>]
1174 200: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg_age</span> <span class="ruby-operator">></span> <span class="ruby-identifier">ttl</span>
1175 201: <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"global_stats"</span>].<span class="ruby-identifier">ttlexpired</span>
1177 203: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">MsgTTLExpired</span>, <span class="ruby-node">"message #{requestid} from #{cid} created at #{msgtime} is #{msg_age} seconds old, TTL is #{ttl}"</span>)
1178 204: <span class="ruby-keyword kw">end</span>
1179 205: <span class="ruby-keyword kw">end</span>
1181 207: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">NotTargettedAtUs</span>, <span class="ruby-value str">"Received message is not targetted to us"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"security_plugin"</span>].<span class="ruby-identifier">validate_filter?</span>(<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:filter</span>])
1183 209: <span class="ruby-ivar">@validated</span> = <span class="ruby-keyword kw">true</span>
1184 210: <span class="ruby-keyword kw">end</span></pre>
1193 <div id="validate-compound-filter-method" class="method-detail ">
1194 <a name="M000063"></a>
1196 <div class="method-heading">
1198 <span class="method-name">validate_compound_filter</span><span
1199 class="method-args">(compound_filter)</span>
1200 <span class="method-click-advice">click to toggle source</span>
1204 <div class="method-description">
1206 <p class="missing-docs">(Not documented)</p>
1210 <div class="method-source-code"
1211 id="validate-compound-filter-source">
1213 <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 151</span>
1214 151: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_compound_filter</span>(<span class="ruby-identifier">compound_filter</span>)
1215 152: <span class="ruby-identifier">compound_filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filter</span><span class="ruby-operator">|</span>
1216 153: <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">statement</span><span class="ruby-operator">|</span>
1217 154: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">statement</span>[<span class="ruby-value str">"fstatement"</span>]
1218 155: <span class="ruby-identifier">functionname</span> = <span class="ruby-identifier">statement</span>[<span class="ruby-value str">"fstatement"</span>][<span class="ruby-value str">"name"</span>]
1219 156: <span class="ruby-identifier">pluginname</span> = <span class="ruby-constant">Data</span>.<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">functionname</span>)
1220 157: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">statement</span>[<span class="ruby-value str">"fstatement"</span>][<span class="ruby-value str">"value"</span>]
1222 159: <span class="ruby-identifier">ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pluginname</span>, <span class="ruby-identifier">:data</span>)
1224 161: <span class="ruby-comment cmt"># parses numbers and booleans entered as strings into proper</span>
1225 162: <span class="ruby-comment cmt"># types of data so that DDL validation will pass</span>
1226 163: <span class="ruby-identifier">statement</span>[<span class="ruby-value str">"fstatement"</span>][<span class="ruby-value str">"params"</span>] = <span class="ruby-constant">Data</span>.<span class="ruby-identifier">ddl_transform_input</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">statement</span>[<span class="ruby-value str">"fstatement"</span>][<span class="ruby-value str">"params"</span>])
1228 165: <span class="ruby-constant">Data</span>.<span class="ruby-identifier">ddl_validate</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">statement</span>[<span class="ruby-value str">"fstatement"</span>][<span class="ruby-value str">"params"</span>])
1230 167: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">&&</span> <span class="ruby-constant">Data</span>.<span class="ruby-identifier">ddl_has_output?</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">value</span>)
1231 168: <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC41</span>, <span class="ruby-value str">"Data plugin '%{functionname}()' does not return a '%{value}' value"</span>, <span class="ruby-identifier">:error</span>, {<span class="ruby-identifier">:functionname</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">functionname</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">value</span>})
1232 169: <span class="ruby-keyword kw">end</span>
1233 170: <span class="ruby-keyword kw">end</span>
1234 171: <span class="ruby-keyword kw">end</span>
1235 172: <span class="ruby-keyword kw">end</span>
1236 173: <span class="ruby-keyword kw">end</span></pre>
1251 <div id="rdoc-debugging-section-dump" class="debugging-section">
1253 <p>Disabled; run with --debug to generate this.</p>
1257 <div id="validator-badges">
1258 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
1259 <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
1260 Rdoc Generator</a> 1.1.6</small>.</p>