You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-dev@james.apache.org by ba...@apache.org on 2006/08/07 17:40:09 UTC

svn commit: r429369 [20/24] - in /james/site/trunk/www/postage: ./ apidocs/ apidocs/org/ apidocs/org/apache/ apidocs/org/apache/james/ apidocs/org/apache/james/postage/ apidocs/org/apache/james/postage/class-use/ apidocs/org/apache/james/postage/client...

Added: james/site/trunk/www/postage/xref/org/apache/james/postage/client/RemoteManagerClient.html
URL: http://svn.apache.org/viewvc/james/site/trunk/www/postage/xref/org/apache/james/postage/client/RemoteManagerClient.html?rev=429369&view=auto
==============================================================================
--- james/site/trunk/www/postage/xref/org/apache/james/postage/client/RemoteManagerClient.html (added)
+++ james/site/trunk/www/postage/xref/org/apache/james/postage/client/RemoteManagerClient.html Mon Aug  7 08:40:01 2006
@@ -0,0 +1,164 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>RemoteManagerClient xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../../../apidocs/org/apache/james/postage/client/RemoteManagerClient.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em>/**<em>**********************************************************************</em></em>
+<a name="2" href="#2">2</a>   <em> * Copyright (c) 2006 The Apache Software Foundation.                  *</em>
+<a name="3" href="#3">3</a>   <em> * All rights reserved.                                                *</em>
+<a name="4" href="#4">4</a>   <em> * ------------------------------------------------------------------- *</em>
+<a name="5" href="#5">5</a>   <em> * Licensed under the Apache License, Version 2.0 (the "License"); you *</em>
+<a name="6" href="#6">6</a>   <em> * may not use this file except in compliance with the License. You    *</em>
+<a name="7" href="#7">7</a>   <em> * may obtain a copy of the License at:                                *</em>
+<a name="8" href="#8">8</a>   <em> *                                                                     *</em>
+<a name="9" href="#9">9</a>   <em> *     <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a>                      *</em>
+<a name="10" href="#10">10</a>  <em> *                                                                     *</em>
+<a name="11" href="#11">11</a>  <em> * Unless required by applicable law or agreed to in writing, software *</em>
+<a name="12" href="#12">12</a>  <em> * distributed under the License is distributed on an "AS IS" BASIS,   *</em>
+<a name="13" href="#13">13</a>  <em> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *</em>
+<a name="14" href="#14">14</a>  <em> * implied.  See the License for the specific language governing       *</em>
+<a name="15" href="#15">15</a>  <em> * permissions and limitations under the License.                      *</em>
+<a name="16" href="#16">16</a>  <em> ***********************************************************************/</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <strong>package</strong> org.apache.james.postage.client;
+<a name="20" href="#20">20</a>  
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.commons.net.telnet.TelnetClient;
+<a name="22" href="#22">22</a>  
+<a name="23" href="#23">23</a>  <strong>import</strong> java.io.BufferedInputStream;
+<a name="24" href="#24">24</a>  <strong>import</strong> java.io.BufferedReader;
+<a name="25" href="#25">25</a>  <strong>import</strong> java.io.IOException;
+<a name="26" href="#26">26</a>  <strong>import</strong> java.io.InputStreamReader;
+<a name="27" href="#27">27</a>  <strong>import</strong> java.io.OutputStreamWriter;
+<a name="28" href="#28">28</a>  <strong>import</strong> java.io.Writer;
+<a name="29" href="#29">29</a>  <strong>import</strong> java.util.ArrayList;
+<a name="30" href="#30">30</a>  <strong>import</strong> java.util.List;
+<a name="31" href="#31">31</a>  
+<a name="32" href="#32">32</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../../org/apache/james/postage/client/RemoteManagerClient.html">RemoteManagerClient</a> {
+<a name="33" href="#33">33</a>  
+<a name="34" href="#34">34</a>      <strong>private</strong> String  m_host = <strong>null</strong>;
+<a name="35" href="#35">35</a>      <strong>private</strong> <strong>int</strong>     m_port = -1;
+<a name="36" href="#36">36</a>      <strong>private</strong> String  m_username = <strong>null</strong>;
+<a name="37" href="#37">37</a>      <strong>private</strong> String  m_password = <strong>null</strong>;
+<a name="38" href="#38">38</a>      <strong>private</strong> TelnetClient m_telnetClient;
+<a name="39" href="#39">39</a>      <strong>private</strong> BufferedReader m_reader;
+<a name="40" href="#40">40</a>      <strong>private</strong> Writer m_writer;
+<a name="41" href="#41">41</a>  
+<a name="42" href="#42">42</a>      <strong>public</strong> <a href="../../../../../org/apache/james/postage/client/RemoteManagerClient.html">RemoteManagerClient</a>(String host, <strong>int</strong> port, String username, String password) {
+<a name="43" href="#43">43</a>          m_host = host;
+<a name="44" href="#44">44</a>          m_port = port;
+<a name="45" href="#45">45</a>          m_username = username;
+<a name="46" href="#46">46</a>          m_password = password;
+<a name="47" href="#47">47</a>      }
+<a name="48" href="#48">48</a>  
+<a name="49" href="#49">49</a>      <strong>public</strong> <strong>boolean</strong> login() {
+<a name="50" href="#50">50</a>          m_telnetClient = <strong>new</strong> TelnetClient();
+<a name="51" href="#51">51</a>          <strong>try</strong> {
+<a name="52" href="#52">52</a>              m_telnetClient.connect(m_host, m_port);
+<a name="53" href="#53">53</a>              m_reader = <strong>new</strong> BufferedReader(<strong>new</strong> InputStreamReader(<strong>new</strong> BufferedInputStream(m_telnetClient.getInputStream(), 1024), <span class="string">"ASCII"</span>));
+<a name="54" href="#54">54</a>              m_writer = <strong>new</strong> OutputStreamWriter(m_telnetClient.getOutputStream());
+<a name="55" href="#55">55</a>          } <strong>catch</strong> (IOException e) {
+<a name="56" href="#56">56</a>              e.printStackTrace();
+<a name="57" href="#57">57</a>              <strong>return</strong> false;
+<a name="58" href="#58">58</a>          }
+<a name="59" href="#59">59</a>  
+<a name="60" href="#60">60</a>          <strong>try</strong> {
+<a name="61" href="#61">61</a>              sendCommand(m_username);
+<a name="62" href="#62">62</a>              delay();
+<a name="63" href="#63">63</a>              sendCommand(m_password);
+<a name="64" href="#64">64</a>          } <strong>catch</strong> (IOException e) {
+<a name="65" href="#65">65</a>              e.printStackTrace();
+<a name="66" href="#66">66</a>          }
+<a name="67" href="#67">67</a>  
+<a name="68" href="#68">68</a>          List answers = readAnswer();
+<a name="69" href="#69">69</a>          <strong>if</strong> (answers == <strong>null</strong> || answers.size() == 0 || !((String)answers.get(answers.size() - 1)).startsWith(<span class="string">"Welcome"</span>))
+<a name="70" href="#70">70</a>          {
+<a name="71" href="#71">71</a>              disconnect();
+<a name="72" href="#72">72</a>              <strong>return</strong> false;
+<a name="73" href="#73">73</a>          }
+<a name="74" href="#74">74</a>          <strong>return</strong> <strong>true</strong>;
+<a name="75" href="#75">75</a>      }
+<a name="76" href="#76">76</a>  
+<a name="77" href="#77">77</a>      <strong>public</strong> <strong>void</strong> disconnect() {
+<a name="78" href="#78">78</a>          <strong>if</strong> (m_telnetClient == <strong>null</strong>) <strong>return</strong>;
+<a name="79" href="#79">79</a>          <strong>try</strong> {
+<a name="80" href="#80">80</a>              m_telnetClient.disconnect();
+<a name="81" href="#81">81</a>          } <strong>catch</strong> (IOException e) {
+<a name="82" href="#82">82</a>              e.printStackTrace();
+<a name="83" href="#83">83</a>          } <strong>finally</strong>{
+<a name="84" href="#84">84</a>              m_telnetClient = <strong>null</strong>;
+<a name="85" href="#85">85</a>              m_reader = <strong>null</strong>;
+<a name="86" href="#86">86</a>              m_writer = <strong>null</strong>;
+<a name="87" href="#87">87</a>          }
+<a name="88" href="#88">88</a>      }
+<a name="89" href="#89">89</a>  
+<a name="90" href="#90">90</a>      <strong>public</strong> List executeCommand(String command) {
+<a name="91" href="#91">91</a>          <strong>try</strong> {
+<a name="92" href="#92">92</a>              sendCommand(command);
+<a name="93" href="#93">93</a>          } <strong>catch</strong> (IOException e) {
+<a name="94" href="#94">94</a>              e.printStackTrace();
+<a name="95" href="#95">95</a>              <strong>return</strong> <strong>null</strong>;
+<a name="96" href="#96">96</a>          }
+<a name="97" href="#97">97</a>  
+<a name="98" href="#98">98</a>          List list = readAnswer();
+<a name="99" href="#99">99</a>          <strong>return</strong> list;
+<a name="100" href="#100">100</a>     }
+<a name="101" href="#101">101</a> 
+<a name="102" href="#102">102</a>     <strong>protected</strong> <strong>void</strong> sendCommand(String command) throws IOException {
+<a name="103" href="#103">103</a>         m_writer.write(command + <span class="string">"\n"</span>);
+<a name="104" href="#104">104</a>         m_writer.flush();
+<a name="105" href="#105">105</a>     }
+<a name="106" href="#106">106</a> 
+<a name="107" href="#107">107</a>     <strong>public</strong> List readAnswer() {
+<a name="108" href="#108">108</a>         <strong>return</strong> readAnswer(0);
+<a name="109" href="#109">109</a>     }
+<a name="110" href="#110">110</a>     
+<a name="111" href="#111">111</a>     <strong>protected</strong> List readAnswer(<strong>int</strong> numLines) {
+<a name="112" href="#112">112</a>         List allAnswerLines = <strong>new</strong> ArrayList();
+<a name="113" href="#113">113</a>         <strong>try</strong> {
+<a name="114" href="#114">114</a>             delay();
+<a name="115" href="#115">115</a>             <strong>if</strong> (numLines > 0) {
+<a name="116" href="#116">116</a>                 <strong>for</strong> (<strong>int</strong> i = 0; i &lt; numLines; i++) {
+<a name="117" href="#117">117</a>                     readline(allAnswerLines);
+<a name="118" href="#118">118</a>                 }
+<a name="119" href="#119">119</a>             } <strong>else</strong> {
+<a name="120" href="#120">120</a>                 readline(allAnswerLines);
+<a name="121" href="#121">121</a>                 
+<a name="122" href="#122">122</a>                 <strong>while</strong> (m_reader.ready()) {
+<a name="123" href="#123">123</a>                     <strong>while</strong> (m_reader.ready()) {
+<a name="124" href="#124">124</a>                         readline(allAnswerLines);
+<a name="125" href="#125">125</a>                     }
+<a name="126" href="#126">126</a>                     delay();
+<a name="127" href="#127">127</a>                 }
+<a name="128" href="#128">128</a>             }
+<a name="129" href="#129">129</a>             <strong>return</strong> allAnswerLines;
+<a name="130" href="#130">130</a>         } <strong>catch</strong> (NullPointerException e) {
+<a name="131" href="#131">131</a>             <strong>return</strong> <strong>null</strong>;
+<a name="132" href="#132">132</a>         } <strong>catch</strong> (IOException e) {
+<a name="133" href="#133">133</a>             <strong>return</strong> <strong>null</strong>;
+<a name="134" href="#134">134</a>         }
+<a name="135" href="#135">135</a>     }
+<a name="136" href="#136">136</a> 
+<a name="137" href="#137">137</a>     <strong>private</strong> <strong>void</strong> readline(List allAnswerLines) throws IOException {
+<a name="138" href="#138">138</a>         <strong>if</strong> (!m_reader.ready()) <strong>return</strong>;
+<a name="139" href="#139">139</a>         String line = m_reader.readLine();
+<a name="140" href="#140">140</a>         <strong>if</strong> (line != <strong>null</strong>) allAnswerLines.add(line);
+<a name="141" href="#141">141</a>     }
+<a name="142" href="#142">142</a> 
+<a name="143" href="#143">143</a>     <strong>private</strong> <strong>void</strong> delay() {
+<a name="144" href="#144">144</a>         <strong>try</strong> {
+<a name="145" href="#145">145</a>             Thread.sleep(100);
+<a name="146" href="#146">146</a>         } <strong>catch</strong> (InterruptedException e) {
+<a name="147" href="#147">147</a>         }
+<a name="148" href="#148">148</a>     }
+<a name="149" href="#149">149</a> 
+<a name="150" href="#150">150</a> 
+<a name="151" href="#151">151</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: james/site/trunk/www/postage/xref/org/apache/james/postage/client/RemoteManagerClient.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: james/site/trunk/www/postage/xref/org/apache/james/postage/client/SMTPClient.html
URL: http://svn.apache.org/viewvc/james/site/trunk/www/postage/xref/org/apache/james/postage/client/SMTPClient.html?rev=429369&view=auto
==============================================================================
--- james/site/trunk/www/postage/xref/org/apache/james/postage/client/SMTPClient.html (added)
+++ james/site/trunk/www/postage/xref/org/apache/james/postage/client/SMTPClient.html Mon Aug  7 08:40:01 2006
@@ -0,0 +1,161 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>SMTPClient xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../../../apidocs/org/apache/james/postage/client/SMTPClient.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em>/**<em>**********************************************************************</em></em>
+<a name="2" href="#2">2</a>   <em> * Copyright (c) 2006 The Apache Software Foundation.                  *</em>
+<a name="3" href="#3">3</a>   <em> * All rights reserved.                                                *</em>
+<a name="4" href="#4">4</a>   <em> * ------------------------------------------------------------------- *</em>
+<a name="5" href="#5">5</a>   <em> * Licensed under the Apache License, Version 2.0 (the "License"); you *</em>
+<a name="6" href="#6">6</a>   <em> * may not use this file except in compliance with the License. You    *</em>
+<a name="7" href="#7">7</a>   <em> * may obtain a copy of the License at:                                *</em>
+<a name="8" href="#8">8</a>   <em> *                                                                     *</em>
+<a name="9" href="#9">9</a>   <em> *     <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a>                      *</em>
+<a name="10" href="#10">10</a>  <em> *                                                                     *</em>
+<a name="11" href="#11">11</a>  <em> * Unless required by applicable law or agreed to in writing, software *</em>
+<a name="12" href="#12">12</a>  <em> * distributed under the License is distributed on an "AS IS" BASIS,   *</em>
+<a name="13" href="#13">13</a>  <em> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *</em>
+<a name="14" href="#14">14</a>  <em> * implied.  See the License for the specific language governing       *</em>
+<a name="15" href="#15">15</a>  <em> * permissions and limitations under the License.                      *</em>
+<a name="16" href="#16">16</a>  <em> ***********************************************************************/</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <strong>package</strong> org.apache.james.postage.client;
+<a name="20" href="#20">20</a>  
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.james.postage.SamplingException;
+<a name="22" href="#22">22</a>  <strong>import</strong> org.apache.james.postage.StartupException;
+<a name="23" href="#23">23</a>  <strong>import</strong> org.apache.james.postage.configuration.MailSender;
+<a name="24" href="#24">24</a>  <strong>import</strong> org.apache.james.postage.execution.Sampler;
+<a name="25" href="#25">25</a>  <strong>import</strong> org.apache.james.postage.result.MailProcessingRecord;
+<a name="26" href="#26">26</a>  <strong>import</strong> org.apache.james.postage.result.PostageRunnerResult;
+<a name="27" href="#27">27</a>  <strong>import</strong> org.apache.james.postage.user.UserList;
+<a name="28" href="#28">28</a>  
+<a name="29" href="#29">29</a>  <strong>import</strong> javax.mail.Message;
+<a name="30" href="#30">30</a>  <strong>import</strong> javax.mail.MessagingException;
+<a name="31" href="#31">31</a>  <strong>import</strong> javax.mail.Session;
+<a name="32" href="#32">32</a>  <strong>import</strong> javax.mail.Transport;
+<a name="33" href="#33">33</a>  <strong>import</strong> javax.mail.internet.InternetAddress;
+<a name="34" href="#34">34</a>  <strong>import</strong> java.util.Properties;
+<a name="35" href="#35">35</a>  
+<a name="36" href="#36">36</a>  <em>/**<em>*</em></em>
+<a name="37" href="#37">37</a>  <em> * connects as a SMTP client and handles all mail according to its configuration.</em>
+<a name="38" href="#38">38</a>  <em> * it is threadsafe and reentrant and thus can be reused over multiple parallel client session </em>
+<a name="39" href="#39">39</a>  <em> */</em>
+<a name="40" href="#40">40</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../../org/apache/james/postage/client/SMTPClient.html">SMTPClient</a> implements <a href="../../../../../org/apache/james/postage/execution/Sampler.html">Sampler</a> {
+<a name="41" href="#41">41</a>  
+<a name="42" href="#42">42</a>      <strong>private</strong> String m_host;
+<a name="43" href="#43">43</a>      <strong>private</strong> <strong>int</strong> m_port;
+<a name="44" href="#44">44</a>      <strong>private</strong> <a href="../../../../../org/apache/james/postage/user/UserList.html">UserList</a> m_internalUsers;
+<a name="45" href="#45">45</a>      <strong>private</strong> <a href="../../../../../org/apache/james/postage/user/UserList.html">UserList</a> m_externalUsers;
+<a name="46" href="#46">46</a>      <strong>private</strong> <a href="../../../../../org/apache/james/postage/result/PostageRunnerResult.html">PostageRunnerResult</a> m_results;
+<a name="47" href="#47">47</a>      <strong>private</strong> <a href="../../../../../org/apache/james/postage/configuration/MailSender.html">MailSender</a> m_mailSender;
+<a name="48" href="#48">48</a>  
+<a name="49" href="#49">49</a>      <strong>public</strong> <a href="../../../../../org/apache/james/postage/client/SMTPClient.html">SMTPClient</a>(String host, <strong>int</strong> port, <a href="../../../../../org/apache/james/postage/user/UserList.html">UserList</a> <strong>int</strong>ernalUsers, <a href="../../../../../org/apache/james/postage/user/UserList.html">UserList</a> externalUsers, <a href="../../../../../org/apache/james/postage/result/PostageRunnerResult.html">PostageRunnerResult</a> results, <a href="../../../../../org/apache/james/postage/configuration/MailSender.html">MailSender</a> mailSender) {
+<a name="50" href="#50">50</a>          m_host = host;
+<a name="51" href="#51">51</a>          m_port = port;
+<a name="52" href="#52">52</a>          m_internalUsers = internalUsers;
+<a name="53" href="#53">53</a>          m_externalUsers = externalUsers;
+<a name="54" href="#54">54</a>          m_mailSender = mailSender;
+<a name="55" href="#55">55</a>          m_results = results;
+<a name="56" href="#56">56</a>      }
+<a name="57" href="#57">57</a>  
+<a name="58" href="#58">58</a>      <strong>public</strong> <strong>boolean</strong> checkAvailability() throws StartupException {
+<a name="59" href="#59">59</a>          <strong>try</strong> {
+<a name="60" href="#60">60</a>  
+<a name="61" href="#61">61</a>              <a href="../../../../../org/apache/james/postage/result/MailProcessingRecord.html">MailProcessingRecord</a> proformaMailProcessingRecord = <strong>new</strong> <a href="../../../../../org/apache/james/postage/result/MailProcessingRecord.html">MailProcessingRecord</a>();
+<a name="62" href="#62">62</a>              Session session = getMailSession();
+<a name="63" href="#63">63</a>              Message message = m_mailSender.createMail(session, proformaMailProcessingRecord);
+<a name="64" href="#64">64</a>              setMailFromAndTo(message, proformaMailProcessingRecord);
+<a name="65" href="#65">65</a>              Transport.send(message);
+<a name="66" href="#66">66</a>          } <strong>catch</strong> (Exception e) {
+<a name="67" href="#67">67</a>              <strong>throw</strong> <strong>new</strong> <a href="../../../../../org/apache/james/postage/StartupException.html">StartupException</a>(<span class="string">"inbound SMTP service not available"</span>, e);
+<a name="68" href="#68">68</a>          }
+<a name="69" href="#69">69</a>          <strong>return</strong> <strong>true</strong>;
+<a name="70" href="#70">70</a>      }
+<a name="71" href="#71">71</a>  
+<a name="72" href="#72">72</a>      <strong>private</strong> <strong>void</strong> setMailFromAndTo(Message message, <a href="../../../../../org/apache/james/postage/result/MailProcessingRecord.html">MailProcessingRecord</a> mailProcessingRecord) throws MessagingException {
+<a name="73" href="#73">73</a>  
+<a name="74" href="#74">74</a>          String senderUsername;
+<a name="75" href="#75">75</a>          String senderMailAddress;
+<a name="76" href="#76">76</a>          <strong>if</strong> (m_mailSender.getParentProfile().isSourceInternal()) {
+<a name="77" href="#77">77</a>              senderUsername = m_internalUsers.getRandomUsername();
+<a name="78" href="#78">78</a>          } <strong>else</strong> {
+<a name="79" href="#79">79</a>              senderUsername = m_externalUsers.getRandomUsername();
+<a name="80" href="#80">80</a>          }
+<a name="81" href="#81">81</a>          <strong>if</strong> (m_mailSender.getParentProfile().isSourceInternal()) {
+<a name="82" href="#82">82</a>              senderMailAddress = m_internalUsers.getEmailAddress(senderUsername);
+<a name="83" href="#83">83</a>          } <strong>else</strong> {
+<a name="84" href="#84">84</a>              senderMailAddress = m_externalUsers.getEmailAddress(senderUsername);
+<a name="85" href="#85">85</a>          }
+<a name="86" href="#86">86</a>          mailProcessingRecord.setSender(senderUsername);
+<a name="87" href="#87">87</a>          mailProcessingRecord.setSenderMailAddress(senderMailAddress);
+<a name="88" href="#88">88</a>          message.setFrom(<strong>new</strong> InternetAddress(senderMailAddress));
+<a name="89" href="#89">89</a>  
+<a name="90" href="#90">90</a>          String recepientUsername;
+<a name="91" href="#91">91</a>          String recepientMailAddress;
+<a name="92" href="#92">92</a>          <strong>if</strong> (m_mailSender.getParentProfile().isTargetInternal()) {
+<a name="93" href="#93">93</a>              recepientUsername = m_internalUsers.getRandomUsername();
+<a name="94" href="#94">94</a>          } <strong>else</strong> {
+<a name="95" href="#95">95</a>              recepientUsername = m_externalUsers.getRandomUsername();
+<a name="96" href="#96">96</a>          }
+<a name="97" href="#97">97</a>          <strong>if</strong> (m_mailSender.getParentProfile().isTargetInternal()) {
+<a name="98" href="#98">98</a>              recepientMailAddress = m_internalUsers.getEmailAddress(recepientUsername);
+<a name="99" href="#99">99</a>          } <strong>else</strong> {
+<a name="100" href="#100">100</a>             recepientMailAddress = m_externalUsers.getEmailAddress(recepientUsername);
+<a name="101" href="#101">101</a>         }
+<a name="102" href="#102">102</a>         mailProcessingRecord.setReceiver(recepientUsername);
+<a name="103" href="#103">103</a>         mailProcessingRecord.setReceiverMailAddress(recepientMailAddress);
+<a name="104" href="#104">104</a>         message.addRecipient(Message.RecipientType.TO, <strong>new</strong> InternetAddress(recepientMailAddress));
+<a name="105" href="#105">105</a>     }
+<a name="106" href="#106">106</a> 
+<a name="107" href="#107">107</a>     <strong>public</strong> <strong>synchronized</strong> <strong>void</strong> doSample() throws SamplingException {
+<a name="108" href="#108">108</a> 
+<a name="109" href="#109">109</a>         <a href="../../../../../org/apache/james/postage/result/MailProcessingRecord.html">MailProcessingRecord</a> mailProcessingRecord = <strong>new</strong> <a href="../../../../../org/apache/james/postage/result/MailProcessingRecord.html">MailProcessingRecord</a>();
+<a name="110" href="#110">110</a>         mailProcessingRecord.setMailId(MailProcessingRecord.getNextId());
+<a name="111" href="#111">111</a>         m_results.addNewMailRecord(mailProcessingRecord);
+<a name="112" href="#112">112</a>         mailProcessingRecord.setTimeConnectStart(System.currentTimeMillis());
+<a name="113" href="#113">113</a>         
+<a name="114" href="#114">114</a>         Message message = <strong>null</strong>;
+<a name="115" href="#115">115</a>         <strong>try</strong> {
+<a name="116" href="#116">116</a>             <strong>try</strong> {
+<a name="117" href="#117">117</a>                 Session session = getMailSession();
+<a name="118" href="#118">118</a>                 message = m_mailSender.createMail(session, mailProcessingRecord);
+<a name="119" href="#119">119</a>             } <strong>catch</strong> (Exception e) {
+<a name="120" href="#120">120</a>                 mailProcessingRecord.setErrorTextSending(<span class="string">"Could not send mail"</span>);
+<a name="121" href="#121">121</a>                 <strong>throw</strong> e;
+<a name="122" href="#122">122</a>             }
+<a name="123" href="#123">123</a>             <strong>try</strong> {
+<a name="124" href="#124">124</a>                 setMailFromAndTo(message, mailProcessingRecord);
+<a name="125" href="#125">125</a>             } <strong>catch</strong> (Exception e) {
+<a name="126" href="#126">126</a>                 mailProcessingRecord.setErrorTextSending(<span class="string">"Could not set recipient"</span>);
+<a name="127" href="#127">127</a>                 <strong>throw</strong> e;
+<a name="128" href="#128">128</a>             }
+<a name="129" href="#129">129</a>             <strong>try</strong> {
+<a name="130" href="#130">130</a>                 mailProcessingRecord.setTimeSendStart(System.currentTimeMillis());
+<a name="131" href="#131">131</a>                 Transport.send(message);
+<a name="132" href="#132">132</a>                 mailProcessingRecord.setTimeSendEnd(System.currentTimeMillis());
+<a name="133" href="#133">133</a>             } <strong>catch</strong> (MessagingException e) {
+<a name="134" href="#134">134</a>                 mailProcessingRecord.setErrorTextSending(<span class="string">"Could not be transported."</span>);
+<a name="135" href="#135">135</a>                 <strong>throw</strong> e;
+<a name="136" href="#136">136</a>             }
+<a name="137" href="#137">137</a>         } <strong>catch</strong> (Exception e) {
+<a name="138" href="#138">138</a>             <strong>throw</strong> <strong>new</strong> <a href="../../../../../org/apache/james/postage/SamplingException.html">SamplingException</a>(<span class="string">"sample failed"</span>, e);
+<a name="139" href="#139">139</a>         }
+<a name="140" href="#140">140</a>     }
+<a name="141" href="#141">141</a> 
+<a name="142" href="#142">142</a>     <strong>private</strong> Session getMailSession() {
+<a name="143" href="#143">143</a>         Properties props = System.getProperties();
+<a name="144" href="#144">144</a>         props.put(<span class="string">"mail.smtp.host"</span>, m_host);
+<a name="145" href="#145">145</a>         props.put(<span class="string">"mail.smtp.port"</span>, Integer.toString(m_port));
+<a name="146" href="#146">146</a>         <strong>return</strong> Session.getDefaultInstance(props, <strong>null</strong>);
+<a name="147" href="#147">147</a>     }
+<a name="148" href="#148">148</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: james/site/trunk/www/postage/xref/org/apache/james/postage/client/SMTPClient.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-frame.html
URL: http://svn.apache.org/viewvc/james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-frame.html?rev=429369&view=auto
==============================================================================
--- james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-frame.html (added)
+++ james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-frame.html Mon Aug  7 08:40:01 2006
@@ -0,0 +1,30 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
+<html xml:lang="en" lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+        <title>Apache JAMES Postage Project 0.1-SNAPSHOT Reference Package org.apache.james.postage.client</title>
+        <link rel="stylesheet" type="text/css" href="\.\./\.\./\.\./\.\./\.\./stylesheet.css" title="style" />
+    </head>
+    <body>
+
+        <h3>
+            <a href="package-summary.html" target="classFrame">org.apache.james.postage.client</a>
+        </h3>
+
+        <h3>Classes</h3>
+
+        <ul>
+                        <li>
+                <a href="POP3Client.html" target="classFrame">POP3Client</a>
+            </li>
+                        <li>
+                <a href="RemoteManagerClient.html" target="classFrame">RemoteManagerClient</a>
+            </li>
+                        <li>
+                <a href="SMTPClient.html" target="classFrame">SMTPClient</a>
+            </li>
+                    </ul>
+
+    </body>
+</html>

