Permalink
Browse files

updating from buglabs/bugswarm-connector

  • Loading branch information...
1 parent b8caf55 commit aa4fd809bdda60e3574099008b79a0768b51eb85 @theterg theterg committed Jun 18, 2012
View
204 com.buglabs.bug.swarm.client/bin/Example.html
@@ -1,204 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="content-type" content="text/html;charset=utf-8">
- <title>Example.java</title>
- <link rel="stylesheet" href="pycco.css">
-</head>
-<body>
-<div id="background"></div>
-<div id='container'>
-
- <div class='section'>
- <div class='docs'><h1>Example.java</h1></div>
- </div>
- <div class='clearall'>
- <div class='section' id='section-0'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-0'>#</a>
- </div>
-
- </div>
- <div class='code'>
- <div class="highlight"><pre><span class="n">import</span> <span class="n">java</span><span class="p">.</span><span class="n">io</span><span class="p">.</span><span class="n">IOException</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">java</span><span class="p">.</span><span class="n">util</span><span class="p">.</span><span class="n">Random</span><span class="p">;</span>
-
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">ISwarmClient</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">ISwarmInviteClient</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">ISwarmInviteClient</span><span class="p">.</span><span class="n">InvitationResponse</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">ISwarmResourcesClient</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">ISwarmResourcesClient</span><span class="p">.</span><span class="n">MemberType</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">IUserResourceClient</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">SwarmClientFactory</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">model</span><span class="p">.</span><span class="n">Invitation</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">model</span><span class="p">.</span><span class="n">SwarmModel</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">model</span><span class="p">.</span><span class="n">SwarmResourceModel</span><span class="p">;</span>
-<span class="n">import</span> <span class="n">com</span><span class="p">.</span><span class="n">buglabs</span><span class="p">.</span><span class="n">bug</span><span class="p">.</span><span class="n">swarm</span><span class="p">.</span><span class="n">restclient</span><span class="p">.</span><span class="n">model</span><span class="p">.</span><span class="n">UserResourceModel</span><span class="p">;</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-1'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-1'>#</a>
- </div>
- <h2>This file illustrates how to use the swarm.restclient library for the configuration side of BUGswarm</h2>
- </div>
- <div class='code'>
- <div class="highlight"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">Example</span> <span class="p">{</span>
-
- <span class="n">public</span> <span class="k">static</span> <span class="kt">void</span> <span class="n">main</span><span class="p">(</span><span class="n">String</span><span class="p">[]</span> <span class="n">args</span><span class="p">)</span> <span class="n">throws</span> <span class="n">IOException</span> <span class="p">{</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-2'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-2'>#</a>
- </div>
- <h2>Get an instance of the root client using the factory:</h2>
-<p>A default error handler is set that will throw IOException on any non-application HTTP error.</p>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">ISwarmClient</span> <span class="n">client</span> <span class="o">=</span> <span class="n">SwarmClientFactory</span><span class="p">.</span><span class="n">getSwarmClient</span><span class="p">(</span><span class="s">&quot;api.test.bugswarm.net&quot;</span><span class="p">,</span> <span class="s">&quot;3077514aa9aa5a5826cfd9d04ee059db1a18057d&quot;</span><span class="p">);</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-3'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-3'>#</a>
- </div>
- <h2>Create a new swarm:</h2>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">String</span> <span class="n">id</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="n">create</span><span class="p">(</span><span class="s">&quot;my sweet swarm&quot;</span><span class="p">,</span> <span class="nb">true</span><span class="p">,</span> <span class="s">&quot;my swarm description&quot;</span><span class="p">);</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-4'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-4'>#</a>
- </div>
- <h2>Get the details of my new swarm:</h2>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">SwarmModel</span> <span class="n">swarm</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="n">id</span><span class="p">);</span>
- <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">swarm</span><span class="p">.</span><span class="n">getCreatedAt</span><span class="p">());</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-5'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-5'>#</a>
- </div>
- <h2>Get a list of my member swarms:</h2>
-<p>By convention, the client will never return null to list operations but rather empty lists. So, checking for null is not required.</p>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;I belong to...&quot;</span><span class="p">);</span>
- <span class="k">for</span> <span class="p">(</span><span class="n">SwarmModel</span> <span class="n">sm</span> <span class="o">:</span> <span class="n">client</span><span class="p">.</span><span class="n">list</span><span class="p">())</span>
- <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">sm</span><span class="p">.</span><span class="n">getId</span><span class="p">());</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-6'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-6'>#</a>
- </div>
- <h2>Create a new resource:</h2>
-<p>Note that the clients are partitioned along the logical separations of the API specification.</p>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">IUserResourceClient</span> <span class="n">resourceClient</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="n">getUserResourceClient</span><span class="p">();</span>
- <span class="n">UserResourceModel</span> <span class="n">resource</span> <span class="o">=</span> <span class="n">resourceClient</span><span class="p">.</span><span class="n">add</span><span class="p">(</span><span class="s">&quot;my-resource&quot;</span><span class="p">,</span> <span class="s">&quot;a sweet swarm resource.&quot;</span><span class="p">,</span> <span class="s">&quot;pc&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
-
- <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;My new resource id is &quot;</span> <span class="o">+</span> <span class="n">resource</span><span class="p">.</span><span class="n">getResourceId</span><span class="p">());</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-7'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-7'>#</a>
- </div>
- <h2>List all of my resources</h2>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;I have these resources...&quot;</span><span class="p">);</span>
- <span class="k">for</span> <span class="p">(</span><span class="n">UserResourceModel</span> <span class="n">urm</span> <span class="o">:</span> <span class="n">resourceClient</span><span class="p">.</span><span class="n">list</span><span class="p">())</span>
- <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">urm</span><span class="p">.</span><span class="n">getName</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot; - &quot;</span> <span class="o">+</span> <span class="n">urm</span><span class="p">.</span><span class="n">getDescription</span><span class="p">());</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-8'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-8'>#</a>
- </div>
- <h2>Invite someone to my swarm:</h2>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">ISwarmInviteClient</span> <span class="n">inviteClient</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="n">getSwarmInviteClient</span><span class="p">();</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-9'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-9'>#</a>
- </div>
- <p>Note this will fail if run since the supplied user and resource are not valid.</p>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">Invitation</span> <span class="n">invite</span> <span class="o">=</span> <span class="n">inviteClient</span><span class="p">.</span><span class="n">send</span><span class="p">(</span><span class="n">swarm</span><span class="p">.</span><span class="n">getId</span><span class="p">(),</span> <span class="s">&quot;some-user&quot;</span><span class="p">,</span> <span class="s">&quot;some-resource&quot;</span><span class="p">,</span> <span class="n">MemberType</span><span class="p">.</span><span class="n">CONSUMER</span><span class="p">,</span> <span class="s">&quot;hey man join my sweet swarm.&quot;</span><span class="p">);</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-10'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-10'>#</a>
- </div>
- <h2>List my invitations:</h2>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;I have invited these users...&quot;</span><span class="p">);</span>
- <span class="k">for</span> <span class="p">(</span><span class="n">Invitation</span> <span class="n">i</span> <span class="o">:</span> <span class="n">inviteClient</span><span class="p">.</span><span class="n">getSentInvitations</span><span class="p">(</span><span class="n">swarm</span><span class="p">.</span><span class="n">getId</span><span class="p">()))</span>
- <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">i</span><span class="p">.</span><span class="n">getToUser</span><span class="p">());</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-11'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-11'>#</a>
- </div>
- <h2>Check to see if anyone wants me in their swarms:</h2>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;I will randomly accept and reject my invites...&quot;</span><span class="p">);</span>
- <span class="n">Random</span> <span class="n">r</span> <span class="o">=</span> <span class="n">new</span> <span class="n">Random</span><span class="p">();</span>
-
- <span class="k">for</span> <span class="p">(</span><span class="n">Invitation</span> <span class="n">i</span> <span class="o">:</span> <span class="n">inviteClient</span><span class="p">.</span><span class="n">getRecievedInvitations</span><span class="p">())</span>
- <span class="k">if</span> <span class="p">(</span><span class="n">r</span><span class="p">.</span><span class="n">nextBoolean</span><span class="p">())</span>
- <span class="n">inviteClient</span><span class="p">.</span><span class="n">respond</span><span class="p">(</span><span class="n">i</span><span class="p">.</span><span class="n">getResourceId</span><span class="p">(),</span> <span class="n">i</span><span class="p">.</span><span class="n">getId</span><span class="p">(),</span> <span class="n">InvitationResponse</span><span class="p">.</span><span class="n">ACCEPT</span><span class="p">);</span>
- <span class="k">else</span>
- <span class="n">inviteClient</span><span class="p">.</span><span class="n">respond</span><span class="p">(</span><span class="n">i</span><span class="p">.</span><span class="n">getResourceId</span><span class="p">(),</span> <span class="n">i</span><span class="p">.</span><span class="n">getId</span><span class="p">(),</span> <span class="n">InvitationResponse</span><span class="p">.</span><span class="n">REJECT</span><span class="p">);</span></pre></div>
- </div>
- </div>
- <div class='clearall'></div><div class='section' id='section-12'>
- <div class='docs'>
- <div class='octowrap'>
- <a class='octothorpe' href='#section-12'>#</a>
- </div>
- <h2>Show what resources are in my swarm:</h2>
- </div>
- <div class='code'>
- <div class="highlight"><pre> <span class="n">ISwarmResourcesClient</span> <span class="n">swarmResourceClient</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="n">getSwarmResourceClient</span><span class="p">();</span>
-
- <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Here is who is in my swarms...&quot;</span><span class="p">);</span>
- <span class="k">for</span> <span class="p">(</span><span class="n">SwarmResourceModel</span> <span class="n">srm</span> <span class="o">:</span> <span class="n">swarmResourceClient</span><span class="p">.</span><span class="n">list</span><span class="p">(</span><span class="n">swarm</span><span class="p">.</span><span class="n">getId</span><span class="p">(),</span> <span class="n">MemberType</span><span class="p">.</span><span class="n">CONSUMER</span><span class="p">))</span>
- <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">srm</span><span class="p">.</span><span class="n">getUserId</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot; - &quot;</span> <span class="o">+</span> <span class="n">srm</span><span class="p">.</span><span class="n">getResourceId</span><span class="p">());</span>
- <span class="p">}</span>
-<span class="p">}</span>
-
-</pre></div>
- </div>
- </div>
- <div class='clearall'></div>
-</div>
-</body>
View
1 com.buglabs.bug.swarm.client/bin/README
@@ -1 +0,0 @@
-The tests for restclient are now in bugswarm-connector project.
View
344 com.buglabs.bug.swarm.client/checkstyle/checkstyle-com.buglabs.bug.swarm.client.xml
@@ -1,344 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<checkstyle version="5.3">
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmBinaryUploadClient.java">
-<error line="26" column="106" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmClient.java">
-<error line="22" column="9" severity="warning" message="Redundant &apos;public&apos; modifier." source="com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmConfiguration.java">
-<error line="33" column="106" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="92" severity="warning" message="First sentence should end with a period." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
-<error line="132" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="161" column="12" severity="warning" message="Unused @param tag for &apos;userId&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="180" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="193" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="206" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmInviteClient.java">
-<error line="9" severity="warning" message="First sentence should end with a period." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
-<error line="128" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmJsonMessageListener.java">
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmKeysClient.java">
-<error line="51" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmMessageListener.java">
-<error line="34" severity="warning" message="First sentence should end with a period." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
-<error line="55" column="46" severity="warning" message="Expected @param tag for &apos;type&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="55" column="59" severity="warning" message="Expected @param tag for &apos;message&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmResourcesClient.java">
-<error line="57" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="64" column="12" severity="warning" message="Unused @param tag for &apos;userId&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="66" column="12" severity="warning" message="Unused @param tag for &apos;resource&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="70" column="91" severity="warning" message="Expected @param tag for &apos;resourceId&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="86" column="12" severity="warning" message="Unused @param tag for &apos;resource&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="90" column="51" severity="warning" message="Expected @param tag for &apos;resourceiD&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmSession.java">
-<error line="23" column="34" severity="warning" message="Expected @param tag for &apos;payload&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="23" column="50" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="31" column="34" severity="warning" message="Expected @param tag for &apos;payload&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="31" column="54" severity="warning" message="Expected @param tag for &apos;swarmIds&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="31" column="71" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="39" column="34" severity="warning" message="Expected @param tag for &apos;payload&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="39" column="75" severity="warning" message="Expected @param tag for &apos;swarmAndResource&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="39" column="100" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="47" column="26" severity="warning" message="Expected @param tag for &apos;swarmId&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="47" column="42" severity="warning" message="Expected @param tag for &apos;resourceId&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="47" column="61" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="54" column="48" severity="warning" message="Expected @param tag for &apos;listener&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="60" column="51" severity="warning" message="Expected @param tag for &apos;listener&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="67" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmStringMessageListener.java">
-<error line="9" column="75" severity="warning" message="&apos;{&apos; is not preceded with whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/IUserResourceClient.java">
-<error line="31" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="44" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/SwarmClientFactory.java">
-<error line="16" severity="warning" message="Class SwarmClientFactory should be declared as final." source="com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck"/>
-<error line="23" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="27" severity="warning" message="First sentence should end with a period." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
-<error line="38" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="58" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="58" column="135" severity="warning" message="Redundant throws: &apos;UnknownHostException&apos; is subclass of &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/SwarmWSResponse.java">
-<error line="27" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="31" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="41" column="78" severity="warning" message="Name &apos;Deserializer&apos; must match pattern &apos;^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$&apos;." source="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
-<error line="95" column="42" severity="warning" message="Expected @param tag for &apos;message&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/AbstractSwarmWSClient.java">
-<error line="33" column="47" severity="warning" message="Variable &apos;swarmHostUrl&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="34" column="32" severity="warning" message="Variable &apos;apiKey&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="35" column="36" severity="warning" message="Variable &apos;httpClient&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="76" column="45" severity="warning" message="&apos;400&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="76" column="59" severity="warning" message="&apos;600&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="76" column="74" severity="warning" message="&apos;409&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="176" column="79" severity="warning" message="Unable to get class information for JsonGenerationException." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-<error line="176" column="104" severity="warning" message="Redundant throws: &apos;JsonMappingException&apos; listed more then one time." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-<error line="176" column="104" severity="warning" message="Unable to get class information for JsonMappingException." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmBinaryUploadWSClient.java">
-<error line="41" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="45" column="52" severity="warning" message="&apos;(&apos; is followed by whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmInviteWSClient.java">
-<error line="15" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"/>
-<error line="17" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="22" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmKeysWSClient.java">
-<error line="33" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="36" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="37" column="45" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmParticipationReader.java">
-<error line="0" severity="warning" message="File does not end with a newline." source="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck"/>
-<error line="42" column="23" severity="warning" message="&apos;static&apos; modifier out of order with the JLS suggestions." source="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
-<error line="42" column="43" severity="warning" message="Name &apos;mapper&apos; must match pattern &apos;^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$&apos;." source="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
-<error line="50" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="50" column="121" severity="warning" message="Expected @throws tag for &apos;UnsupportedEncodingException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="75" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="84" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="88" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="90" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="98" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="115" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="117" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="117" column="109" severity="warning" message="&apos;cast&apos; is not followed by whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
-<error line="120" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="121" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="121" column="101" severity="warning" message="&apos;cast&apos; is not followed by whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
-<error line="125" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="125" column="95" severity="warning" message="&apos;cast&apos; is not followed by whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
-<error line="127" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="133" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="137" column="46" severity="warning" message="&apos;100&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="155" column="45" severity="warning" message="Expected @param tag for &apos;line&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="169" column="56" severity="warning" message="Expected @param tag for &apos;jmessage&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="180" column="57" severity="warning" message="Expected @param tag for &apos;jmessage&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="193" column="36" severity="warning" message="Expected @param tag for &apos;jsonNode&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="221" column="44" severity="warning" message="&apos;16&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="223" column="51" severity="warning" message="Must have at least one statement." source="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck"/>
-<error line="228" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="229" column="54" severity="warning" message="&apos;4&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmResourceWSClient.java">
-<error line="57" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="59" column="69" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="62" column="78" severity="warning" message="&apos;=&apos; is not preceded with whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
-<error line="91" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="93" column="69" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="96" column="78" severity="warning" message="&apos;=&apos; is not preceded with whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmSessionImp.java">
-<error line="35" column="23" severity="warning" message="&apos;static&apos; modifier out of order with the JLS suggestions." source="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
-<error line="35" column="43" severity="warning" message="Name &apos;mapper&apos; must match pattern &apos;^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$&apos;." source="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
-<error line="48" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="48" column="121" severity="warning" message="Redundant throws: &apos;UnknownHostException&apos; is subclass of &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-<error line="57" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="73" column="42" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="130" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="130" column="110" severity="warning" message="Unable to get class information for JsonGenerationException." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-<error line="130" column="135" severity="warning" message="Redundant throws: &apos;JsonMappingException&apos; listed more then one time." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-<error line="130" column="135" severity="warning" message="Unable to get class information for JsonMappingException." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-<error line="180" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="199" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="203" column="38" severity="warning" message="Expected @param tag for &apos;message&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="203" column="55" severity="warning" message="Expected @param tag for &apos;out&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="204" column="54" severity="warning" message="&apos;4&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="218" severity="warning" message="Expected an @return tag." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="218" column="61" severity="warning" message="Expected @param tag for &apos;resourceId&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="218" column="88" severity="warning" message="Expected @param tag for &apos;payload&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="219" column="42" severity="warning" message="&apos;=&apos; is not followed by whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
-<error line="272" column="41" severity="warning" message="Must have at least one statement." source="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck"/>
-<error line="278" column="41" severity="warning" message="Must have at least one statement." source="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck"/>
-<error line="290" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="290" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmWSClient.java">
-<error line="214" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="255" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="260" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/UserResourceWSClient.java">
-<error line="37" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="40" column="51" severity="warning" message="&apos;(&apos; is followed by whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/Invitation.java">
-<error line="54" severity="warning" message="First sentence should end with a period." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
-<error line="61" column="45" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="71" severity="warning" message="First sentence should end with a period." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
-<error line="77" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="78" column="45" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="81" column="46" severity="warning" message="&apos;=&apos; is not preceded with whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
-<error line="111" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="111" column="16" severity="warning" message="More than 7 parameters." source="com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck"/>
-<error line="125" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="150" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="150" column="16" severity="warning" message="More than 7 parameters." source="com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/ModelBase.java">
-<error line="22" column="39" severity="warning" message="Variable &apos;objectMapper&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="32" column="45" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/ResourcePosition.java">
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/SwarmKey.java">
-<error line="78" severity="warning" message="First sentence should end with a period." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/SwarmModel.java">
-<error line="39" column="45" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="57" column="45" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="89" column="16" severity="warning" message="More than 7 parameters." source="com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck"/>
-<error line="165" column="9" severity="warning" message="Definition of &apos;equals()&apos; without corresponding definition of &apos;hashCode()&apos;." source="com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck"/>
-<error line="177" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="195" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/SwarmResourceModel.java">
-<error line="88" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="97" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/UserResourceModel.java">
-<error line="31" column="45" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="54" column="45" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="93" column="16" severity="warning" message="More than 7 parameters." source="com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck"/>
-<error line="161" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="162" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="173" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/example/Example.java">
-<error line="18" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"/>
-<error line="18" column="1" severity="warning" message="Utility classes should not have a public or default constructor." source="com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck"/>
-<error line="20" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="23" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="33" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="53" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/AccountConfig.java">
-<error line="27" column="1" severity="warning" message="Utility classes should not have a public or default constructor." source="com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck"/>
-<error line="32" column="30" severity="warning" message="Variable &apos;testSwarmId&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="36" column="41" severity="warning" message="Variable &apos;testUserResource&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="37" column="41" severity="warning" message="Variable &apos;testUserResource2&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="38" column="41" severity="warning" message="Variable &apos;testUserResource1&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="40" column="30" severity="warning" message="Variable &apos;testInviteId&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="48" severity="warning" message="Expected an @return tag." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="85" severity="warning" message="Expected an @return tag." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="119" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="126" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="133" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="143" severity="warning" message="Expected an @return tag." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="153" severity="warning" message="Expected an @return tag." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="160" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="164" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="170" column="36" severity="warning" message="&apos;10&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="170" column="42" severity="warning" message="&apos;5&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/Configuration.java">
-<error line="90" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="98" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="133" column="59" severity="warning" message="Must have at least one statement." source="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck"/>
-<error line="147" column="59" severity="warning" message="Must have at least one statement." source="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck"/>
-<error line="197" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/SwarmConfigKeys.java">
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmAPIKeyWSAPITests.java">
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java">
-<error line="27" column="37" severity="warning" message="Name &apos;description&apos; must match pattern &apos;^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$&apos;." source="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
-<error line="66" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="96" column="45" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="130" column="54" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="143" column="50" severity="warning" message="Expression can be simplified." source="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
-<error line="149" column="50" severity="warning" message="Expression can be simplified." source="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
-<error line="170" column="58" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="183" column="54" severity="warning" message="Expression can be simplified." source="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
-<error line="205" column="51" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="215" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="218" column="54" severity="warning" message="Expression can be simplified." source="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
-<error line="235" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="247" column="51" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="257" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="260" column="54" severity="warning" message="Expression can be simplified." source="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
-<error line="277" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmResourceWSAPITests.java">
-<error line="39" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="40" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="148" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="149" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="175" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="178" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="194" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="216" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="252" column="55" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="303" severity="warning" message="Comment matches to-do format &apos;TODO:&apos;." source="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck"/>
-<error line="312" column="23" severity="warning" message="&apos;assert&apos; is not followed by whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmWSAPITests.java">
-<error line="25" column="9" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="197" column="44" severity="warning" message="&apos;200&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="199" column="55" severity="warning" message="&apos;200&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="199" column="60" severity="warning" message="&apos;201&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="199" column="65" severity="warning" message="&apos;400&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="199" column="70" severity="warning" message="&apos;401&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="199" column="75" severity="warning" message="&apos;403&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="199" column="80" severity="warning" message="&apos;404&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="199" column="85" severity="warning" message="&apos;409&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="199" column="90" severity="warning" message="&apos;500&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="206" column="45" severity="warning" message="&apos;200&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="206" column="68" severity="warning" message="&apos;201&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/UserResourceWSAPITests.java">
-<error line="81" column="53" severity="warning" message="&apos;(&apos; is followed by whitespace." source="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
-<error line="105" column="50" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java">
-<error line="33" column="37" severity="warning" message="Name &apos;description&apos; must match pattern &apos;^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$&apos;." source="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
-<error line="35" column="17" severity="warning" message="Variable &apos;psession1MessageRecieved&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="36" column="17" severity="warning" message="Variable &apos;psession2MessageRecieved&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="37" column="17" severity="warning" message="Variable &apos;psession1PresenceMessageRecieved&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="38" column="17" severity="warning" message="Variable &apos;psession2PresenceMessageRecieved&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="39" column="17" severity="warning" message="Variable &apos;psession1ExceptionRecieved&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="40" column="17" severity="warning" message="Variable &apos;psession2ExceptionRecieved&apos; must be private and have accessor methods." source="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
-<error line="79" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="82" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="113" column="44" severity="warning" message="Expected @param tag for &apos;type&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="113" column="57" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="146" column="56" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="155" column="124" severity="warning" message="&apos;4&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="231" column="125" severity="warning" message="&apos;4&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="271" column="30" severity="warning" message="&apos;5000&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="284" column="30" severity="warning" message="&apos;2000&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="293" column="48" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="303" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="306" column="54" severity="warning" message="Expression can be simplified." source="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
-<error line="323" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-</file>
-<file name="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/SessionManagementTests.java">
-<error line="51" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="54" severity="warning" message="Line is longer than 140 characters." source="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck"/>
-<error line="65" column="50" severity="warning" message="Expected @throws tag for &apos;UnknownHostException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="65" column="50" severity="warning" message="Redundant throws: &apos;UnknownHostException&apos; is subclass of &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-<error line="65" column="72" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="65" column="85" severity="warning" message="Expected @throws tag for &apos;InterruptedException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="84" column="30" severity="warning" message="&apos;30000&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="102" column="49" severity="warning" message="Expected @throws tag for &apos;UnknownHostException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="102" column="49" severity="warning" message="Redundant throws: &apos;UnknownHostException&apos; is subclass of &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck"/>
-<error line="102" column="71" severity="warning" message="Expected @throws tag for &apos;IOException&apos;." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="121" column="30" severity="warning" message="&apos;60000&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="121" column="38" severity="warning" message="&apos;3&apos; is a magic number." source="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
-<error line="142" column="17" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="162" column="17" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="165" column="17" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-<error line="168" column="17" severity="warning" message="Missing a Javadoc comment." source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"/>
-</file>
-</checkstyle>
View
403 com.buglabs.bug.swarm.client/checkstyle/cpd-com.buglabs.bug.swarm.client.xml
@@ -1,403 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<pmd-cpd>
-<duplication lines="31" tokens="232">
-<file line="205" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<file line="247" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<codefragment>
-<![CDATA[
- public void testRejectInvitation() throws IOException {
- ISwarmClient client2 = SwarmClientFactory.getSwarmClient(
- AccountConfig.getConfiguration2().getHostname(Protocol.HTTP),
- AccountConfig.getConfiguration2().getConfingurationAPIKey());
- assertNotNull(client2);
- assertNotNull(client2.getSwarmInviteClient());
- assertNotNull(AccountConfig.testSwarmId);
- assertNotNull(AccountConfig.testInviteId);
-
- testSendInvite();
- List<Invitation> receivedInvites = client2.getSwarmInviteClient().getRecievedInvitations(AccountConfig.testUserResource2.getResourceId());
-
- assertNotNull(receivedInvites);
- assertTrue(receivedInvites.isEmpty() == false);
- Invitation invite = null;
-
- for (Invitation i : receivedInvites)
- if (i.getId().equals(AccountConfig.testInviteId))
- invite = i;
-
- assertNotNull(invite);
- assertNotNull(invite.getId());
- assertNotNull(invite.getFromUser());
- assertNotNull(invite.getToUser());
- assertNotNull(invite.getResourceId());
- assertNotNull(invite.getStatus());
- assertTrue(invite.getStatus().equals(InvitationState.NEW));
- assertNotNull(invite.getDescription());
- assertTrue(invite.getDescription().equals(description));
-
- Invitation acceptInvite = client2.getSwarmInviteClient().respond(invite.getResourceId(), invite.getId(), InvitationResponse.REJECT);
-]]>
-</codefragment>
-</duplication>
-<duplication lines="31" tokens="201">
-<file line="57" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java"/>
-<file line="26" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/SessionManagementTests.java"/>
-<codefragment>
-<![CDATA[
- @Override
- protected void setUp() throws Exception {
- /*
- * Create a swarm, a resource, and associate them.
- */
- assertNotNull(AccountConfig.getConfiguration());
- assertNotNull(AccountConfig.getConfiguration2());
-
-
- ISwarmClient client = SwarmClientFactory.getSwarmClient(
- AccountConfig.getConfiguration().getHostname(Configuration.Protocol.HTTP),
- AccountConfig.getConfiguration().getConfingurationAPIKey());
-
- //Delete all pre-existing swarms owned by test user.
- List<SwarmModel> swarms = client.list();
-
- for (SwarmModel sm : swarms) {
- if (sm.getUserId().equals(AccountConfig.getConfiguration().getUsername())) {
- client.destroy(sm.getId());
- }
- }
-
- String id = client.create(AccountConfig.generateRandomSwarmName(), true, AccountConfig.getTestSwarmDescription());
- AccountConfig.testSwarmId = id;
-
- UserResourceModel urc = client.getUserResourceClient().add(AccountConfig.generateRandomResourceName(), "user resource desc", "pc", 0, 0);
- AccountConfig.testUserResource = urc;
-
- SwarmWSResponse response = client.getSwarmResourceClient().add(AccountConfig.testSwarmId, MemberType.PRODUCER, urc.getResourceId());
-
- assertTrue(!response.isError());
-]]>
-</codefragment>
-</duplication>
-<duplication lines="27" tokens="201">
-<file line="214" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<file line="302" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java"/>
-<codefragment>
-<![CDATA[
- sendInvite(MemberType.PRODUCER);
- List<Invitation> receivedInvites = client2.getSwarmInviteClient().getRecievedInvitations(AccountConfig.testUserResource2.getResourceId());
-
- assertNotNull(receivedInvites);
- assertTrue(receivedInvites.isEmpty() == false);
- Invitation invite = null;
-
- for (Invitation i : receivedInvites)
- if (i.getId().equals(AccountConfig.testInviteId))
- invite = i;
-
- assertNotNull(invite);
- assertNotNull(invite.getId());
- assertNotNull(invite.getFromUser());
- assertNotNull(invite.getToUser());
- assertNotNull(invite.getResourceId());
- assertNotNull(invite.getStatus());
- assertTrue(invite.getStatus().equals(InvitationState.NEW));
- assertNotNull(invite.getDescription());
- assertTrue(invite.getDescription().equals(description));
-
- Invitation acceptInvite = client2.getSwarmInviteClient().respond(invite.getResourceId(), invite.getId(), InvitationResponse.ACCEPT);
-
- assertNotNull(acceptInvite);
- assertTrue(acceptInvite.getStatus().equals(InvitationState.ACCEPTED));
- assertNotNull(acceptInvite.getAcceptedAt());
- }
-]]>
-</codefragment>
-</duplication>
-<duplication lines="22" tokens="171">
-<file line="256" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<file line="302" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java"/>
-<codefragment>
-<![CDATA[
- sendInvite(MemberType.PRODUCER);
- List<Invitation> receivedInvites = client2.getSwarmInviteClient().getRecievedInvitations(AccountConfig.testUserResource2.getResourceId());
-
- assertNotNull(receivedInvites);
- assertTrue(receivedInvites.isEmpty() == false);
- Invitation invite = null;
-
- for (Invitation i : receivedInvites)
- if (i.getId().equals(AccountConfig.testInviteId))
- invite = i;
-
- assertNotNull(invite);
- assertNotNull(invite.getId());
- assertNotNull(invite.getFromUser());
- assertNotNull(invite.getToUser());
- assertNotNull(invite.getResourceId());
- assertNotNull(invite.getStatus());
- assertTrue(invite.getStatus().equals(InvitationState.NEW));
- assertNotNull(invite.getDescription());
- assertTrue(invite.getDescription().equals(description));
-
- Invitation acceptInvite = client2.getSwarmInviteClient().respond(invite.getResourceId(), invite.getId(), InvitationResponse.ACCEPT);
-]]>
-</codefragment>
-</duplication>
-<duplication lines="27" tokens="149">
-<file line="172" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java"/>
-<file line="201" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java"/>
-<codefragment>
-<![CDATA[
- public void messageRecieved(String payload, String fromSwarm, String fromResource, boolean isPublic) {
- System.out.print(fromSwarm);
- System.out.print(" ");
- System.out.print(fromResource);
- System.out.print(" ");
- System.out.println(payload);
- psession1MessageRecieved = true;
- }
-
- @Override
- public void exceptionOccurred(ExceptionType type, String message) {
- System.err.print(type.toString());
- System.err.print(" ");
- System.err.print(message);
- psession1ExceptionRecieved = true;
- }
-
- @Override
- public void presenceEvent(String fromSwarm, String fromResource, boolean isAvailable) {
- System.out.print(fromSwarm);
- System.out.print(" ");
- System.out.println(fromResource);
- psession1PresenceMessageRecieved = true;
- }
- });
-
- psession1.join(AccountConfig.testSwarmId, urc.getResourceId());
-]]>
-</codefragment>
-</duplication>
-<duplication lines="20" tokens="143">
-<file line="65" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/SessionManagementTests.java"/>
-<file line="102" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/SessionManagementTests.java"/>
-<codefragment>
-<![CDATA[
- public void test3MinuteSession() throws UnknownHostException, IOException, InterruptedException {
- assertNotNull(AccountConfig.getConfiguration().getHostname(Configuration.Protocol.HTTP));
- assertNotNull(AccountConfig.getConfiguration().getParticipationAPIKey());
- assertNotNull(AccountConfig.testUserResource.getResourceId());
- assertNotNull(AccountConfig.testSwarmId);
-
- ISwarmSession session = SwarmClientFactory.createSwarmSession(
- AccountConfig.getConfiguration().getHostname(Configuration.Protocol.HTTP),
- AccountConfig.getConfiguration().getParticipationAPIKey(),
- AccountConfig.testUserResource.getResourceId(),
- AccountConfig.testSwarmId);
-
- assertNotNull(session);
-
- assertTrue(session.isConnected());
- SessionTestListener tl = new SessionTestListener();
- session.addListener(tl);
- session.join(AccountConfig.testSwarmId, AccountConfig.testUserResource.getResourceId());
-
- Thread.sleep(60000 * 3);
-]]>
-</codefragment>
-</duplication>
-<duplication lines="19" tokens="134">
-<file line="71" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<file line="88" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java"/>
-<codefragment>
-<![CDATA[
- AccountConfig.getConfiguration2().getHostname(Configuration.Protocol.HTTP),
- AccountConfig.getConfiguration2().getConfingurationAPIKey());
-
- //Delete all pre-existing swarms owned by test user.
- for (SwarmModel sm : client2.list()) {
- if (sm.getUserId().equals(AccountConfig.getConfiguration2().getUsername())) {
- client2.destroy(sm.getId());
- }
- }
-
- for (UserResourceModel ur : client2.getUserResourceClient().list())
- client2.getUserResourceClient().destroy(ur.getResourceId());
-
- urc = client2.getUserResourceClient().add(AccountConfig.generateRandomResourceName(), "user resource desc", "pc", 0, 0);
- AccountConfig.testUserResource2 = urc;
-
- //Confirm that original user still has swarm.
- assertTrue(client.list().size() == 1);
- }
-]]>
-</codefragment>
-</duplication>
-<duplication lines="29" tokens="132">
-<file line="49" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmResourceWSClient.java"/>
-<file line="83" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmResourceWSClient.java"/>
-<codefragment>
-<![CDATA[
- "/resources");
-
- //We cannot use a static deserializer here because the json scope of the deserializer does not contain the swarmid.
- Response<List<SwarmResourceModel>> response = httpClient.callGet(
- url,
- new ResponseDeserializer<List<SwarmResourceModel>>() {
-
- @Override
- public List<SwarmResourceModel> deserialize(InputStream input, int responseCode, Map<String, List<String>> headers)
- throws IOException {
- if (responseCode == 404)
- return Collections.emptyList();
-
- List<SwarmResourceModel> srml= new ArrayList<SwarmResourceModel>();
- ObjectMapper objectMapper = new ObjectMapper();
- JsonNode jtree = objectMapper.readTree(input);
-
- for (JsonNode jn : jtree)
- srml.add(SwarmResourceModel.deserialize(swarmId, jn));
-
- return srml;
- }
- });
-
- return response.getContent();
- }
-
- @Override
- public SwarmWSResponse add(final String swarmId, final MemberType type
-]]>
-</codefragment>
-</duplication>
-<duplication lines="19" tokens="124">
-<file line="180" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<file line="215" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<codefragment>
-<![CDATA[
- List<Invitation> receivedInvites = client2.getSwarmInviteClient().getRecievedInvitations(AccountConfig.testUserResource2.getResourceId());
-
- assertNotNull(receivedInvites);
- assertTrue(receivedInvites.isEmpty() == false);
- Invitation invite = null;
-
- for (Invitation i : receivedInvites)
- if (i.getId().equals(AccountConfig.testInviteId))
- invite = i;
-
- assertNotNull(invite);
- assertNotNull(invite.getId());
- assertNotNull(invite.getFromUser());
- assertNotNull(invite.getToUser());
- assertNotNull(invite.getResourceId());
- assertNotNull(invite.getStatus());
- assertTrue(invite.getStatus().equals(InvitationState.NEW));
- assertNotNull(invite.getDescription());
- assertTrue(invite.getDescription().equals(description));
-]]>
-</codefragment>
-</duplication>
-<duplication lines="17" tokens="124">
-<file line="51" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<file line="64" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java"/>
-<codefragment>
-<![CDATA[
- AccountConfig.getConfiguration().getHostname(Configuration.Protocol.HTTP),
- AccountConfig.getConfiguration().getConfingurationAPIKey());
-
- //Delete all pre-existing swarms owned by test user.
- List<SwarmModel> swarms = client.list();
-
- for (SwarmModel sm : swarms) {
- if (sm.getUserId().equals(AccountConfig.getConfiguration().getUsername())) {
- client.destroy(sm.getId());
- }
- }
-
- String id = client.create(AccountConfig.generateRandomSwarmName(), true, AccountConfig.getTestSwarmDescription());
- AccountConfig.testSwarmId = id;
-
- UserResourceModel urc = client.getUserResourceClient().add(AccountConfig.generateRandomResourceName(), "user resource desc", "pc", 0, 0);
- AccountConfig.testUserResource = urc;
-]]>
-</codefragment>
-</duplication>
-<duplication lines="17" tokens="111">
-<file line="47" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<file line="40" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmResourceWSAPITests.java"/>
-<codefragment>
-<![CDATA[
- assertFalse(AccountConfig.getConfiguration().getParticipationAPIKey().equals(AccountConfig.getConfiguration2().getParticipationAPIKey()));
-
- ISwarmClient client = SwarmClientFactory.getSwarmClient(
- AccountConfig.getConfiguration().getHostname(Protocol.HTTP),
- AccountConfig.getConfiguration().getConfingurationAPIKey());
-
- //Delete all pre-existing swarms owned by test user.
- List<SwarmModel> swarms = client.list();
-
- for (SwarmModel sm : swarms) {
- if (sm.getUserId().equals(AccountConfig.getConfiguration().getUsername())) {
- client.destroy(sm.getId());
- }
- }
-
- String id = client.create(AccountConfig.generateRandomSwarmName(), true, AccountConfig.getTestSwarmDescription());
- AccountConfig.testSwarmId = id;
-]]>
-</codefragment>
-</duplication>
-<duplication lines="13" tokens="105">
-<file line="70" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java"/>
-<file line="59" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmResourceWSAPITests.java"/>
-<codefragment>
-<![CDATA[
- ISwarmClient client2 = SwarmClientFactory.getSwarmClient(
- AccountConfig.getConfiguration2().getHostname(Protocol.HTTP),
- AccountConfig.getConfiguration2().getConfingurationAPIKey());
-
- //Delete all pre-existing swarms owned by test user.
- for (SwarmModel sm : client2.list()) {
- if (sm.getUserId().equals(AccountConfig.getConfiguration2().getUsername())) {
- client2.destroy(sm.getId());
- }
- }
-
- for (UserResourceModel ur : client2.getUserResourceClient().list())
- client2.getUserResourceClient().destroy(ur.getResourceId());
-]]>
-</codefragment>
-</duplication>
-<duplication lines="24" tokens="100">
-<file line="109" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/AbstractSwarmWSClient.java"/>
-<file line="139" path="/home/jconnolly/buglabs/dev/misc/bugswarm-connector/com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmSessionImp.java"/>
-<codefragment>
-<![CDATA[
- }
-
- /**
- * Given a variable number of <String, String> pairs, construct a Map and
- * return it with values loaded.
- *
- * @param elements
- * name1, value1, name2, value2...
- * @return a Map and return it with values loaded.
- */
- public static Map<String, Object> toMap(Object... elements) {
- if (elements.length % 2 != 0) {
- throw new IllegalStateException("Input parameters must be even.");
- }
-
- Iterator<Object> i = Arrays.asList(elements).iterator();
- Map<String, Object> m = new HashMap<String, Object>();
-
- while (i.hasNext()) {
- m.put(i.next().toString(), i.next());
- }
-
- return m;
- }
-]]>
-</codefragment>
-</duplication>
-</pmd-cpd>
View
13 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/SwarmClientFactory.java
@@ -20,6 +20,7 @@
* Default port of swarm server participation API.
*/
private static final int DEFAULT_SWARM_SERVER_PORT = 80;
+ private static boolean keepalive;
private SwarmClientFactory() {
//Static utility class.
@@ -56,9 +57,9 @@ public static ISwarmConfiguration getSwarmConfigurationClient(String hostname, S
* @throws UnknownHostException if unable to resolve hostname
* @throws IOException on I/O error
*/
- public static ISwarmSession createProductionSession(String hostname, String apiKey, String resourceId, String ... swarmIds) throws UnknownHostException, IOException {
+ public static ISwarmSession createProductionSession(String hostname, String apiKey, String resourceId, boolean keepalive, boolean autoreconnect, String ... swarmIds) throws UnknownHostException, IOException {
- return createSession(hostname, SessionType.PRODUCTION, apiKey, resourceId, swarmIds);
+ return createSession(hostname, SessionType.PRODUCTION, apiKey, resourceId, keepalive, autoreconnect, swarmIds);
}
/**
@@ -72,12 +73,12 @@ public static ISwarmSession createProductionSession(String hostname, String apiK
* @throws UnknownHostException if unable to resolve hostname
* @throws IOException on I/O error
*/
- public static ISwarmSession createConsumptionSession(String hostname, String apiKey, String resourceId, String ... swarmIds) throws UnknownHostException, IOException {
+ public static ISwarmSession createConsumptionSession(String hostname, String apiKey, String resourceId, boolean keepalive, boolean autoreconnect, String ... swarmIds) throws UnknownHostException, IOException {
- return createSession(hostname, SessionType.CONSUMPTION, apiKey, resourceId, swarmIds);
+ return createSession(hostname, SessionType.CONSUMPTION, apiKey, resourceId, keepalive, autoreconnect, swarmIds);
}
- private static ISwarmSession createSession(String hostname, SessionType type, String apiKey, String resourceId, String ... swarmIds) throws UnknownHostException, IOException {
+ private static ISwarmSession createSession(String hostname, SessionType type, String apiKey, String resourceId, boolean keepalive, boolean autoreconnect, String ... swarmIds) throws UnknownHostException, IOException {
if (hostname.toLowerCase().startsWith("http://"))
hostname = hostname.substring("http://".length());
@@ -87,7 +88,7 @@ private static ISwarmSession createSession(String hostname, SessionType type, St
port = Integer.parseInt(hostname.split(":")[1]);
hostname = hostname.split(":")[0];
}
- return new SwarmSessionImp(hostname, type, port, apiKey, resourceId, swarmIds);
+ return new SwarmSessionImp(hostname, type, port, apiKey, resourceId, keepalive, autoreconnect, swarmIds);
}
/**
View
15 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/KeepAliveThread.java
@@ -0,0 +1,15 @@
+package com.buglabs.bug.swarm.client.impl;
+
+import java.net.Socket;
+
+public class KeepAliveThread implements Runnable{
+ public KeepAliveThread(Socket connection){
+
+ }
+ @Override
+ public void run() {
+
+
+ }
+
+}
View
4 ...labs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmParticipationReader.java
@@ -79,8 +79,8 @@ public void run() {
listener.exceptionOccurred(ExceptionType.SERVER_MESSAGE_PARSE_ERROR, "Unparsable message: " + line);
continue;
}
-
- debugOut(line, false);
+ //uncomment below to print all messages received by the reader
+ //debugOut(line, false);
//Parse the message string into a JsonNode.
JsonNode jmessage = mapper.readTree(line);
View
69 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmSessionImp.java
@@ -5,10 +5,13 @@
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Arrays;
+import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
import java.util.concurrent.CopyOnWriteArrayList;
import org.codehaus.jackson.JsonGenerationException;
@@ -33,45 +36,80 @@
private final List<ISwarmMessageListener> listeners;
private SwarmParticipationReader readerThread;
private final static ObjectMapper mapper = new ObjectMapper();
+ protected static final long MAX_INTERVAL = 60000; //timeout
private final String[] swarmIds;
private final String resourceId;
private final int port;
- private final SessionType type;
+ private final SessionType type;
+ private boolean keepalive;
+ private boolean autoreconnect;
+ private long timestamp;
/**
* @param hostname host of server
* @param type type of session to create
* @param port port on server
* @param apiKey api key
* @param resourceId resource id
+ * @param autoreconnect
+ * @param keepalive
* @param swarmIds list of swarms to join
* @throws UnknownHostException on host resolution error
* @throws IOException on I/O error
*/
- public SwarmSessionImp(String hostname, ISwarmSession.SessionType type, int port, String apiKey, String resourceId, String ... swarmIds) throws UnknownHostException, IOException {
+ public SwarmSessionImp(String hostname, ISwarmSession.SessionType type, int port, String apiKey, String resourceId, boolean keepalive, boolean autoreconnect, String ... swarmIds) throws UnknownHostException, IOException {
this.hostname = hostname;
this.type = type;
this.port = port;
this.apiKey = apiKey;
this.resourceId = resourceId;
+ this.keepalive = keepalive;
+ this.autoreconnect = autoreconnect;
this.swarmIds = swarmIds;
this.listeners = new CopyOnWriteArrayList<ISwarmMessageListener>();
this.listeners.add(this);
this.socket = createSocket(hostname, port);
- sendHeader();
+ sendHeader();
+ if (keepalive)
+ createKeepAliveThread();
+ }
+
+ //every 60 seconds, see if a message has been sent by comparing
+ //the local timestamp to the global. if they're the same
+ //no message has been sent, send a \n, otherwise just keep truckin
+ private void createKeepAliveThread() {
+ final Timer timer = new Timer();
+ timer.schedule(new TimerTask() {
+ private long localtimestamp = timestamp;
+
+ public void run() {
+ if (localtimestamp==timestamp){
+ try {
+ writeOut("\n");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ localtimestamp = timestamp;
+
+
+ }
+ }, 0, 60000);
}
private Socket createSocket(String hostname, int port) throws UnknownHostException, IOException {
Socket socket = new Socket(hostname, port);
+ socket.setSoTimeout(60000);
this.soutput = socket.getOutputStream();
if (readerThread != null)
readerThread.interrupt();
this.readerThread = new SwarmParticipationReader(socket.getInputStream(), apiKey, listeners);
this.readerThread.start();
+ //sendHeader();
return socket;
}
@@ -112,7 +150,11 @@ private void sendHeader() throws IOException {
//need to write one chunk into the stream before the platform will send data do us
//I chose \ because it's the keepalive as well
//see https://github.com/buglabs/bugswarm-connector/issues/30
- writeOut("\n");
+ soutput.write(Integer.toHexString("\n".length()).getBytes());
+ soutput.write(CRLF.getBytes());
+ soutput.write("\n".getBytes());
+ soutput.write(CRLF.getBytes());
+ soutput.flush();
}
/**
@@ -209,8 +251,8 @@ public void join(String swarmId, String resourceId) throws IOException {
buffer.append(Integer.toHexString(ps.getBytes().length)).append(CRLF);
buffer.append(ps).append(CRLF);
-
- debugOut(buffer.toString(), true);
+ //uncomment to get join messages
+ //debugOut(buffer.toString(), true);
soutput.write(buffer.toString().getBytes());
soutput.flush();
}
@@ -279,17 +321,20 @@ private void debugOut(String message, boolean out) {
* @throws IOException on socket I/O error
*/
private void writeOut(String message) throws IOException {
- if (!isConnected()) {
+ if (!isConnected() && autoreconnect) {
this.socket = createSocket(hostname, port);
+ sendHeader();
}
- debugOut(message, true);
-
- soutput.write(Integer.toHexString(message.length()).getBytes());
+ //debugOut(message, true);
+ //new framing requires sending a \r\n after each message.
+ soutput.write(Integer.toHexString(message.length()+CRLF.length()).getBytes());
soutput.write(CRLF.getBytes());
+ message = message+CRLF;
soutput.write(message.getBytes());
soutput.write(CRLF.getBytes());
soutput.flush();
+ timestamp = (new Date()).getTime();
}
@Override
@@ -314,8 +359,8 @@ public void close() {
buffer.append(Integer.toHexString(ps.getBytes().length)).append(CRLF);
buffer.append(ps).append(CRLF);
-
- debugOut(buffer.toString(), true);
+ //uncomment to get close messages
+ //debugOut(buffer.toString(), true);
soutput.write(buffer.toString().getBytes());
soutput.flush();
} catch (IOException e) {

0 comments on commit aa4fd80

Please sign in to comment.