Update version according to OSCI-883
[packages/precise/mcollective.git] / doc / MCollective / Message.html
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">
5 <head>
6         <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
8         <title>Class: MCollective::Message</title>
9
10         <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
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>
20
21 </head>
22 <body class="class">
23
24         <div id="metadata">
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">
29                                         <ul>
30                                         
31                                                 <li><a href="../lib/mcollective/message_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32                                                         class="thickbox" title="lib/mcollective/message.rb">lib/mcollective/message.rb</a></li>
33                                         
34                                         </ul>
35                                 </div>
36                         </div>
37
38                         
39                 </div>
40
41                 <div id="class-metadata">
42
43                         <!-- Parent Class -->
44                         
45                         <div id="parent-class-section" class="section">
46                                 <h3 class="section-header">Parent</h3>
47                                 
48                                 <p class="link"><a href="../Object.html">Object</a></p>
49                                 
50                         </div>
51                         
52
53                         <!-- Namespace Contents -->
54                         
55
56                         <!-- Method Quickref -->
57                         
58                         <div id="method-list-section" class="section">
59                                 <h3 class="section-header">Methods</h3>
60                                 <ul class="link-list">
61                                         
62                                         <li><a href="#M000051">::new</a></li>
63                                         
64                                         <li><a href="#M000061">#base64?</a></li>
65                                         
66                                         <li><a href="#M000058">#base64_decode!</a></li>
67                                         
68                                         <li><a href="#M000060">#base64_encode!</a></li>
69                                         
70                                         <li><a href="#M000068">#create_reqid</a></li>
71                                         
72                                         <li><a href="#M000064">#decode!</a></li>
73                                         
74                                         <li><a href="#M000062">#encode!</a></li>
75                                         
76                                         <li><a href="#M000057">#expected_msgid=</a></li>
77                                         
78                                         <li><a href="#M000067">#publish</a></li>
79                                         
80                                         <li><a href="#M000056">#reply_to=</a></li>
81                                         
82                                         <li><a href="#M000055">#type=</a></li>
83                                         
84                                         <li><a href="#M000066">#validate</a></li>
85                                         
86                                         <li><a href="#M000063">#validate_compound_filter</a></li>
87                                         
88                                 </ul>
89                         </div>
90                         
91
92                         <!-- Included Modules -->
93                         
94                 </div>
95
96                 <div id="project-metadata">
97                         
98                         
99                         <div id="fileindex-section" class="section project-section">
100                                 <h3 class="section-header">Files</h3>
101                                 <ul>
102                                 
103                                         <li class="file"><a href="../COPYING.html">COPYING</a></li>
104                                 
105                                         <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
106                                 
107                                         <li class="file"><a href="../README.html">README</a></li>
108                                 
109                                         <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
110                                 
111                                         <li class="file"><a href="../etc/client_cfg_dist.html">client.cfg.dist</a></li>
112                                 
113                                         <li class="file"><a href="../etc/data-help_erb.html">data-help.erb</a></li>
114                                 
115                                         <li class="file"><a href="../etc/discovery-help_erb.html">discovery-help.erb</a></li>
116                                 
117                                         <li class="file"><a href="../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
118                                 
119                                         <li class="file"><a href="../etc/metadata-help_erb.html">metadata-help.erb</a></li>
120                                 
121                                         <li class="file"><a href="../etc/msg-help_erb.html">msg-help.erb</a></li>
122                                 
123                                         <li class="file"><a href="../etc/rpc-help_erb.html">rpc-help.erb</a></li>
124                                 
125                                         <li class="file"><a href="../etc/server_cfg_dist.html">server.cfg.dist</a></li>
126                                 
127                                         <li class="file"><a href="../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
128                                 
129                                         <li class="file"><a href="../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
130                                 
131                                         <li class="file"><a href="../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
132                                 
133                                         <li class="file"><a href="../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
134                                 
135                                         <li class="file"><a href="../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
136                                 
137                                         <li class="file"><a href="../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
138                                 
139                                         <li class="file"><a href="../lib/mcollective/locales/en_yml.html">en.yml</a></li>
140                                 
141                                         <li class="file"><a href="../mcollective_init.html">mcollective.init</a></li>
142                                 
143                                 </ul>
144                         </div>
145                         
146
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">
153                                 <fieldset>
154                                         <legend>Quicksearch</legend>
155                                         <input type="text" name="quicksearch" value=""
156                                                 class="quicksearch-field" />
157                                 </fieldset>
158                                 </form>
159
160                                 <ul class="link-list">
161                                 
162                                         <li><a href="../MCollective.html">MCollective</a></li>
163                                 
164                                         <li><a href="../MCollective/Agent.html">MCollective::Agent</a></li>
165                                 
166                                         <li><a href="../MCollective/Agents.html">MCollective::Agents</a></li>
167                                 
168                                         <li><a href="../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
169                                 
170                                         <li><a href="../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
171                                 
172                                         <li><a href="../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
173                                 
174                                         <li><a href="../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
175                                 
176                                         <li><a href="../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
177                                 
178                                         <li><a href="../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
179                                 
180                                         <li><a href="../MCollective/Application.html">MCollective::Application</a></li>
181                                 
182                                         <li><a href="../MCollective/Applications.html">MCollective::Applications</a></li>
183                                 
184                                         <li><a href="../MCollective/Cache.html">MCollective::Cache</a></li>
185                                 
186                                         <li><a href="../MCollective/Client.html">MCollective::Client</a></li>
187                                 
188                                         <li><a href="../MCollective/CodedError.html">MCollective::CodedError</a></li>
189                                 
190                                         <li><a href="../MCollective/Config.html">MCollective::Config</a></li>
191                                 
192                                         <li><a href="../MCollective/Connector.html">MCollective::Connector</a></li>
193                                 
194                                         <li><a href="../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
195                                 
196                                         <li><a href="../MCollective/DDL.html">MCollective::DDL</a></li>
197                                 
198                                         <li><a href="../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
199                                 
200                                         <li><a href="../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
201                                 
202                                         <li><a href="../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
203                                 
204                                         <li><a href="../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
205                                 
206                                         <li><a href="../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
207                                 
208                                         <li><a href="../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
209                                 
210                                         <li><a href="../MCollective/Data.html">MCollective::Data</a></li>
211                                 
212                                         <li><a href="../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
213                                 
214                                         <li><a href="../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
215                                 
216                                         <li><a href="../MCollective/Discovery.html">MCollective::Discovery</a></li>
217                                 
218                                         <li><a href="../MCollective/Facts.html">MCollective::Facts</a></li>
219                                 
220                                         <li><a href="../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
221                                 
222                                         <li><a href="../MCollective/Generators.html">MCollective::Generators</a></li>
223                                 
224                                         <li><a href="../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
225                                 
226                                         <li><a href="../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
227                                 
228                                         <li><a href="../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
229                                 
230                                         <li><a href="../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
231                                 
232                                         <li><a href="../MCollective/Log.html">MCollective::Log</a></li>
233                                 
234                                         <li><a href="../MCollective/Logger.html">MCollective::Logger</a></li>
235                                 
236                                         <li><a href="../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
237                                 
238                                         <li><a href="../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
239                                 
240                                         <li><a href="../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
241                                 
242                                         <li><a href="../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
243                                 
244                                         <li><a href="../MCollective/Matcher.html">MCollective::Matcher</a></li>
245                                 
246                                         <li><a href="../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
247                                 
248                                         <li><a href="../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
249                                 
250                                         <li><a href="../MCollective/Message.html">MCollective::Message</a></li>
251                                 
252                                         <li><a href="../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
253                                 
254                                         <li><a href="../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
255                                 
256                                         <li><a href="../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
257                                 
258                                         <li><a href="../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
259                                 
260                                         <li><a href="../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
261                                 
262                                         <li><a href="../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
263                                 
264                                         <li><a href="../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
265                                 
266                                         <li><a href="../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
267                                 
268                                         <li><a href="../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
269                                 
270                                         <li><a href="../MCollective/RPC.html">MCollective::RPC</a></li>
271                                 
272                                         <li><a href="../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
273                                 
274                                         <li><a href="../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
275                                 
276                                         <li><a href="../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
277                                 
278                                         <li><a href="../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
279                                 
280                                         <li><a href="../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
281                                 
282                                         <li><a href="../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
283                                 
284                                         <li><a href="../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
285                                 
286                                         <li><a href="../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
287                                 
288                                         <li><a href="../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
289                                 
290                                         <li><a href="../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
291                                 
292                                         <li><a href="../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
293                                 
294                                         <li><a href="../MCollective/RPCError.html">MCollective::RPCError</a></li>
295                                 
296                                         <li><a href="../MCollective/Registration.html">MCollective::Registration</a></li>
297                                 
298                                         <li><a href="../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
299                                 
300                                         <li><a href="../MCollective/Runner.html">MCollective::Runner</a></li>
301                                 
302                                         <li><a href="../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
303                                 
304                                         <li><a href="../MCollective/SSL.html">MCollective::SSL</a></li>
305                                 
306                                         <li><a href="../MCollective/Security.html">MCollective::Security</a></li>
307                                 
308                                         <li><a href="../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
309                                 
310                                         <li><a href="../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
311                                 
312                                         <li><a href="../MCollective/Shell.html">MCollective::Shell</a></li>
313                                 
314                                         <li><a href="../MCollective/Translatable.html">MCollective::Translatable</a></li>
315                                 
316                                         <li><a href="../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
317                                 
318                                         <li><a href="../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
319                                 
320                                         <li><a href="../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
321                                 
322                                         <li><a href="../MCollective/Util.html">MCollective::Util</a></li>
323                                 
324                                         <li><a href="../MCollective/Validator.html">MCollective::Validator</a></li>
325                                 
326                                         <li><a href="../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
327                                 
328                                         <li><a href="../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
329                                 
330                                         <li><a href="../Array.html">Array</a></li>
331                                 
332                                         <li><a href="../Dir.html">Dir</a></li>
333                                 
334                                         <li><a href="../Object.html">Object</a></li>
335                                 
336                                         <li><a href="../String.html">String</a></li>
337                                 
338                                         <li><a href="../Symbol.html">Symbol</a></li>
339                                 
340                                 </ul>
341                                 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
342                         </div>
343
344                         
345                 </div>
346         </div>
347
348         <div id="documentation">
349                 <h1 class="class">MCollective::Message</h1>
350
351                 <div id="description">
352                         <p>
353 container for a message, its headers, agent, collective and other meta data
354 </p>
355
356                 </div>
357
358                 <!-- Constants -->
359                 
360                 <div id="constants-list" class="section">
361                         <h3 class="section-header">Constants</h3>
362                         <dl>
363                         
364                                 <dt><a name="VALIDTYPES">VALIDTYPES</a></dt>
365                                 
366                                 <dd class="description missing-docs">(Not documented)</dd>
367                                 
368                         
369                         </dl>
370                 </div>
371                 
372
373                 <!-- Attributes -->
374                 
375                 <div id="attribute-method-details" class="method-section section">
376                         <h3 class="section-header">Attributes</h3>
377
378                         
379                         <div id="message-attribute-method" class="method-detail">
380                                 <a name="message"></a>
381                                 
382                                 <div class="method-heading attribute-method-heading">
383                                         <span class="method-name">message</span><span
384                                                 class="attribute-access-type">[R]</span>
385                                 </div>
386
387                                 <div class="method-description">
388                                 
389                                 <p class="missing-docs">(Not documented)</p>
390                                 
391                                 </div>
392                         </div>
393                         
394                         <div id="request-attribute-method" class="method-detail">
395                                 <a name="request"></a>
396                                 
397                                 <div class="method-heading attribute-method-heading">
398                                         <span class="method-name">request</span><span
399                                                 class="attribute-access-type">[R]</span>
400                                 </div>
401
402                                 <div class="method-description">
403                                 
404                                 <p class="missing-docs">(Not documented)</p>
405                                 
406                                 </div>
407                         </div>
408                         
409                         <div id="validated-attribute-method" class="method-detail">
410                                 <a name="validated"></a>
411                                 
412                                 <div class="method-heading attribute-method-heading">
413                                         <span class="method-name">validated</span><span
414                                                 class="attribute-access-type">[R]</span>
415                                 </div>
416
417                                 <div class="method-description">
418                                 
419                                 <p class="missing-docs">(Not documented)</p>
420                                 
421                                 </div>
422                         </div>
423                         
424                         <div id="msgtime-attribute-method" class="method-detail">
425                                 <a name="msgtime"></a>
426                                 
427                                 <div class="method-heading attribute-method-heading">
428                                         <span class="method-name">msgtime</span><span
429                                                 class="attribute-access-type">[R]</span>
430                                 </div>
431
432                                 <div class="method-description">
433                                 
434                                 <p class="missing-docs">(Not documented)</p>
435                                 
436                                 </div>
437                         </div>
438                         
439                         <div id="payload-attribute-method" class="method-detail">
440                                 <a name="payload"></a>
441                                 
442                                 <div class="method-heading attribute-method-heading">
443                                         <span class="method-name">payload</span><span
444                                                 class="attribute-access-type">[R]</span>
445                                 </div>
446
447                                 <div class="method-description">
448                                 
449                                 <p class="missing-docs">(Not documented)</p>
450                                 
451                                 </div>
452                         </div>
453                         
454                         <div id="type-attribute-method" class="method-detail">
455                                 <a name="type"></a>
456                                 
457                                 <div class="method-heading attribute-method-heading">
458                                         <span class="method-name">type</span><span
459                                                 class="attribute-access-type">[R]</span>
460                                 </div>
461
462                                 <div class="method-description">
463                                 
464                                 <p class="missing-docs">(Not documented)</p>
465                                 
466                                 </div>
467                         </div>
468                         
469                         <div id="expected-msgid-attribute-method" class="method-detail">
470                                 <a name="expected_msgid"></a>
471                                 
472                                 <div class="method-heading attribute-method-heading">
473                                         <span class="method-name">expected_msgid</span><span
474                                                 class="attribute-access-type">[R]</span>
475                                 </div>
476
477                                 <div class="method-description">
478                                 
479                                 <p class="missing-docs">(Not documented)</p>
480                                 
481                                 </div>
482                         </div>
483                         
484                         <div id="reply-to-attribute-method" class="method-detail">
485                                 <a name="reply_to"></a>
486                                 
487                                 <div class="method-heading attribute-method-heading">
488                                         <span class="method-name">reply_to</span><span
489                                                 class="attribute-access-type">[R]</span>
490                                 </div>
491
492                                 <div class="method-description">
493                                 
494                                 <p class="missing-docs">(Not documented)</p>
495                                 
496                                 </div>
497                         </div>
498                         
499                         <div id="headers-attribute-method" class="method-detail">
500                                 <a name="headers"></a>
501                                 
502                                 <a name="headers="></a>
503                                 
504                                 <div class="method-heading attribute-method-heading">
505                                         <span class="method-name">headers</span><span
506                                                 class="attribute-access-type">[RW]</span>
507                                 </div>
508
509                                 <div class="method-description">
510                                 
511                                 <p class="missing-docs">(Not documented)</p>
512                                 
513                                 </div>
514                         </div>
515                         
516                         <div id="agent-attribute-method" class="method-detail">
517                                 <a name="agent"></a>
518                                 
519                                 <a name="agent="></a>
520                                 
521                                 <div class="method-heading attribute-method-heading">
522                                         <span class="method-name">agent</span><span
523                                                 class="attribute-access-type">[RW]</span>
524                                 </div>
525
526                                 <div class="method-description">
527                                 
528                                 <p class="missing-docs">(Not documented)</p>
529                                 
530                                 </div>
531                         </div>
532                         
533                         <div id="collective-attribute-method" class="method-detail">
534                                 <a name="collective"></a>
535                                 
536                                 <a name="collective="></a>
537                                 
538                                 <div class="method-heading attribute-method-heading">
539                                         <span class="method-name">collective</span><span
540                                                 class="attribute-access-type">[RW]</span>
541                                 </div>
542
543                                 <div class="method-description">
544                                 
545                                 <p class="missing-docs">(Not documented)</p>
546                                 
547                                 </div>
548                         </div>
549                         
550                         <div id="filter-attribute-method" class="method-detail">
551                                 <a name="filter"></a>
552                                 
553                                 <a name="filter="></a>
554                                 
555                                 <div class="method-heading attribute-method-heading">
556                                         <span class="method-name">filter</span><span
557                                                 class="attribute-access-type">[RW]</span>
558                                 </div>
559
560                                 <div class="method-description">
561                                 
562                                 <p class="missing-docs">(Not documented)</p>
563                                 
564                                 </div>
565                         </div>
566                         
567                         <div id="requestid-attribute-method" class="method-detail">
568                                 <a name="requestid"></a>
569                                 
570                                 <a name="requestid="></a>
571                                 
572                                 <div class="method-heading attribute-method-heading">
573                                         <span class="method-name">requestid</span><span
574                                                 class="attribute-access-type">[RW]</span>
575                                 </div>
576
577                                 <div class="method-description">
578                                 
579                                 <p class="missing-docs">(Not documented)</p>
580                                 
581                                 </div>
582                         </div>
583                         
584                         <div id="discovered-hosts-attribute-method" class="method-detail">
585                                 <a name="discovered_hosts"></a>
586                                 
587                                 <a name="discovered_hosts="></a>
588                                 
589                                 <div class="method-heading attribute-method-heading">
590                                         <span class="method-name">discovered_hosts</span><span
591                                                 class="attribute-access-type">[RW]</span>
592                                 </div>
593
594                                 <div class="method-description">
595                                 
596                                 <p class="missing-docs">(Not documented)</p>
597                                 
598                                 </div>
599                         </div>
600                         
601                         <div id="options-attribute-method" class="method-detail">
602                                 <a name="options"></a>
603                                 
604                                 <a name="options="></a>
605                                 
606                                 <div class="method-heading attribute-method-heading">
607                                         <span class="method-name">options</span><span
608                                                 class="attribute-access-type">[RW]</span>
609                                 </div>
610
611                                 <div class="method-description">
612                                 
613                                 <p class="missing-docs">(Not documented)</p>
614                                 
615                                 </div>
616                         </div>
617                         
618                         <div id="ttl-attribute-method" class="method-detail">
619                                 <a name="ttl"></a>
620                                 
621                                 <a name="ttl="></a>
622                                 
623                                 <div class="method-heading attribute-method-heading">
624                                         <span class="method-name">ttl</span><span
625                                                 class="attribute-access-type">[RW]</span>
626                                 </div>
627
628                                 <div class="method-description">
629                                 
630                                 <p class="missing-docs">(Not documented)</p>
631                                 
632                                 </div>
633                         </div>
634                         
635                 </div>
636                 
637
638                 <!-- Methods -->
639                 
640                 <div id="public-class-method-details" class="method-section section">
641                         <h3 class="section-header">Public Class Methods</h3>
642
643                 
644                         <div id="new-method" class="method-detail ">
645                                 <a name="M000051"></a>
646
647                                 <div class="method-heading">
648                                 
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>
652                                 
653                                 </div>
654
655                                 <div class="method-description">
656                                         
657                                         <p>
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
671 </p>
672                                         
673
674                                         
675                                         <div class="method-source-code"
676                                                 id="new-source">
677 <pre>
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">&gt;</span> <span class="ruby-keyword kw">false</span>,
681 25:                  <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
682 26:                  <span class="ruby-identifier">:headers</span> =<span class="ruby-operator">&gt;</span> {},
683 27:                  <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:message</span>,
684 28:                  <span class="ruby-identifier">:request</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
685 29:                  <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</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">&gt;</span> {},
687 31:                  <span class="ruby-identifier">:ttl</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">60</span>,
688 32:                  <span class="ruby-identifier">:expected_msgid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
689 33:                  <span class="ruby-identifier">:requestid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
690 34:                  <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
691 35: 
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>
697 41: 
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>]
704 48: 
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>
707 51: 
708 52:       <span class="ruby-ivar">@validated</span> = <span class="ruby-keyword kw">false</span>
709 53: 
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>
719 63: 
720 64:       <span class="ruby-identifier">base64_decode!</span>
721 65:     <span class="ruby-keyword kw">end</span></pre>
722                                         </div>
723                                         
724                                 </div>
725
726                                 
727                         </div>
728
729                 
730                 </div>
731         
732                 <div id="public-instance-method-details" class="method-section section">
733                         <h3 class="section-header">Public Instance Methods</h3>
734
735                 
736                         <div id="base--method" class="method-detail ">
737                                 <a name="M000061"></a>
738
739                                 <div class="method-heading">
740                                 
741                                         <span class="method-name">base64?</span><span
742                                                 class="method-args">()</span>
743                                         <span class="method-click-advice">click to toggle source</span>
744                                 
745                                 </div>
746
747                                 <div class="method-description">
748                                         
749                                         <p class="missing-docs">(Not documented)</p>
750                                         
751
752                                         
753                                         <div class="method-source-code"
754                                                 id="base--source">
755 <pre>
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>
760                                         </div>
761                                         
762                                 </div>
763
764                                 
765                         </div>
766
767                 
768                         <div id="base-decode--method" class="method-detail ">
769                                 <a name="M000058"></a>
770
771                                 <div class="method-heading">
772                                 
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>
776                                 
777                                 </div>
778
779                                 <div class="method-description">
780                                         
781                                         <p class="missing-docs">(Not documented)</p>
782                                         
783
784                                         
785                                         <div class="method-source-code"
786                                                 id="base-decode--source">
787 <pre>
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>
791 117: 
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>
795                                         </div>
796                                         
797                                 </div>
798
799                                 
800                         </div>
801
802                 
803                         <div id="base-encode--method" class="method-detail ">
804                                 <a name="M000060"></a>
805
806                                 <div class="method-heading">
807                                 
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>
811                                 
812                                 </div>
813
814                                 <div class="method-description">
815                                         
816                                         <p class="missing-docs">(Not documented)</p>
817                                         
818
819                                         
820                                         <div class="method-source-code"
821                                                 id="base-encode--source">
822 <pre>
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>
826 124: 
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>
830                                         </div>
831                                         
832                                 </div>
833
834                                 
835                         </div>
836
837                 
838                         <div id="create-reqid-method" class="method-detail ">
839                                 <a name="M000068"></a>
840
841                                 <div class="method-heading">
842                                 
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>
846                                 
847                                 </div>
848
849                                 <div class="method-description">
850                                         
851                                         <p class="missing-docs">(Not documented)</p>
852                                         
853
854                                         
855                                         <div class="method-source-code"
856                                                 id="create-reqid-source">
857 <pre>
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">&quot;-&quot;</span>, <span class="ruby-value str">&quot;&quot;</span>)
864 231:     <span class="ruby-keyword kw">end</span></pre>
865                                         </div>
866                                         
867                                 </div>
868
869                                 
870                         </div>
871
872                 
873                         <div id="decode--method" class="method-detail ">
874                                 <a name="M000064"></a>
875
876                                 <div class="method-heading">
877                                 
878                                         <span class="method-name">decode!</span><span
879                                                 class="method-args">()</span>
880                                         <span class="method-click-advice">click to toggle source</span>
881                                 
882                                 </div>
883
884                                 <div class="method-description">
885                                         
886                                         <p class="missing-docs">(Not documented)</p>
887                                         
888
889                                         
890                                         <div class="method-source-code"
891                                                 id="decode--source">
892 <pre>
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">&quot;Cannot decode message type #{type}&quot;</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>)
896 177: 
897 178:       <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">decodemsg</span>(<span class="ruby-keyword kw">self</span>)
898 179: 
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">&quot;security_plugin&quot;</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>
902 183: 
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">&quot;@#{prop}&quot;</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>
907                                         </div>
908                                         
909                                 </div>
910
911                                 
912                         </div>
913
914                 
915                         <div id="encode--method" class="method-detail ">
916                                 <a name="M000062"></a>
917
918                                 <div class="method-heading">
919                                 
920                                         <span class="method-name">encode!</span><span
921                                                 class="method-args">()</span>
922                                         <span class="method-click-advice">click to toggle source</span>
923                                 
924                                 </div>
925
926                                 <div class="method-description">
927                                         
928                                         <p class="missing-docs">(Not documented)</p>
929                                         
930
931                                         
932                                         <div class="method-source-code"
933                                                 id="encode--source">
934 <pre>
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">&quot;Cannot encode a reply message if no request has been associated with it&quot;</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">&quot;security_plugin&quot;</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>])
941 138: 
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">&quot;security_plugin&quot;</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">&quot;compound&quot;</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">empty?</span>
946 143: 
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">&quot;security_plugin&quot;</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">&quot;Cannot encode #{type} messages&quot;</span>
951 148:       <span class="ruby-keyword kw">end</span>
952 149:     <span class="ruby-keyword kw">end</span></pre>
953                                         </div>
954                                         
955                                 </div>
956
957                                 
958                         </div>
959
960                 
961                         <div id="expected-msgid--method" class="method-detail ">
962                                 <a name="M000057"></a>
963
964                                 <div class="method-heading">
965                                 
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>
969                                 
970                                 </div>
971
972                                 <div class="method-description">
973                                         
974                                         <p>
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.
979 </p>
980                                         
981
982                                         
983                                         <div class="method-source-code"
984                                                 id="expected-msgid--source">
985 <pre>
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">&quot;Can only store the expected msgid for reply messages&quot;</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>
991                                         </div>
992                                         
993                                 </div>
994
995                                 
996                         </div>
997
998                 
999                         <div id="publish-method" class="method-detail ">
1000                                 <a name="M000067"></a>
1001
1002                                 <div class="method-heading">
1003                                 
1004                                         <span class="method-name">publish</span><span
1005                                                 class="method-args">()</span>
1006                                         <span class="method-click-advice">click to toggle source</span>
1007                                 
1008                                 </div>
1009
1010                                 <div class="method-description">
1011                                         
1012                                         <p>
1013 publish a reply message by creating a target name and sending it
1014 </p>
1015                                         
1016
1017                                         
1018                                         <div class="method-source-code"
1019                                                 id="publish-source">
1020 <pre>
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">&amp;&amp;</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">direct_addressing</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@discovered_hosts</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;=</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">&quot;Handling #{requestid} as a direct request&quot;</span>)
1030 221:       <span class="ruby-keyword kw">end</span>
1031 222: 
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>
1034                                         </div>
1035                                         
1036                                 </div>
1037
1038                                 
1039                         </div>
1040
1041                 
1042                         <div id="reply-to--method" class="method-detail ">
1043                                 <a name="M000056"></a>
1044
1045                                 <div class="method-heading">
1046                                 
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>
1050                                 
1051                                 </div>
1052
1053                                 <div class="method-description">
1054                                         
1055                                         <p>
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
1060 </p>
1061                                         
1062
1063                                         
1064                                         <div class="method-source-code"
1065                                                 id="reply-to--source">
1066 <pre>
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">&quot;Custom reply targets can only be set on requests&quot;</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>)
1070 101: 
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>
1073                                         </div>
1074                                         
1075                                 </div>
1076
1077                                 
1078                         </div>
1079
1080                 
1081                         <div id="type--method" class="method-detail ">
1082                                 <a name="M000055"></a>
1083
1084                                 <div class="method-heading">
1085                                 
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>
1089                                 
1090                                 </div>
1091
1092                                 <div class="method-description">
1093                                         
1094                                         <p>
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.
1101 </p>
1102 <p>
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.
1106 </p>
1107                                         
1108
1109                                         
1110                                         <div class="method-source-code"
1111                                                 id="type--source">
1112 <pre>
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">&quot;Unknown message type #{type}&quot;</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>)
1116 78: 
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">&quot;Direct requests is not enabled using the direct_addressing config option&quot;</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>
1119 81: 
1120 82:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@discovered_hosts</span> <span class="ruby-operator">&amp;&amp;</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">&quot;Can only set type to :direct_request if discovered_hosts have been set&quot;</span>
1122 84:         <span class="ruby-keyword kw">end</span>
1123 85: 
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">&quot;agent&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@agent</span>
1129 91:       <span class="ruby-keyword kw">end</span>
1130 92: 
1131 93:       <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">type</span>
1132 94:     <span class="ruby-keyword kw">end</span></pre>
1133                                         </div>
1134                                         
1135                                 </div>
1136
1137                                 
1138                         </div>
1139
1140                 
1141                         <div id="validate-method" class="method-detail ">
1142                                 <a name="M000066"></a>
1143
1144                                 <div class="method-heading">
1145                                 
1146                                         <span class="method-name">validate</span><span
1147                                                 class="method-args">()</span>
1148                                         <span class="method-click-advice">click to toggle source</span>
1149                                 
1150                                 </div>
1151
1152                                 <div class="method-description">
1153                                         
1154                                         <p>
1155 Perform validation against the message by checking filters and ttl
1156 </p>
1157                                         
1158
1159                                         
1160                                         <div class="method-source-code"
1161                                                 id="validate-source">
1162 <pre>
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">&quot;Can only validate request messages&quot;</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>
1166 192: 
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>
1168 194: 
1169 195:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg_age</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ttl</span>
1170 196:         <span class="ruby-identifier">cid</span> = <span class="ruby-value str">&quot;&quot;</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">&quot;@&quot;</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>]
1173 199: 
1174 200:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg_age</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ttl</span>
1175 201:           <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;global_stats&quot;</span>].<span class="ruby-identifier">ttlexpired</span>
1176 202: 
1177 203:           <span class="ruby-identifier">raise</span>(<span class="ruby-constant">MsgTTLExpired</span>, <span class="ruby-node">&quot;message #{requestid} from #{cid} created at #{msgtime} is #{msg_age} seconds old, TTL is #{ttl}&quot;</span>)
1178 204:         <span class="ruby-keyword kw">end</span>
1179 205:       <span class="ruby-keyword kw">end</span>
1180 206: 
1181 207:       <span class="ruby-identifier">raise</span>(<span class="ruby-constant">NotTargettedAtUs</span>, <span class="ruby-value str">&quot;Received message is not targetted to us&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">validate_filter?</span>(<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:filter</span>])
1182 208: 
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>
1185                                         </div>
1186                                         
1187                                 </div>
1188
1189                                 
1190                         </div>
1191
1192                 
1193                         <div id="validate-compound-filter-method" class="method-detail ">
1194                                 <a name="M000063"></a>
1195
1196                                 <div class="method-heading">
1197                                 
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>
1201                                 
1202                                 </div>
1203
1204                                 <div class="method-description">
1205                                         
1206                                         <p class="missing-docs">(Not documented)</p>
1207                                         
1208
1209                                         
1210                                         <div class="method-source-code"
1211                                                 id="validate-compound-filter-source">
1212 <pre>
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">&quot;fstatement&quot;</span>]
1218 155:             <span class="ruby-identifier">functionname</span> = <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;name&quot;</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">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;value&quot;</span>]
1221 158: 
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>)
1223 160: 
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">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;params&quot;</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">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;params&quot;</span>])
1227 164: 
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">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;params&quot;</span>])
1229 166: 
1230 167:             <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">&amp;&amp;</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">&quot;Data plugin '%{functionname}()' does not return a '%{value}' value&quot;</span>, <span class="ruby-identifier">:error</span>, {<span class="ruby-identifier">:functionname</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">functionname</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</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>
1237                                         </div>
1238                                         
1239                                 </div>
1240
1241                                 
1242                         </div>
1243
1244                 
1245                 </div>
1246         
1247
1248         </div>
1249
1250
1251         <div id="rdoc-debugging-section-dump" class="debugging-section">
1252         
1253                 <p>Disabled; run with --debug to generate this.</p>
1254         
1255         </div>
1256
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>
1261         </div>
1262
1263 </body>
1264 </html>
1265