Propchange: james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-frame.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-summary.html
URL: http://svn.apache.org/viewvc/james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-summary.html?rev=429369&view=auto
==============================================================================
--- james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-summary.html (added)
+++ james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-summary.html Mon Aug  7 08:40:01 2006
@@ -0,0 +1,77 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
+<html xml:lang="en" lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+        <title>Apache JAMES Postage Project 0.1-SNAPSHOT Reference Package $name</title>
+        <link rel="stylesheet" type="text/css" href="\.\./\.\./\.\./\.\./\.\./stylesheet.css" title="style" />
+    </head>
+    <body>
+                <div class="overview">
+            <ul>
+                <li>
+                    <a href="\.\./\.\./\.\./\.\./\.\./overview-summary.html">Overview</a>
+                </li>
+                <li class="selected">Package</li>
+            </ul>
+        </div>
+        <div class="framenoframe">
+            <ul>
+                <li>
+                    <a href="\.\./\.\./\.\./\.\./\.\./index.html" target="_top">FRAMES</a>
+                </li>
+                <li>
+                    <a href="package-summary.html" target="_top">NO FRAMES</a>
+                </li>
+            </ul>
+        </div>
+        
+                <h2>Package org.apache.james.postage.client</h2>
+
+        <table class="summary">
+            <thead>
+                <tr>
+                    <th>Class Summary</th>
+                </tr>
+            </thead>
+            <tbody>
+                                <tr>
+                    <td>
+                        <a href="POP3Client.html" target="classFrame">POP3Client</a>
+                    </td>
+                </tr>
+                                <tr>
+                    <td>
+                        <a href="RemoteManagerClient.html" target="classFrame">RemoteManagerClient</a>
+                    </td>
+                </tr>
+                                <tr>
+                    <td>
+                        <a href="SMTPClient.html" target="classFrame">SMTPClient</a>
+                    </td>
+                </tr>
+                            </tbody>
+        </table>
+        
+                <div class="overview">
+            <ul>
+                <li>
+                    <a href="\.\./\.\./\.\./\.\./\.\./overview-summary.html">Overview</a>
+                </li>
+                <li class="selected">Package</li>
+            </ul>
+        </div>
+        <div class="framenoframe">
+            <ul>
+                <li>
+                    <a href="\.\./\.\./\.\./\.\./\.\./index.html" target="_top">FRAMES</a>
+                </li>
+                <li>
+                    <a href="package-summary.html" target="_top">NO FRAMES</a>
+                </li>
+            </ul>
+        </div>
+                <hr />
+        Copyright &copy; 2006 Apache Software Foundation. All Rights Reserved.
+    </body>
+</html>

