--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+
+ <title>Class: MCollective::Message</title>
+
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
+
+ <script src="../js/jquery.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="../js/quicksearch.js" type="text/javascript"
+ charset="utf-8"></script>
+ <script src="../js/darkfish.js" type="text/javascript"
+ charset="utf-8"></script>
+
+</head>
+<body class="class">
+
+ <div id="metadata">
+ <div id="file-metadata">
+ <div id="file-list-section" class="section">
+ <h3 class="section-header">In Files</h3>
+ <div class="section-body">
+ <ul>
+
+ <li><a href="../lib/mcollective/message_rb.html?TB_iframe=true&height=550&width=785"
+ class="thickbox" title="lib/mcollective/message.rb">lib/mcollective/message.rb</a></li>
+
+ </ul>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="class-metadata">
+
+ <!-- Parent Class -->
+
+ <div id="parent-class-section" class="section">
+ <h3 class="section-header">Parent</h3>
+
+ <p class="link"><a href="../Object.html">Object</a></p>
+
+ </div>
+
+
+ <!-- Namespace Contents -->
+
+
+ <!-- Method Quickref -->
+
+ <div id="method-list-section" class="section">
+ <h3 class="section-header">Methods</h3>
+ <ul class="link-list">
+
+ <li><a href="#M000051">::new</a></li>
+
+ <li><a href="#M000057">#base64?</a></li>
+
+ <li><a href="#M000055">#base64_decode!</a></li>
+
+ <li><a href="#M000056">#base64_encode!</a></li>
+
+ <li><a href="#M000066">#create_reqid</a></li>
+
+ <li><a href="#M000061">#decode!</a></li>
+
+ <li><a href="#M000058">#encode!</a></li>
+
+ <li><a href="#M000054">#expected_msgid=</a></li>
+
+ <li><a href="#M000063">#publish</a></li>
+
+ <li><a href="#M000053">#reply_to=</a></li>
+
+ <li><a href="#M000052">#type=</a></li>
+
+ <li><a href="#M000062">#validate</a></li>
+
+ <li><a href="#M000059">#validate_compound_filter</a></li>
+
+ </ul>
+ </div>
+
+
+ <!-- Included Modules -->
+
+ </div>
+
+ <div id="project-metadata">
+
+
+ <div id="fileindex-section" class="section project-section">
+ <h3 class="section-header">Files</h3>
+ <ul>
+
+ <li class="file"><a href="../COPYING.html">COPYING</a></li>
+
+ <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
+
+ <li class="file"><a href="../README.html">README</a></li>
+
+ <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
+
+ <li class="file"><a href="../etc/client_cfg_dist.html">client.cfg.dist</a></li>
+
+ <li class="file"><a href="../etc/data-help_erb.html">data-help.erb</a></li>
+
+ <li class="file"><a href="../etc/discovery-help_erb.html">discovery-help.erb</a></li>
+
+ <li class="file"><a href="../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
+
+ <li class="file"><a href="../etc/metadata-help_erb.html">metadata-help.erb</a></li>
+
+ <li class="file"><a href="../etc/msg-help_erb.html">msg-help.erb</a></li>
+
+ <li class="file"><a href="../etc/rpc-help_erb.html">rpc-help.erb</a></li>
+
+ <li class="file"><a href="../etc/server_cfg_dist.html">server.cfg.dist</a></li>
+
+ <li class="file"><a href="../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
+
+ <li class="file"><a href="../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
+
+ <li class="file"><a href="../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
+
+ <li class="file"><a href="../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
+
+ <li class="file"><a href="../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
+
+ <li class="file"><a href="../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
+
+ <li class="file"><a href="../lib/mcollective/locales/en_yml.html">en.yml</a></li>
+
+ <li class="file"><a href="../mcollective_init.html">mcollective.init</a></li>
+
+ </ul>
+ </div>
+
+
+ <div id="classindex-section" class="section project-section">
+ <h3 class="section-header">Class Index
+ <span class="search-toggle"><img src="../images/find.png"
+ height="16" width="16" alt="[+]"
+ title="show/hide quicksearch" /></span></h3>
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
+ <fieldset>
+ <legend>Quicksearch</legend>
+ <input type="text" name="quicksearch" value=""
+ class="quicksearch-field" />
+ </fieldset>
+ </form>
+
+ <ul class="link-list">
+
+ <li><a href="../MCollective.html">MCollective</a></li>
+
+ <li><a href="../MCollective/Agent.html">MCollective::Agent</a></li>
+
+ <li><a href="../MCollective/Agents.html">MCollective::Agents</a></li>
+
+ <li><a href="../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
+
+ <li><a href="../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
+
+ <li><a href="../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
+
+ <li><a href="../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
+
+ <li><a href="../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
+
+ <li><a href="../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
+
+ <li><a href="../MCollective/Application.html">MCollective::Application</a></li>
+
+ <li><a href="../MCollective/Applications.html">MCollective::Applications</a></li>
+
+ <li><a href="../MCollective/Cache.html">MCollective::Cache</a></li>
+
+ <li><a href="../MCollective/Client.html">MCollective::Client</a></li>
+
+ <li><a href="../MCollective/CodedError.html">MCollective::CodedError</a></li>
+
+ <li><a href="../MCollective/Config.html">MCollective::Config</a></li>
+
+ <li><a href="../MCollective/Connector.html">MCollective::Connector</a></li>
+
+ <li><a href="../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
+
+ <li><a href="../MCollective/DDL.html">MCollective::DDL</a></li>
+
+ <li><a href="../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
+
+ <li><a href="../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
+
+ <li><a href="../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
+
+ <li><a href="../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
+
+ <li><a href="../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
+
+ <li><a href="../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
+
+ <li><a href="../MCollective/Data.html">MCollective::Data</a></li>
+
+ <li><a href="../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
+
+ <li><a href="../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
+
+ <li><a href="../MCollective/Discovery.html">MCollective::Discovery</a></li>
+
+ <li><a href="../MCollective/Facts.html">MCollective::Facts</a></li>
+
+ <li><a href="../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
+
+ <li><a href="../MCollective/Generators.html">MCollective::Generators</a></li>
+
+ <li><a href="../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
+
+ <li><a href="../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
+
+ <li><a href="../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
+
+ <li><a href="../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
+
+ <li><a href="../MCollective/Log.html">MCollective::Log</a></li>
+
+ <li><a href="../MCollective/Logger.html">MCollective::Logger</a></li>
+
+ <li><a href="../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
+
+ <li><a href="../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
+
+ <li><a href="../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
+
+ <li><a href="../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
+
+ <li><a href="../MCollective/Matcher.html">MCollective::Matcher</a></li>
+
+ <li><a href="../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
+
+ <li><a href="../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
+
+ <li><a href="../MCollective/Message.html">MCollective::Message</a></li>
+
+ <li><a href="../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
+
+ <li><a href="../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
+
+ <li><a href="../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
+
+ <li><a href="../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
+
+ <li><a href="../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
+
+ <li><a href="../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
+
+ <li><a href="../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
+
+ <li><a href="../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
+
+ <li><a href="../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
+
+ <li><a href="../MCollective/RPC.html">MCollective::RPC</a></li>
+
+ <li><a href="../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
+
+ <li><a href="../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
+
+ <li><a href="../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
+
+ <li><a href="../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
+
+ <li><a href="../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
+
+ <li><a href="../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
+
+ <li><a href="../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
+
+ <li><a href="../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
+
+ <li><a href="../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
+
+ <li><a href="../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
+
+ <li><a href="../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
+
+ <li><a href="../MCollective/RPCError.html">MCollective::RPCError</a></li>
+
+ <li><a href="../MCollective/Registration.html">MCollective::Registration</a></li>
+
+ <li><a href="../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
+
+ <li><a href="../MCollective/Runner.html">MCollective::Runner</a></li>
+
+ <li><a href="../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
+
+ <li><a href="../MCollective/SSL.html">MCollective::SSL</a></li>
+
+ <li><a href="../MCollective/Security.html">MCollective::Security</a></li>
+
+ <li><a href="../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
+
+ <li><a href="../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
+
+ <li><a href="../MCollective/Shell.html">MCollective::Shell</a></li>
+
+ <li><a href="../MCollective/Translatable.html">MCollective::Translatable</a></li>
+
+ <li><a href="../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
+
+ <li><a href="../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
+
+ <li><a href="../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
+
+ <li><a href="../MCollective/Util.html">MCollective::Util</a></li>
+
+ <li><a href="../MCollective/Validator.html">MCollective::Validator</a></li>
+
+ <li><a href="../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
+
+ <li><a href="../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
+
+ <li><a href="../Array.html">Array</a></li>
+
+ <li><a href="../Dir.html">Dir</a></li>
+
+ <li><a href="../Object.html">Object</a></li>
+
+ <li><a href="../String.html">String</a></li>
+
+ <li><a href="../Symbol.html">Symbol</a></li>
+
+ </ul>
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
+ </div>
+
+
+ </div>
+ </div>
+
+ <div id="documentation">
+ <h1 class="class">MCollective::Message</h1>
+
+ <div id="description">
+ <p>
+container for a message, its headers, agent, collective and other meta data
+</p>
+
+ </div>
+
+ <!-- Constants -->
+
+ <div id="constants-list" class="section">
+ <h3 class="section-header">Constants</h3>
+ <dl>
+
+ <dt><a name="VALIDTYPES">VALIDTYPES</a></dt>
+
+ <dd class="description missing-docs">(Not documented)</dd>
+
+
+ </dl>
+ </div>
+
+
+ <!-- Attributes -->
+
+ <div id="attribute-method-details" class="method-section section">
+ <h3 class="section-header">Attributes</h3>
+
+
+ <div id="message-attribute-method" class="method-detail">
+ <a name="message"></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">message</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="request-attribute-method" class="method-detail">
+ <a name="request"></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">request</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="validated-attribute-method" class="method-detail">
+ <a name="validated"></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">validated</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="msgtime-attribute-method" class="method-detail">
+ <a name="msgtime"></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">msgtime</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="payload-attribute-method" class="method-detail">
+ <a name="payload"></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">payload</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="type-attribute-method" class="method-detail">
+ <a name="type"></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">type</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="expected-msgid-attribute-method" class="method-detail">
+ <a name="expected_msgid"></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">expected_msgid</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="reply-to-attribute-method" class="method-detail">
+ <a name="reply_to"></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">reply_to</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="headers-attribute-method" class="method-detail">
+ <a name="headers"></a>
+
+ <a name="headers="></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">headers</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="agent-attribute-method" class="method-detail">
+ <a name="agent"></a>
+
+ <a name="agent="></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">agent</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="collective-attribute-method" class="method-detail">
+ <a name="collective"></a>
+
+ <a name="collective="></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">collective</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="filter-attribute-method" class="method-detail">
+ <a name="filter"></a>
+
+ <a name="filter="></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">filter</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="requestid-attribute-method" class="method-detail">
+ <a name="requestid"></a>
+
+ <a name="requestid="></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">requestid</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="discovered-hosts-attribute-method" class="method-detail">
+ <a name="discovered_hosts"></a>
+
+ <a name="discovered_hosts="></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">discovered_hosts</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="options-attribute-method" class="method-detail">
+ <a name="options"></a>
+
+ <a name="options="></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">options</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ <div id="ttl-attribute-method" class="method-detail">
+ <a name="ttl"></a>
+
+ <a name="ttl="></a>
+
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">ttl</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- Methods -->
+
+ <div id="public-class-method-details" class="method-section section">
+ <h3 class="section-header">Public Class Methods</h3>
+
+
+ <div id="new-method" class="method-detail ">
+ <a name="M000051"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">new</span><span
+ class="method-args">(payload, message, options = {})</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p>
+payload - the message body without headers etc, just the text message - the
+original message received from the middleware options[:base64] - if the
+body base64 encoded? options[:agent] - the agent the message is for/from
+options[:collective] - the collective its for/from options[:headers] - the
+message headers options[:type] - an indicator about the type of message,
+:message, :request, :direct_request or :reply options[:request] - if this
+is a reply this should old the message we are replying to options[:filter]
+- for requests, the filter to encode into the message options[:options] -
+the normal client options hash options[:ttl] - the maximum amount of
+seconds this message can be valid for options[:<a
+href="Message.html#expected_msgid">expected_msgid</a>] - in the case of
+replies this is the msgid it is expecting in the replies
+options[:requestid] - specific request id to use else one will be generated
+</p>
+
+
+
+ <div class="method-source-code"
+ id="new-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 23</span>
+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> = {})
+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>,
+25: <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
+26: <span class="ruby-identifier">:headers</span> =<span class="ruby-operator">></span> {},
+27: <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:message</span>,
+28: <span class="ruby-identifier">:request</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
+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>,
+30: <span class="ruby-identifier">:options</span> =<span class="ruby-operator">></span> {},
+31: <span class="ruby-identifier">:ttl</span> =<span class="ruby-operator">></span> <span class="ruby-value">60</span>,
+32: <span class="ruby-identifier">:expected_msgid</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
+33: <span class="ruby-identifier">:requestid</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
+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>)
+35:
+36: <span class="ruby-ivar">@payload</span> = <span class="ruby-identifier">payload</span>
+37: <span class="ruby-ivar">@message</span> = <span class="ruby-identifier">message</span>
+38: <span class="ruby-ivar">@requestid</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:requestid</span>]
+39: <span class="ruby-ivar">@discovered_hosts</span> = <span class="ruby-keyword kw">nil</span>
+40: <span class="ruby-ivar">@reply_to</span> = <span class="ruby-keyword kw">nil</span>
+41:
+42: <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:type</span>]
+43: <span class="ruby-ivar">@headers</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:headers</span>]
+44: <span class="ruby-ivar">@base64</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base64</span>]
+45: <span class="ruby-ivar">@filter</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>]
+46: <span class="ruby-ivar">@expected_msgid</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:expected_msgid</span>]
+47: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:options</span>]
+48:
+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>
+50: <span class="ruby-ivar">@msgtime</span> = <span class="ruby-value">0</span>
+51:
+52: <span class="ruby-ivar">@validated</span> = <span class="ruby-keyword kw">false</span>
+53:
+54: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:request</span>]
+55: <span class="ruby-ivar">@request</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:request</span>]
+56: <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">agent</span>
+57: <span class="ruby-ivar">@collective</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">collective</span>
+58: <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">:reply</span>
+59: <span class="ruby-keyword kw">else</span>
+60: <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:agent</span>]
+61: <span class="ruby-ivar">@collective</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:collective</span>]
+62: <span class="ruby-keyword kw">end</span>
+63:
+64: <span class="ruby-identifier">base64_decode!</span>
+65: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+ <div id="public-instance-method-details" class="method-section section">
+ <h3 class="section-header">Public Instance Methods</h3>
+
+
+ <div id="base--method" class="method-detail ">
+ <a name="M000057"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">base64?</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+
+
+ <div class="method-source-code"
+ id="base--source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 129</span>
+129: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64?</span>
+130: <span class="ruby-ivar">@base64</span>
+131: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="base-decode--method" class="method-detail ">
+ <a name="M000055"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">base64_decode!</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+
+
+ <div class="method-source-code"
+ id="base-decode--source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 115</span>
+115: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64_decode!</span>
+116: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@base64</span>
+117:
+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>)
+119: <span class="ruby-ivar">@base64</span> = <span class="ruby-keyword kw">false</span>
+120: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="base-encode--method" class="method-detail ">
+ <a name="M000056"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">base64_encode!</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+
+
+ <div class="method-source-code"
+ id="base-encode--source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 122</span>
+122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64_encode!</span>
+123: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@base64</span>
+124:
+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>)
+126: <span class="ruby-ivar">@base64</span> = <span class="ruby-keyword kw">true</span>
+127: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="create-reqid-method" class="method-detail ">
+ <a name="M000066"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">create_reqid</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+
+
+ <div class="method-source-code"
+ id="create-reqid-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 226</span>
+226: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_reqid</span>
+227: <span class="ruby-comment cmt"># we gsub out the -s so that the format of the id does not</span>
+228: <span class="ruby-comment cmt"># change from previous versions, these should just be more</span>
+229: <span class="ruby-comment cmt"># unique than previous ones</span>
+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>)
+231: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="decode--method" class="method-detail ">
+ <a name="M000061"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">decode!</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+
+
+ <div class="method-source-code"
+ id="decode--source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 175</span>
+175: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decode!</span>
+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>)
+177:
+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>)
+179:
+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>
+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>])
+182: <span class="ruby-keyword kw">end</span>
+183:
+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>
+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>)
+186: <span class="ruby-keyword kw">end</span>
+187: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="encode--method" class="method-detail ">
+ <a name="M000058"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">encode!</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+
+
+ <div class="method-source-code"
+ id="encode--source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 133</span>
+133: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode!</span>
+134: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span>
+135: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:reply</span>
+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>
+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>])
+138:
+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>]
+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>])
+141: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:direct_request</span>
+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>
+143:
+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>
+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>)
+146: <span class="ruby-keyword kw">else</span>
+147: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Cannot encode #{type} messages"</span>
+148: <span class="ruby-keyword kw">end</span>
+149: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="expected-msgid--method" class="method-detail ">
+ <a name="M000054"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">expected_msgid=</span><span
+ class="method-args">(msgid)</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p>
+in the case of reply messages we are expecting replies to a previously
+created message. This stores a hint to that previously sent message id and
+can be used by other classes like the security plugins as a means of
+optimizing their behavior like by ignoring messages not directed at us.
+</p>
+
+
+
+ <div class="method-source-code"
+ id="expected-msgid--source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 110</span>
+110: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expected_msgid=</span>(<span class="ruby-identifier">msgid</span>)
+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>
+112: <span class="ruby-ivar">@expected_msgid</span> = <span class="ruby-identifier">msgid</span>
+113: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="publish-method" class="method-detail ">
+ <a name="M000063"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">publish</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p>
+publish a reply message by creating a target name and sending it
+</p>
+
+
+
+ <div class="method-source-code"
+ id="publish-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 213</span>
+213: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">publish</span>
+214: <span class="ruby-comment cmt"># If we've been specificaly told about hosts that were discovered</span>
+215: <span class="ruby-comment cmt"># use that information to do P2P calls if appropriate else just</span>
+216: <span class="ruby-comment cmt"># send it as is.</span>
+217: <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+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>)
+219: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:direct_request</span>
+220: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Handling #{requestid} as a direct request"</span>)
+221: <span class="ruby-keyword kw">end</span>
+222:
+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>)
+224: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="reply-to--method" class="method-detail ">
+ <a name="M000053"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">reply_to=</span><span
+ class="method-args">(target)</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p>
+Sets a custom reply-to target for requests. The connector plugin should
+inspect this when constructing requests and set this header ensuring
+replies will go to the custom target otherwise the connector should just do
+what it usually does
+</p>
+
+
+
+ <div class="method-source-code"
+ id="reply-to--source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 99</span>
+ 99: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reply_to=</span>(<span class="ruby-identifier">target</span>)
+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>)
+101:
+102: <span class="ruby-ivar">@reply_to</span> = <span class="ruby-identifier">target</span>
+103: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="type--method" class="method-detail ">
+ <a name="M000052"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">type=</span><span
+ class="method-args">(type)</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p>
+Sets the message type to one of the known types. In the case of
+:direct_request the list of hosts to communicate with should have been set
+with <a href="Message.html#discovered_hosts">discovered_hosts</a> else an
+exception will be raised. This is for extra security, we never accidentally
+want to send a direct request without a list of hosts or something weird
+like that as it might result in a filterless broadcast being sent.
+</p>
+<p>
+Additionally you simply cannot set :direct_request if direct_addressing was
+not enabled this is to force a workflow that doesnt not yield in a mistake
+when someone might assume direct_addressing is enabled when its not.
+</p>
+
+
+
+ <div class="method-source-code"
+ id="type--source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 76</span>
+76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type=</span>(<span class="ruby-identifier">type</span>)
+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>)
+78:
+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>
+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>
+81:
+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>
+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>
+84: <span class="ruby-keyword kw">end</span>
+85:
+86: <span class="ruby-comment cmt"># clear out the filter, custom discovery sources might interpret the filters</span>
+87: <span class="ruby-comment cmt"># different than the remote mcollectived and in directed mode really the only</span>
+88: <span class="ruby-comment cmt"># filter that matters is the agent filter</span>
+89: <span class="ruby-ivar">@filter</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
+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>
+91: <span class="ruby-keyword kw">end</span>
+92:
+93: <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">type</span>
+94: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="validate-method" class="method-detail ">
+ <a name="M000062"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">validate</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p>
+Perform validation against the message by checking filters and ttl
+</p>
+
+
+
+ <div class="method-source-code"
+ id="validate-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 190</span>
+190: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate</span>
+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>
+192:
+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>
+194:
+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>
+196: <span class="ruby-identifier">cid</span> = <span class="ruby-value str">""</span>
+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>)
+198: <span class="ruby-identifier">cid</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:senderid</span>]
+199:
+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>
+201: <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"global_stats"</span>].<span class="ruby-identifier">ttlexpired</span>
+202:
+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>)
+204: <span class="ruby-keyword kw">end</span>
+205: <span class="ruby-keyword kw">end</span>
+206:
+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>])
+208:
+209: <span class="ruby-ivar">@validated</span> = <span class="ruby-keyword kw">true</span>
+210: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <div id="validate-compound-filter-method" class="method-detail ">
+ <a name="M000059"></a>
+
+ <div class="method-heading">
+
+ <span class="method-name">validate_compound_filter</span><span
+ class="method-args">(compound_filter)</span>
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+ <div class="method-description">
+
+ <p class="missing-docs">(Not documented)</p>
+
+
+
+ <div class="method-source-code"
+ id="validate-compound-filter-source">
+<pre>
+ <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 151</span>
+151: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_compound_filter</span>(<span class="ruby-identifier">compound_filter</span>)
+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>
+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>
+154: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">statement</span>[<span class="ruby-value str">"fstatement"</span>]
+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>]
+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>)
+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>]
+158:
+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>)
+160:
+161: <span class="ruby-comment cmt"># parses numbers and booleans entered as strings into proper</span>
+162: <span class="ruby-comment cmt"># types of data so that DDL validation will pass</span>
+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>])
+164:
+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>])
+166:
+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>)
+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>})
+169: <span class="ruby-keyword kw">end</span>
+170: <span class="ruby-keyword kw">end</span>
+171: <span class="ruby-keyword kw">end</span>
+172: <span class="ruby-keyword kw">end</span>
+173: <span class="ruby-keyword kw">end</span></pre>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
+
+ <p>Disabled; run with --debug to generate this.</p>
+
+ </div>
+
+ <div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
+ Rdoc Generator</a> 1.1.6</small>.</p>
+ </div>
+
+</body>
+</html>
+