Propchange: james/site/trunk/www/postage/xref/org/apache/james/postage/client/package-summary.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/ConfigurationLoader.html
URL: http://svn.apache.org/viewvc/james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/ConfigurationLoader.html?rev=429369&view=auto
==============================================================================
--- james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/ConfigurationLoader.html (added)
+++ james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/ConfigurationLoader.html Mon Aug  7 08:40:01 2006
@@ -0,0 +1,188 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>ConfigurationLoader xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../../../apidocs/org/apache/james/postage/configuration/ConfigurationLoader.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em>/**<em>**********************************************************************</em></em>
+<a name="2" href="#2">2</a>   <em> * Copyright (c) 2006 The Apache Software Foundation.                  *</em>
+<a name="3" href="#3">3</a>   <em> * All rights reserved.                                                *</em>
+<a name="4" href="#4">4</a>   <em> * ------------------------------------------------------------------- *</em>
+<a name="5" href="#5">5</a>   <em> * Licensed under the Apache License, Version 2.0 (the "License"); you *</em>
+<a name="6" href="#6">6</a>   <em> * may not use this file except in compliance with the License. You    *</em>
+<a name="7" href="#7">7</a>   <em> * may obtain a copy of the License at:                                *</em>
+<a name="8" href="#8">8</a>   <em> *                                                                     *</em>
+<a name="9" href="#9">9</a>   <em> *     <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a>                      *</em>
+<a name="10" href="#10">10</a>  <em> *                                                                     *</em>
+<a name="11" href="#11">11</a>  <em> * Unless required by applicable law or agreed to in writing, software *</em>
+<a name="12" href="#12">12</a>  <em> * distributed under the License is distributed on an "AS IS" BASIS,   *</em>
+<a name="13" href="#13">13</a>  <em> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *</em>
+<a name="14" href="#14">14</a>  <em> * implied.  See the License for the specific language governing       *</em>
+<a name="15" href="#15">15</a>  <em> * permissions and limitations under the License.                      *</em>
+<a name="16" href="#16">16</a>  <em> ***********************************************************************/</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <strong>package</strong> org.apache.james.postage.configuration;
+<a name="20" href="#20">20</a>  
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.commons.configuration.Configuration;
+<a name="22" href="#22">22</a>  <strong>import</strong> org.apache.commons.logging.Log;
+<a name="23" href="#23">23</a>  <strong>import</strong> org.apache.commons.logging.LogFactory;
+<a name="24" href="#24">24</a>  <strong>import</strong> org.apache.james.postage.user.UserList;
+<a name="25" href="#25">25</a>  
+<a name="26" href="#26">26</a>  <strong>import</strong> java.util.Iterator;
+<a name="27" href="#27">27</a>  <strong>import</strong> java.util.LinkedHashMap;
+<a name="28" href="#28">28</a>  <strong>import</strong> java.util.List;
+<a name="29" href="#29">29</a>  <strong>import</strong> java.util.Map;
+<a name="30" href="#30">30</a>  
+<a name="31" href="#31">31</a>  <em>/**<em>*</em></em>
+<a name="32" href="#32">32</a>  <em> * generates named PostageConfigurations</em>
+<a name="33" href="#33">33</a>  <em> */</em>
+<a name="34" href="#34">34</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../../org/apache/james/postage/configuration/ConfigurationLoader.html">ConfigurationLoader</a> {
+<a name="35" href="#35">35</a>  
+<a name="36" href="#36">36</a>      <strong>private</strong> <strong>static</strong> Log log = LogFactory.getLog(ConfigurationLoader.<strong>class</strong>);
+<a name="37" href="#37">37</a>  
+<a name="38" href="#38">38</a>      <strong>public</strong> Map create(Configuration configuration) {
+<a name="39" href="#39">39</a>          log.debug(<span class="string">"reading configuration."</span>);
+<a name="40" href="#40">40</a>  
+<a name="41" href="#41">41</a>          Map postageConfigurations = <strong>new</strong> LinkedHashMap();
+<a name="42" href="#42">42</a>  
+<a name="43" href="#43">43</a>          List scenariosIds = configuration.getList(<span class="string">"scenario[@id]"</span>);
+<a name="44" href="#44">44</a>          log.debug(<span class="string">"scenarios contained in configuration: "</span> + scenariosIds.size());
+<a name="45" href="#45">45</a>  
+<a name="46" href="#46">46</a>          Iterator scenarioIter = scenariosIds.iterator();
+<a name="47" href="#47">47</a>          <strong>int</strong> scenarioCount = 0;
+<a name="48" href="#48">48</a>          <strong>while</strong> (scenarioIter.hasNext()) {
+<a name="49" href="#49">49</a>              String scenarioId = (String) scenarioIter.next();
+<a name="50" href="#50">50</a>  
+<a name="51" href="#51">51</a>              <strong>if</strong> (postageConfigurations.containsKey(scenarioId)) {
+<a name="52" href="#52">52</a>                  log.error(<span class="string">"found in configuration more than one scenario which is named: "</span> + scenarioId);
+<a name="53" href="#53">53</a>                  <strong>continue</strong>;
+<a name="54" href="#54">54</a>              }
+<a name="55" href="#55">55</a>  
+<a name="56" href="#56">56</a>              <a href="../../../../../org/apache/james/postage/configuration/PostageConfiguration.html">PostageConfiguration</a> postageConfiguration = <strong>new</strong> <a href="../../../../../org/apache/james/postage/configuration/PostageConfiguration.html">PostageConfiguration</a>(scenarioId);
+<a name="57" href="#57">57</a>  
+<a name="58" href="#58">58</a>              String scenario = getIndexedPropertyName(<span class="string">"scenario"</span>, scenarioCount);
+<a name="59" href="#59">59</a>  
+<a name="60" href="#60">60</a>              postageConfiguration.setDurationMinutes(configuration.getInt(getAttributedPropertyName(scenario, <span class="string">"runtimeMinutes"</span>)));
+<a name="61" href="#61">61</a>  
+<a name="62" href="#62">62</a>              addDescription(postageConfiguration, configuration.subset(scenario + <span class="string">".description"</span>));
+<a name="63" href="#63">63</a>  
+<a name="64" href="#64">64</a>              String scenarioInternalUsers = scenario + <span class="string">".users.internal"</span>;
+<a name="65" href="#65">65</a>              <a href="../../../../../org/apache/james/postage/user/UserList.html">UserList</a> internals = <strong>new</strong> <a href="../../../../../org/apache/james/postage/user/UserList.html">UserList</a>(configuration.getInt(getAttributedPropertyName(scenarioInternalUsers, <span class="string">"count"</span>)),
+<a name="66" href="#66">66</a>                                                configuration.getString(getAttributedPropertyName(scenarioInternalUsers, <span class="string">"username-prefix"</span>)),
+<a name="67" href="#67">67</a>                                                configuration.getString(getAttributedPropertyName(scenarioInternalUsers, <span class="string">"domain"</span>)),
+<a name="68" href="#68">68</a>                                                configuration.getString(getAttributedPropertyName(scenarioInternalUsers, <span class="string">"password"</span>)));
+<a name="69" href="#69">69</a>              postageConfiguration.setInternalUsers(internals);
+<a name="70" href="#70">70</a>              postageConfiguration.setInternalReuseExisting(configuration.getBoolean(getAttributedPropertyName(scenarioInternalUsers, <span class="string">"reuseExisting"</span>)));
+<a name="71" href="#71">71</a>  
+<a name="72" href="#72">72</a>              String scenarioExternalUsers = scenario + <span class="string">".users.external"</span>;
+<a name="73" href="#73">73</a>              <a href="../../../../../org/apache/james/postage/user/UserList.html">UserList</a> externals = <strong>new</strong> <a href="../../../../../org/apache/james/postage/user/UserList.html">UserList</a>(configuration.getInt(getAttributedPropertyName(scenarioExternalUsers, <span class="string">"count"</span>)),
+<a name="74" href="#74">74</a>                                                configuration.getString(getAttributedPropertyName(scenarioExternalUsers, <span class="string">"username-prefix"</span>)),
+<a name="75" href="#75">75</a>                                                configuration.getString(getAttributedPropertyName(scenarioExternalUsers, <span class="string">"domain"</span>)));
+<a name="76" href="#76">76</a>              postageConfiguration.setExternalUsers(externals);
+<a name="77" href="#77">77</a>  
+<a name="78" href="#78">78</a>              String scenarioTestserver = scenario + <span class="string">".testserver"</span>;
+<a name="79" href="#79">79</a>              postageConfiguration.setTestserverHost(configuration.getString(getAttributedPropertyName(scenarioTestserver, <span class="string">"host"</span>)));
+<a name="80" href="#80">80</a>              postageConfiguration.setTestserverPortPOP3(configuration.getInt(getAttributedPropertyName(scenarioTestserver + <span class="string">".pop3"</span>, <span class="string">"port"</span>)));
+<a name="81" href="#81">81</a>              postageConfiguration.setTestserverPOP3FetchesPerMinute(configuration.getInt(getAttributedPropertyName(scenarioTestserver + <span class="string">".pop3"</span>, <span class="string">"count-per-min"</span>)));
+<a name="82" href="#82">82</a>              postageConfiguration.setTestserverPortSMTPInbound(configuration.getInt(getAttributedPropertyName(scenarioTestserver + <span class="string">".smtp-inbound"</span>, <span class="string">"port"</span>)));
+<a name="83" href="#83">83</a>              postageConfiguration.setTestserverPortSMTPForwarding(configuration.getInt(getAttributedPropertyName(scenarioTestserver + <span class="string">".smtp-forwarding"</span>, <span class="string">"port"</span>)));
+<a name="84" href="#84">84</a>              postageConfiguration.setTestserverSMTPForwardingWaitSeconds(configuration.getInt(getAttributedPropertyName(scenarioTestserver + <span class="string">".smtp-forwarding"</span>, <span class="string">"latecomer-wait-seconds"</span>)));
+<a name="85" href="#85">85</a>              postageConfiguration.setTestserverRemoteManagerPort(configuration.getInt(getAttributedPropertyName(scenarioTestserver + <span class="string">".remotemanager"</span>, <span class="string">"port"</span>)));
+<a name="86" href="#86">86</a>              postageConfiguration.setTestserverRemoteManagerUsername(configuration.getString(getAttributedPropertyName(scenarioTestserver + <span class="string">".remotemanager"</span>, <span class="string">"name"</span>)));
+<a name="87" href="#87">87</a>              postageConfiguration.setTestserverRemoteManagerPassword(configuration.getString(getAttributedPropertyName(scenarioTestserver + <span class="string">".remotemanager"</span>, <span class="string">"password"</span>)));
+<a name="88" href="#88">88</a>              postageConfiguration.setTestserverSpamAccountUsername(configuration.getString(getAttributedPropertyName(scenarioTestserver + <span class="string">".spam-account"</span>, <span class="string">"name"</span>)));
+<a name="89" href="#89">89</a>              postageConfiguration.setTestserverSpamAccountPassword(configuration.getString(getAttributedPropertyName(scenarioTestserver + <span class="string">".spam-account"</span>, <span class="string">"password"</span>)));
+<a name="90" href="#90">90</a>              postageConfiguration.setTestserverPortJMXRemoting(configuration.getInt(getAttributedPropertyName(scenarioTestserver + <span class="string">".jvm-resources"</span>, <span class="string">"jmx-remoting-port"</span>)));
+<a name="91" href="#91">91</a>  
+<a name="92" href="#92">92</a>              addSendProfiles(postageConfiguration, configuration, scenario);
+<a name="93" href="#93">93</a>  
+<a name="94" href="#94">94</a>              postageConfigurations.put(postageConfiguration.getId(), postageConfiguration);
+<a name="95" href="#95">95</a>  
+<a name="96" href="#96">96</a>              scenarioCount++;
+<a name="97" href="#97">97</a>          }
+<a name="98" href="#98">98</a>  
+<a name="99" href="#99">99</a>          <strong>return</strong> postageConfigurations;
+<a name="100" href="#100">100</a>     }
+<a name="101" href="#101">101</a> 
+<a name="102" href="#102">102</a>     <strong>private</strong> <strong>void</strong> addDescription(<a href="../../../../../org/apache/james/postage/configuration/PostageConfiguration.html">PostageConfiguration</a> postageConfiguration, Configuration configuration) {
+<a name="103" href="#103">103</a>         Iterator keys = configuration.getKeys();
+<a name="104" href="#104">104</a> 
+<a name="105" href="#105">105</a> 
+<a name="106" href="#106">106</a>         <strong>while</strong> (keys.hasNext()) {
+<a name="107" href="#107">107</a>             String itemName = (String) keys.next();
+<a name="108" href="#108">108</a>             String itemContent = configuration.getString(itemName);
+<a name="109" href="#109">109</a> 
+<a name="110" href="#110">110</a>             postageConfiguration.addDescriptionItem(itemName, itemContent);
+<a name="111" href="#111">111</a>         }
+<a name="112" href="#112">112</a>     }
+<a name="113" href="#113">113</a> 
+<a name="114" href="#114">114</a>     <strong>private</strong> <strong>void</strong> addSendProfiles(<a href="../../../../../org/apache/james/postage/configuration/PostageConfiguration.html">PostageConfiguration</a> postageConfiguration, Configuration configuration, String scenario) {
+<a name="115" href="#115">115</a>         List profileNames = configuration.getList(scenario + <span class="string">".profiles.profile[@name]"</span>);
+<a name="116" href="#116">116</a>         log.debug(<span class="string">"profiles contained in scenario "</span> + postageConfiguration.getId() + <span class="string">": "</span> + profileNames.size());
+<a name="117" href="#117">117</a> 
+<a name="118" href="#118">118</a>         Iterator profileIter = profileNames.iterator();
+<a name="119" href="#119">119</a>         <strong>int</strong> profileCount = 0;
+<a name="120" href="#120">120</a>         <strong>while</strong> (profileIter.hasNext()) {
+<a name="121" href="#121">121</a>             String profileName = (String) profileIter.next();
+<a name="122" href="#122">122</a> 
+<a name="123" href="#123">123</a>             <a href="../../../../../org/apache/james/postage/configuration/SendProfile.html">SendProfile</a> profile = <strong>new</strong> <a href="../../../../../org/apache/james/postage/configuration/SendProfile.html">SendProfile</a>(profileName);
+<a name="124" href="#124">124</a> 
+<a name="125" href="#125">125</a>             String profilePath = getIndexedPropertyName(scenario + <span class="string">".profiles.profile"</span>, profileCount);
+<a name="126" href="#126">126</a> 
+<a name="127" href="#127">127</a>             profile.setSourceInternal(convertToInternalExternalFlag(configuration.getString(getAttributedPropertyName(profilePath, <span class="string">"source"</span>))));
+<a name="128" href="#128">128</a>             profile.setTargetInternal(convertToInternalExternalFlag(configuration.getString(getAttributedPropertyName(profilePath, <span class="string">"target"</span>))));
+<a name="129" href="#129">129</a> 
+<a name="130" href="#130">130</a>             addMailSender(profile, configuration, profilePath);
+<a name="131" href="#131">131</a> 
+<a name="132" href="#132">132</a>             postageConfiguration.addProfile(profile);
+<a name="133" href="#133">133</a> 
+<a name="134" href="#134">134</a>             profileCount++;
+<a name="135" href="#135">135</a>         }
+<a name="136" href="#136">136</a>     }
+<a name="137" href="#137">137</a> 
+<a name="138" href="#138">138</a>     <strong>private</strong> <strong>void</strong> addMailSender(<a href="../../../../../org/apache/james/postage/configuration/SendProfile.html">SendProfile</a> profile, Configuration configuration, String profilePath) {
+<a name="139" href="#139">139</a>         List mailSenders = configuration.getList(profilePath + <span class="string">".send[@count-per-min]"</span>);
+<a name="140" href="#140">140</a> 
+<a name="141" href="#141">141</a>         Iterator mailSenderIter = mailSenders.iterator();
+<a name="142" href="#142">142</a>         <strong>int</strong> mailSenderCount = 0;
+<a name="143" href="#143">143</a>         <strong>while</strong> (mailSenderIter.hasNext()) {
+<a name="144" href="#144">144</a>             mailSenderIter.next(); <em class="comment">// ignore</em>
+<a name="145" href="#145">145</a> 
+<a name="146" href="#146">146</a>             String mailSenderPath = getIndexedPropertyName(profilePath + <span class="string">".send"</span>, mailSenderCount);
+<a name="147" href="#147">147</a> 
+<a name="148" href="#148">148</a>             <a href="../../../../../org/apache/james/postage/configuration/MailSender.html">MailSender</a> mailSender = <strong>new</strong> <a href="../../../../../org/apache/james/postage/configuration/MailSender.html">MailSender</a>(profile);
+<a name="149" href="#149">149</a>             mailSender.setSubject(configuration.getString(getAttributedPropertyName(mailSenderPath, <span class="string">"subject"</span>), <span class="string">"Apache JAMES Postage test mail"</span>));
+<a name="150" href="#150">150</a>             mailSender.setSendPerMinute(configuration.getInt(getAttributedPropertyName(mailSenderPath, <span class="string">"count-per-min"</span>)));
+<a name="151" href="#151">151</a>             mailSender.setSizeMinText(configuration.getInt(getAttributedPropertyName(mailSenderPath, <span class="string">"text-size-min"</span>), 0));
+<a name="152" href="#152">152</a>             mailSender.setSizeMaxText(configuration.getInt(getAttributedPropertyName(mailSenderPath, <span class="string">"text-size-max"</span>), 0));
+<a name="153" href="#153">153</a>             mailSender.setSizeMinBinary(configuration.getInt(getAttributedPropertyName(mailSenderPath, <span class="string">"binary-size-min"</span>), 0));
+<a name="154" href="#154">154</a>             mailSender.setSizeMaxBinary(configuration.getInt(getAttributedPropertyName(mailSenderPath, <span class="string">"binary-size-max"</span>), 0));
+<a name="155" href="#155">155</a>             mailSender.setMailFactoryClassname(configuration.getString(getAttributedPropertyName(mailSenderPath, <span class="string">"mail-factory-class"</span>), <strong>null</strong>));
+<a name="156" href="#156">156</a> 
+<a name="157" href="#157">157</a>             profile.addMailSender(mailSender);
+<a name="158" href="#158">158</a> 
+<a name="159" href="#159">159</a>             mailSenderCount++;
+<a name="160" href="#160">160</a>         }
+<a name="161" href="#161">161</a>     }
+<a name="162" href="#162">162</a> 
+<a name="163" href="#163">163</a>     <strong>private</strong> <strong>boolean</strong> convertToInternalExternalFlag(String flagCleartext) {
+<a name="164" href="#164">164</a>         <strong>return</strong> flagCleartext == <strong>null</strong> || !<span class="string">"extern"</span>.equals(flagCleartext.toLowerCase().trim());
+<a name="165" href="#165">165</a>     }
+<a name="166" href="#166">166</a> 
+<a name="167" href="#167">167</a>     <strong>private</strong> String getIndexedPropertyName(String name, <strong>int</strong> scenarioCount) {
+<a name="168" href="#168">168</a>         <strong>return</strong> name + <span class="string">"("</span> + scenarioCount + <span class="string">")"</span>;
+<a name="169" href="#169">169</a>     }
+<a name="170" href="#170">170</a> 
+<a name="171" href="#171">171</a>     <strong>private</strong> String getAttributedPropertyName(String name, String attr) {
+<a name="172" href="#172">172</a>         <strong>return</strong> name + <span class="string">"[@"</span> + attr + <span class="string">"]"</span>;
+<a name="173" href="#173">173</a>     }
+<a name="174" href="#174">174</a> 
+<a name="175" href="#175">175</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/ConfigurationLoader.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/MailSender.html
URL: http://svn.apache.org/viewvc/james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/MailSender.html?rev=429369&view=auto
==============================================================================
--- james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/MailSender.html (added)
+++ james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/MailSender.html Mon Aug  7 08:40:01 2006
@@ -0,0 +1,194 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>MailSender xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../../../../../../apidocs/org/apache/james/postage/configuration/MailSender.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em>/**<em>**********************************************************************</em></em>
+<a name="2" href="#2">2</a>   <em> * Copyright (c) 2006 The Apache Software Foundation.                  *</em>
+<a name="3" href="#3">3</a>   <em> * All rights reserved.                                                *</em>
+<a name="4" href="#4">4</a>   <em> * ------------------------------------------------------------------- *</em>
+<a name="5" href="#5">5</a>   <em> * Licensed under the Apache License, Version 2.0 (the "License"); you *</em>
+<a name="6" href="#6">6</a>   <em> * may not use this file except in compliance with the License. You    *</em>
+<a name="7" href="#7">7</a>   <em> * may obtain a copy of the License at:                                *</em>
+<a name="8" href="#8">8</a>   <em> *                                                                     *</em>
+<a name="9" href="#9">9</a>   <em> *     <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a>                      *</em>
+<a name="10" href="#10">10</a>  <em> *                                                                     *</em>
+<a name="11" href="#11">11</a>  <em> * Unless required by applicable law or agreed to in writing, software *</em>
+<a name="12" href="#12">12</a>  <em> * distributed under the License is distributed on an "AS IS" BASIS,   *</em>
+<a name="13" href="#13">13</a>  <em> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *</em>
+<a name="14" href="#14">14</a>  <em> * implied.  See the License for the specific language governing       *</em>
+<a name="15" href="#15">15</a>  <em> * permissions and limitations under the License.                      *</em>
+<a name="16" href="#16">16</a>  <em> ***********************************************************************/</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  
+<a name="19" href="#19">19</a>  <strong>package</strong> org.apache.james.postage.configuration;
+<a name="20" href="#20">20</a>  
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.james.postage.mail.MailFactory;
+<a name="22" href="#22">22</a>  <strong>import</strong> org.apache.james.postage.mail.DefaultMailFactory;
+<a name="23" href="#23">23</a>  <strong>import</strong> org.apache.james.postage.result.MailProcessingRecord;
+<a name="24" href="#24">24</a>  <strong>import</strong> org.apache.commons.logging.Log;
+<a name="25" href="#25">25</a>  <strong>import</strong> org.apache.commons.logging.LogFactory;
+<a name="26" href="#26">26</a>  
+<a name="27" href="#27">27</a>  <strong>import</strong> javax.mail.Session;
+<a name="28" href="#28">28</a>  <strong>import</strong> javax.mail.Message;
+<a name="29" href="#29">29</a>  
+<a name="30" href="#30">30</a>  <em class="comment">// TODO init increaseSendPerMinute &amp; maxSendPerMinute from config</em>
+<a name="31" href="#31">31</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../../org/apache/james/postage/configuration/MailSender.html">MailSender</a> {
+<a name="32" href="#32">32</a>  
+<a name="33" href="#33">33</a>      <strong>private</strong> <strong>static</strong> Log log = LogFactory.getLog(MailSender.<strong>class</strong>);
+<a name="34" href="#34">34</a>  
+<a name="35" href="#35">35</a>      <strong>private</strong> <strong>int</strong> sendPerMinute = 1;
+<a name="36" href="#36">36</a>      <strong>private</strong> <strong>double</strong> increaseSendPerMinute = 0.0;
+<a name="37" href="#37">37</a>      <strong>private</strong> <strong>int</strong> maxSendPerMinute = -1;
+<a name="38" href="#38">38</a>      <strong>private</strong> String subject = <span class="string">"test"</span>;
+<a name="39" href="#39">39</a>      <strong>private</strong> <strong>int</strong> sizeMinText = 0;
+<a name="40" href="#40">40</a>      <strong>private</strong> <strong>int</strong> sizeMaxText = 1000;
+<a name="41" href="#41">41</a>      <strong>private</strong> <strong>int</strong> sizeMinBinary = -1;
+<a name="42" href="#42">42</a>      <strong>private</strong> <strong>int</strong> sizeMaxBinary = -1;
+<a name="43" href="#43">43</a>      <strong>private</strong> <a href="../../../../../org/apache/james/postage/configuration/SendProfile.html">SendProfile</a> m_parentProfile;
+<a name="44" href="#44">44</a>  
+<a name="45" href="#45">45</a>      <strong>private</strong> String m_mailFactoryClassname = <strong>null</strong>;
+<a name="46" href="#46">46</a>      <strong>private</strong> Class m_mailFactoryClass = <strong>null</strong>;
+<a name="47" href="#47">47</a>  
+<a name="48" href="#48">48</a>      <strong>public</strong> <a href="../../../../../org/apache/james/postage/configuration/MailSender.html">MailSender</a>(<a href="../../../../../org/apache/james/postage/configuration/SendProfile.html">SendProfile</a> parent) {
+<a name="49" href="#49">49</a>          m_parentProfile = parent;
+<a name="50" href="#50">50</a>      }
+<a name="51" href="#51">51</a>  
+<a name="52" href="#52">52</a>      <strong>public</strong> <strong>int</strong> getSendPerMinute() {
+<a name="53" href="#53">53</a>          <strong>return</strong> sendPerMinute;
+<a name="54" href="#54">54</a>      }
+<a name="55" href="#55">55</a>  
+<a name="56" href="#56">56</a>      <strong>public</strong> <strong>void</strong> setSendPerMinute(<strong>int</strong> sendPerMinute) {
+<a name="57" href="#57">57</a>          <strong>this</strong>.sendPerMinute = sendPerMinute;
+<a name="58" href="#58">58</a>      }
+<a name="59" href="#59">59</a>  
+<a name="60" href="#60">60</a>      <strong>public</strong> <strong>double</strong> getIncreaseSendPerMinute() {
+<a name="61" href="#61">61</a>          <strong>return</strong> increaseSendPerMinute;
+<a name="62" href="#62">62</a>      }
+<a name="63" href="#63">63</a>  
+<a name="64" href="#64">64</a>      <strong>public</strong> <strong>void</strong> setIncreaseSendPerMinute(<strong>double</strong> increaseSendPerMinute) {
+<a name="65" href="#65">65</a>          <strong>this</strong>.increaseSendPerMinute = increaseSendPerMinute;
+<a name="66" href="#66">66</a>      }
+<a name="67" href="#67">67</a>  
+<a name="68" href="#68">68</a>      <strong>public</strong> <strong>double</strong> getMaxSendPerMinute() {
+<a name="69" href="#69">69</a>          <strong>return</strong> maxSendPerMinute;
+<a name="70" href="#70">70</a>      }
+<a name="71" href="#71">71</a>  
+<a name="72" href="#72">72</a>      <strong>public</strong> <strong>void</strong> setMaxSendPerMinute(<strong>int</strong> maxSendPerMinute) {
+<a name="73" href="#73">73</a>          <strong>this</strong>.maxSendPerMinute = maxSendPerMinute;
+<a name="74" href="#74">74</a>      }
+<a name="75" href="#75">75</a>  
+<a name="76" href="#76">76</a>      <em>/**<em>*</em></em>
+<a name="77" href="#77">77</a>  <em>     * how much emails are to be sent in the specified minute</em>
+<a name="78" href="#78">78</a>  <em>     * (taking into account the increase and max values)</em>
+<a name="79" href="#79">79</a>  <em>     * @param minute</em>
+<a name="80" href="#80">80</a>  <em>     * @return mails to be sent</em>
+<a name="81" href="#81">81</a>  <em>     */</em>
+<a name="82" href="#82">82</a>      <strong>public</strong> <strong>int</strong> getSendPerMinute(<strong>int</strong> minute) {
+<a name="83" href="#83">83</a>          <strong>int</strong> increased = sendPerMinute + (<strong>int</strong>)(increaseSendPerMinute * minute);
+<a name="84" href="#84">84</a>          <strong>if</strong> (maxSendPerMinute > 0) {
+<a name="85" href="#85">85</a>              <strong>if</strong> (increased > maxSendPerMinute) increased = maxSendPerMinute;
+<a name="86" href="#86">86</a>          }
+<a name="87" href="#87">87</a>          <strong>return</strong> increased;
+<a name="88" href="#88">88</a>      }
+<a name="89" href="#89">89</a>  
+<a name="90" href="#90">90</a>      <strong>public</strong> String getSubject() {
+<a name="91" href="#91">91</a>          <strong>return</strong> subject;
+<a name="92" href="#92">92</a>      }
+<a name="93" href="#93">93</a>  
+<a name="94" href="#94">94</a>      <strong>public</strong> <strong>void</strong> setSubject(String subject) {
+<a name="95" href="#95">95</a>          <strong>this</strong>.subject = subject;
+<a name="96" href="#96">96</a>      }
+<a name="97" href="#97">97</a>  
+<a name="98" href="#98">98</a>      <strong>public</strong> <strong>int</strong> getSizeMinText() {
+<a name="99" href="#99">99</a>          <strong>return</strong> sizeMinText;
+<a name="100" href="#100">100</a>     }
+<a name="101" href="#101">101</a> 
+<a name="102" href="#102">102</a>     <strong>public</strong> <strong>void</strong> setSizeMinText(<strong>int</strong> sizeMinText) {
+<a name="103" href="#103">103</a>         <strong>this</strong>.sizeMinText = sizeMinText;
+<a name="104" href="#104">104</a>     }
+<a name="105" href="#105">105</a> 
+<a name="106" href="#106">106</a>     <strong>public</strong> <strong>int</strong> getSizeMaxText() {
+<a name="107" href="#107">107</a>         <strong>return</strong> sizeMaxText;
+<a name="108" href="#108">108</a>     }
+<a name="109" href="#109">109</a> 
+<a name="110" href="#110">110</a>     <strong>public</strong> <strong>void</strong> setSizeMaxText(<strong>int</strong> sizeMaxText) {
+<a name="111" href="#111">111</a>         <strong>this</strong>.sizeMaxText = sizeMaxText;
+<a name="112" href="#112">112</a>     }
+<a name="113" href="#113">113</a> 
+<a name="114" href="#114">114</a>     <strong>public</strong> <strong>int</strong> getSizeMinBinary() {
+<a name="115" href="#115">115</a>         <strong>return</strong> sizeMinBinary;
+<a name="116" href="#116">116</a>     }
+<a name="117" href="#117">117</a> 
+<a name="118" href="#118">118</a>     <strong>public</strong> <strong>void</strong> setSizeMinBinary(<strong>int</strong> sizeMinBinary) {
+<a name="119" href="#119">119</a>         <strong>this</strong>.sizeMinBinary = sizeMinBinary;
+<a name="120" href="#120">120</a>     }
+<a name="121" href="#121">121</a> 
+<a name="122" href="#122">122</a>     <strong>public</strong> <strong>int</strong> getSizeMaxBinary() {
+<a name="123" href="#123">123</a>         <strong>return</strong> sizeMaxBinary;
+<a name="124" href="#124">124</a>     }
+<a name="125" href="#125">125</a> 
+<a name="126" href="#126">126</a>     <strong>public</strong> <strong>void</strong> setSizeMaxBinary(<strong>int</strong> sizeMaxBinary) {
+<a name="127" href="#127">127</a>         <strong>this</strong>.sizeMaxBinary = sizeMaxBinary;
+<a name="128" href="#128">128</a>     }
+<a name="129" href="#129">129</a> 
+<a name="130" href="#130">130</a>     <strong>public</strong> <a href="../../../../../org/apache/james/postage/configuration/SendProfile.html">SendProfile</a> getParentProfile() {
+<a name="131" href="#131">131</a>         <strong>return</strong> m_parentProfile;
+<a name="132" href="#132">132</a>     }
+<a name="133" href="#133">133</a> 
+<a name="134" href="#134">134</a>     <strong>public</strong> String getMailFactoryClassname() {
+<a name="135" href="#135">135</a>         <strong>return</strong> m_mailFactoryClassname;
+<a name="136" href="#136">136</a>     }
+<a name="137" href="#137">137</a> 
+<a name="138" href="#138">138</a>     <strong>public</strong> <strong>void</strong> setMailFactoryClassname(String mailFactoryClassname) {
+<a name="139" href="#139">139</a>         <strong>this</strong>.m_mailFactoryClassname = mailFactoryClassname;
+<a name="140" href="#140">140</a>     }
+<a name="141" href="#141">141</a> 
+<a name="142" href="#142">142</a>     <strong>public</strong> <strong>boolean</strong> sendTextPart() {
+<a name="143" href="#143">143</a>         <strong>return</strong> getSizeMinText() >= 0 &amp;&amp; getSizeMaxText() >= 1;
+<a name="144" href="#144">144</a>     }
+<a name="145" href="#145">145</a> 
+<a name="146" href="#146">146</a>     <strong>public</strong> <strong>boolean</strong> sendBinaryPart() {
+<a name="147" href="#147">147</a>         <strong>return</strong> getSizeMinBinary() >= 0 &amp;&amp; getSizeMaxBinary() >= 1;
+<a name="148" href="#148">148</a>     }
+<a name="149" href="#149">149</a> 
+<a name="150" href="#150">150</a>     <strong>public</strong> Message createMail(Session mailSession, <a href="../../../../../org/apache/james/postage/result/MailProcessingRecord.html">MailProcessingRecord</a> mailProcessingRecord) {
+<a name="151" href="#151">151</a>         <strong>return</strong> getMailFactory().createMail(mailSession, <strong>this</strong>, mailProcessingRecord);
+<a name="152" href="#152">152</a>         <em class="comment">// TODO assert, that created mail conforms to some rules, e.g. has Postage X-headers set</em>
+<a name="153" href="#153">153</a>     }
+<a name="154" href="#154">154</a> 
+<a name="155" href="#155">155</a>     <strong>public</strong> <a href="../../../../../org/apache/james/postage/mail/MailFactory.html">MailFactory</a> getMailFactory() {
+<a name="156" href="#156">156</a>         <a href="../../../../../org/apache/james/postage/mail/MailFactory.html">MailFactory</a> mailFactory = <strong>null</strong>;
+<a name="157" href="#157">157</a> 
+<a name="158" href="#158">158</a>         <em class="comment">// class is configured, but not yet loaded</em>
+<a name="159" href="#159">159</a>         <strong>if</strong> (m_mailFactoryClassname != <strong>null</strong> &amp;&amp; m_mailFactoryClass == <strong>null</strong>) {
+<a name="160" href="#160">160</a>             <strong>try</strong> {
+<a name="161" href="#161">161</a>                 m_mailFactoryClass = Class.forName(m_mailFactoryClassname);
+<a name="162" href="#162">162</a>             } <strong>catch</strong> (ClassNotFoundException e) {
+<a name="163" href="#163">163</a>                 log.error(<span class="string">"failed to load MailFactory class "</span> + m_mailFactoryClassname, e);
+<a name="164" href="#164">164</a>             }
+<a name="165" href="#165">165</a>         }
+<a name="166" href="#166">166</a> 
+<a name="167" href="#167">167</a>         <em class="comment">// create instance, if custom class is given</em>
+<a name="168" href="#168">168</a>         <strong>if</strong> (m_mailFactoryClass != <strong>null</strong>) {
+<a name="169" href="#169">169</a>             <strong>try</strong> {
+<a name="170" href="#170">170</a>                 mailFactory = (MailFactory)m_mailFactoryClass.newInstance();
+<a name="171" href="#171">171</a>             } <strong>catch</strong> (Exception e) {
+<a name="172" href="#172">172</a>                 log.error(<span class="string">"failed to create instance if MailFactory class "</span> + m_mailFactoryClassname, e);
+<a name="173" href="#173">173</a>             }
+<a name="174" href="#174">174</a>         }
+<a name="175" href="#175">175</a> 
+<a name="176" href="#176">176</a>         <strong>if</strong> (mailFactory == <strong>null</strong>) mailFactory = <strong>new</strong> DefaultMailFactory();
+<a name="177" href="#177">177</a>         <strong>return</strong> mailFactory;
+<a name="178" href="#178">178</a>     }
+<a name="179" href="#179">179</a> 
+<a name="180" href="#180">180</a> 
+<a name="181" href="#181">181</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: james/site/trunk/www/postage/xref/org/apache/james/postage/configuration/MailSender.html
------------------------------------------------------------------------------
    svn:eol-style = native