Permalink
Browse files

moving the library/client side of the connector into its own repo.

  • Loading branch information...
0 parents commit e737821cd92379c391cd161c2d5a7b303ac36af6 John Connolly committed Feb 6, 2012
Showing with 7,508 additions and 0 deletions.
  1. +9 −0 com.buglabs.bug.swarm.client/.classpath
  2. +28 −0 com.buglabs.bug.swarm.client/.project
  3. +14 −0 com.buglabs.bug.swarm.client/META-INF/MANIFEST.MF
  4. +204 −0 com.buglabs.bug.swarm.client/bin/Example.html
  5. +1 −0 com.buglabs.bug.swarm.client/bin/README
  6. +4 −0 com.buglabs.bug.swarm.client/build.properties
  7. +62 −0 com.buglabs.bug.swarm.client/build.xml
  8. +344 −0 com.buglabs.bug.swarm.client/checkstyle/checkstyle-com.buglabs.bug.swarm.client.xml
  9. +403 −0 com.buglabs.bug.swarm.client/checkstyle/cpd-com.buglabs.bug.swarm.client.xml
  10. +27 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmBinaryUploadClient.java
  11. +119 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmClient.java
  12. +249 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmConfiguration.java
  13. +138 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmInviteClient.java
  14. +22 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmJsonMessageListener.java
  15. +70 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmKeysClient.java
  16. +56 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmMessageListener.java
  17. +91 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmResourcesClient.java
  18. +104 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmSession.java
  19. +20 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmStringMessageListener.java
  20. +89 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/IUserResourceClient.java
  21. +101 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/SwarmClientFactory.java
  22. +120 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/SwarmWSResponse.java
  23. +182 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/AbstractSwarmWSClient.java
  24. +52 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmBinaryUploadWSClient.java
  25. +95 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmInviteWSClient.java
  26. +110 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmKeysWSClient.java
  27. +258 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmParticipationReader.java
  28. +166 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmResourceWSClient.java
  29. +386 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmSessionImp.java
  30. +288 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/SwarmWSClient.java
  31. +109 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/impl/UserResourceWSClient.java
  32. +252 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/Configuration.java
  33. +217 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/Invitation.java
  34. +68 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/ModelBase.java
  35. +35 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/ResourcePosition.java
  36. +116 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/SwarmKey.java
  37. +201 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/SwarmModel.java
  38. +103 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/SwarmResourceModel.java
  39. +179 −0 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/model/UserResourceModel.java
  40. +204 −0 com.buglabs.bug.swarm.client/test/Example.html
  41. +1 −0 com.buglabs.bug.swarm.client/test/README
  42. +77 −0 com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/example/Example.java
  43. +180 −0 com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/AccountConfig.java
  44. +92 −0 com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/SwarmConfigKeys.java
  45. +170 −0 ...labs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/TwoParticipantsOneSwarmTestCase.java
  46. +122 −0 ....bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmAPIKeyWSAPITests.java
  47. +283 −0 ....swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmInvitationWSAPITests.java
  48. +333 −0 ...ug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmResourceWSAPITests.java
  49. +223 −0 ...uglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/SwarmWSAPITests.java
  50. +126 −0 ...bug.swarm.client/test/com/buglabs/bug/swarm/client/test/configuration/UserResourceWSAPITests.java
  51. +104 −0 com.buglabs.bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/FeedTests.java
  52. +329 −0 ....bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/ParticipationAPITests.java
  53. +172 −0 ...bug.swarm.client/test/com/buglabs/bug/swarm/client/test/participation/SessionManagementTests.java
9 com.buglabs.bug.swarm.client/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="test"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
28 com.buglabs.bug.swarm.client/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.buglabs.bug.swarm.client</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
14 com.buglabs.bug.swarm.client/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: BUGswarm ReST Client
+Bundle-SymbolicName: com.buglabs.bug.swarm.client
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Bug Labs, Inc.
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package:
+ junit.framework;resolution:=optional,
+ org.codehaus.jackson,
+ org.codehaus.jackson.map,
+ org.touge.restclient;version="1.0"
+Export-Package: com.buglabs.bug.swarm.client;version="0.3.0",
+ com.buglabs.bug.swarm.client.model;version="0.3.0"
204 com.buglabs.bug.swarm.client/bin/Example.html
@@ -0,0 +1,204 @@
+<!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>
1 com.buglabs.bug.swarm.client/bin/README
@@ -0,0 +1 @@
+The tests for restclient are now in bugswarm-connector project.
4 com.buglabs.bug.swarm.client/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
62 com.buglabs.bug.swarm.client/build.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<project name="com.buglabs.bug.swarm.client" basedir=".">
+ <!-- PROJECT CONSTANTS -->
+
+ <target name="build.jars" description="Package the java class files into a jar.">
+ <echo message="## PROJECT: ${ant.project.name} ## TARGET: build.jars" />
+
+ <property name="dist.jar.name" value="${ant.project.name}" />
+ <property name="manifest.location" location="${basedir}/META-INF/MANIFEST.MF"/>
+
+ <fail unless="distDirectory" message="distDirectory must be defined." />
+ <fail unless="buildDirectory" message="buildDirectory must be defined." />
+
+ <jar destfile="${distDirectory}/${dist.jar.name}.jar"
+ basedir="${buildDirectory}"
+ manifest="${manifest.location}">
+ <fileset dir="${buildDirectory}" excludes="**/*.java,build/**,**/.settings/**,**/build.xml/**,**/build.properties/**,**/.classpath,**/.project,src/**,test/**,junit-reports/**,.git/**,**.gitignore,**/.checkstyle,**/README.*,**/build*.sh,checkstyle-reports/**" />
+ <fileset dir="${basedir}" includes="images/**,includes/**,javascripts/**,stylesheets/**,templates/**" />
+ </jar>
+ </target>
+
+ <!-- target: test Run JUnit tests -->
+ <target name="test">
+ <echo message="## PROJECT: ${ant.project.name} ## TARGET: test" />
+ <fail unless="report.dir" message="Ant variable report.dir must be defined." />
+ <echo message="Generating test result output in ${report.dir}..." />
+ <junit printsummary="yes">
+ <classpath refid="bin.classpath" />
+ <sysproperty key="report.misc" value="${report.misc}" />
+ <formatter type="xml" />
+ <batchtest todir="${report.dir}">
+ <fileset dir="${report.src}">
+ <include name="**/*Test*.java" />
+ <exclude name="**/*OSGiTest*.java" />
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <!-- PROJECT IMPORTS -->
+ <exec executable="/usr/bin/wget">
+ <arg line="-P ${base.build.dir}" />
+ <arg line="--no-check-certificate" />
+ <arg line="-nc" />
+ <arg line="https://github.com/downloads/buglabs/bug-osgi/common-osgi.xml" />
+ </exec>
+ <property name="common.ant.file" location="${base.build.dir}/common-osgi.xml" />
+ <import file="${common.ant.file}" />
+
+ <!-- JUnit tests -->
+ <property environment="env" />
+ <property name="report.misc" value="${env.TEST_HOST}" />
+ <echo message="report.misc is ${report.misc}">
+ </echo>
+ <property name="report.dir" location="junit-reports" />
+ <property name="report.src" location="test/" />
+
+ <!-- Checkstyle -->
+ <property name="checkstyle.config" location="${base.build.dir}/toolbox/checkstyle/buglabs_checks.xml" />
+ <property name="checkstyle.dir" location="checkstyle-reports" />
+ <property name="checkstyle.src" location="src/" />
+</project>
344 com.buglabs.bug.swarm.client/checkstyle/checkstyle-com.buglabs.bug.swarm.client.xml
@@ -0,0 +1,344 @@
+<?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>
403 com.buglabs.bug.swarm.client/checkstyle/cpd-com.buglabs.bug.swarm.client.xml
@@ -0,0 +1,403 @@
+<?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>
27 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmBinaryUploadClient.java
@@ -0,0 +1,27 @@
+package com.buglabs.bug.swarm.client;
+
+import java.io.IOException;
+
+/**
+ * Represents the client-side of the Swarm Binary Uploads API as defined here:
+ * https://github.com/buglabs/bugswarm/wiki/Binary-Uploads-API.
+ *
+ * @author kgilmer
+ *
+ */
+public interface ISwarmBinaryUploadClient {
+
+ /**
+ * Upload binary data to swarm.
+ *
+ * @param userId user id
+ * @param resourceId resource id
+ * @param filename
+ * Abstract name of file
+ * @param payload
+ * byte array of binary data
+ * @return WS response
+ * @throws IOException
+ */
+ SwarmWSResponse upload(String userId, String resourceId, String filename, byte[] payload) throws IOException;
+}
119 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmClient.java
@@ -0,0 +1,119 @@
+package com.buglabs.bug.swarm.client;
+
+import java.io.IOException;
+import java.util.List;
+
+import com.buglabs.bug.swarm.client.model.SwarmModel;
+
+/**
+ * A contract for the BUGSwarm WS API. See
+ * https://github.com/buglabs/bugswarm/wiki/Swarms-API
+ *
+ * This API requires and implementation that holds API-KEY and swarm host state
+ * internally.
+ *
+ * @author kgilmer
+ *
+ */
+public interface ISwarmClient {
+ /**
+ * The character encoding for all messages in swarm protocol.
+ */
+ public String SWARM_CHARACTER_ENCODING = "UTF-8";
+
+ /**
+ * Create a swarm.
+ *
+ * @param name
+ * name of swarm
+ * @param isPublic
+ * swarm can be public or private
+ * @param description
+ * textual description of swarm
+ * @return the id of the newly created swarm
+ * @throws IOException on I/O error
+ */
+ String create(String name, boolean isPublic, String description) throws IOException;
+
+ /**
+ * Create a swarm.
+ *
+ * @param name
+ * name of swarm
+ * @param description
+ * textual description of swarm
+ * @return the id of the newly created swarm
+ * @throws IOException on I/O error
+ */
+ String create(String name, String description) throws IOException;
+
+ /**
+ * Update the description of a swarm.
+ *
+ * @param swarmId
+ * id of swarm
+ * @param isPublic
+ * swarm can be public or private
+ * @param description
+ * description
+ * @return HTTP response of operation.
+ * @throws IOException on I/O error
+ */
+ SwarmWSResponse update(String swarmId, boolean isPublic, String description) throws IOException;
+
+ /**
+ * Delete a swarm.
+ *
+ * @param swarmId
+ * TODO
+ * @return HTTP response of operation.
+ * @throws IOException on I/O error
+ */
+ SwarmWSResponse destroy(String swarmId) throws IOException;
+
+ /**
+ * Get all available swarms.
+ *
+ * @return A list of SwarmModel for all available swarms.
+ * @throws IOException on I/O error
+ */
+ List<SwarmModel> list() throws IOException;
+
+ /**
+ * Get info of a specific swarm.
+ *
+ * @param swarmId
+ * swarmId
+ * @return a SwarmModel instance for the given id, or throws HTTP 404 if
+ * swarm does not exist.
+ * @throws IOException on I/O error
+ */
+ SwarmModel get(String swarmId) throws IOException;
+
+ /**
+ * Convenience method to return WS client for Swarm Membership API.
+ *
+ * @return the WS API client for members
+ */
+ ISwarmResourcesClient getSwarmResourceClient();
+
+ /**
+ * @return an instance of an IResourceClient associated with the ISwarmClient's user and api key.
+ */
+ IUserResourceClient getUserResourceClient();
+
+ /**
+ * @return an instance of a ISwarmBinaryUploadClient.
+ */
+ ISwarmBinaryUploadClient getSwarmBinaryUploadClient();
+
+ /**
+ * @return an instance of ISwarmInviteClient.
+ */
+ ISwarmInviteClient getSwarmInviteClient();
+
+ /**
+ * @return an instance of ISwarmKeysClient.
+ */
+ ISwarmKeysClient getSwarmKeysClient();
+}
249 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmConfiguration.java
@@ -0,0 +1,249 @@
+package com.buglabs.bug.swarm.client;
+
+import java.io.IOException;
+import java.util.List;
+
+import com.buglabs.bug.swarm.client.ISwarmInviteClient.InvitationResponse;
+import com.buglabs.bug.swarm.client.ISwarmResourcesClient.MemberType;
+import com.buglabs.bug.swarm.client.model.Invitation;
+import com.buglabs.bug.swarm.client.model.SwarmModel;
+import com.buglabs.bug.swarm.client.model.SwarmResourceModel;
+import com.buglabs.bug.swarm.client.model.UserResourceModel;
+
+/**
+ * This is the flat API for Swarm configuration. It is the superset of the ISwarm*Client interfaces, and is provided as a simpler API.
+ *
+ * @author kgilmer
+ *
+ */
+public interface ISwarmConfiguration {
+
+ /**
+ * Upload binary data to swarm.
+ *
+ * @param userId user id
+ * @param resourceId resource id
+ * @param filename
+ * Abstract name of file
+ * @param payload
+ * byte array of binary data
+ * @return WS response
+ * @throws IOException
+ */
+ SwarmWSResponse upload(String userId, String resourceId, String filename, byte[] payload) throws IOException;
+
+ /**
+ * Create a swarm.
+ *
+ * @param name
+ * name of swarm
+ * @param isPublic
+ * swarm can be public or private
+ * @param description
+ * textual description of swarm
+ * @return the id of the newly created swarm
+ * @throws IOException on I/O error
+ */
+ String createSwarm(String name, boolean isPublic, String description) throws IOException;
+
+ /**
+ * Update the description of a swarm.
+ *
+ * @param swarmId
+ * id of swarm
+ * @param isPublic
+ * swarm can be public or private
+ * @param description
+ * description
+ * @return HTTP response of operation.
+ * @throws IOException on I/O error
+ */
+ SwarmWSResponse updateSwarm(String swarmId, boolean isPublic, String description) throws IOException;
+
+ /**
+ * Delete a swarm.
+ *
+ * @param swarmId
+ * TODO
+ * @return HTTP response of operation.
+ * @throws IOException on I/O error
+ */
+ SwarmWSResponse destroySwarm(String swarmId) throws IOException;
+
+ /**
+ * Get all available swarms.
+ *
+ * @return A list of SwarmModel for all available swarms.
+ * @throws IOException on I/O error
+ */
+ List<SwarmModel> listSwarms() throws IOException;
+
+ /**
+ * Get info of a specific swarm.
+ *
+ * @param swarmId
+ * swarmId
+ * @return a SwarmModel instance for the given id, or throws HTTP 404 if
+ * swarm does not exist.
+ * @throws IOException on I/O error
+ */
+ SwarmModel getSwarm(String swarmId) throws IOException;
+
+ /**
+ * Send an invitation
+ *
+ * @param swarmId swarm id
+ * @param user user id
+ * @param resourceId resource id
+ * @param resourceType resource type
+ * @param description description or null for no description
+ * @return fully populated invitation.
+ * @throws IOException on I/O or application error.
+ */
+ Invitation send(String swarmId, String user, String resourceId, MemberType resourceType, String description) throws IOException;
+
+ /**
+ * Use this method to monitor the status of invitations sent to resources to join a given swarm.
+ *
+ * @param swarmId swarm id
+ * @return List of Invitations
+ * @throws IOException on I/O or application error.
+ */
+ List<Invitation> getSentInvitations(String swarmId) throws IOException;
+
+ /**
+ * Use this method to keep track of all invitations you have received.
+ *
+ * @return List of all invitations for user.
+ * @throws IOException on I/O error
+ */
+ List<Invitation> getRecievedInvitations() throws IOException;
+
+ /**
+ * Use this method to keep track of what invitations you have received for a specific resource.
+ *
+ * @param resourceId resource id
+ * @return List of received invitations for specific resource.
+ * @throws IOException on I/O error
+ */
+ List<Invitation> getRecievedInvitations(String resourceId) throws IOException;
+
+ /**
+ * At any point in time, users may choose to respond to pending invitations for a given resource. Use this method to either accept or reject these invitations.
+ *
+ * @param resourceId resource id
+ * @param invitationId invitation id
+ * @param action Action to take on response
+ * @return an Invitation type with response populated.
+ * @throws IOException on I/O error
+ */
+ Invitation respond(String resourceId, String invitationId, InvitationResponse action) throws IOException;
+
+ /**
+ * Lists existing resources in a swarm.
+ * @param swarmId
+ * id of swarm
+ * @param type
+ * consumer or producer
+ * @return List of SwarmMemberModel
+ * @throws IOException
+ * on connection error
+ */
+ List<SwarmResourceModel> listResources(String swarmId, ISwarmResourcesClient.MemberType type) throws IOException;
+
+ /**
+ * Adds an existing resource to a swarm.
+ *
+ * @param swarmId
+ * id of swarm
+ * @param type
+ * consumer or producer
+ * @param userId
+ * user id
+ * @param resourceId resource id
+ * @return HTTP response of operation
+ * @throws IOException on I/O error
+ */
+ SwarmWSResponse addResource(String swarmId, ISwarmResourcesClient.MemberType type, String resourceId) throws IOException;
+
+ /**
+ * @param swarmId
+ * id of swarm
+ * @param type
+ * consumer or producer
+ * @param userId
+ * user id
+ * @param resourceId id of resource
+ * @return HTTP response of operation
+ * @throws IOException on I/O error
+ */
+ SwarmWSResponse removeResource(String swarmId, ISwarmResourcesClient.MemberType type, String userId, String resourceId) throws IOException;
+
+ /**
+ *
+ * Creates a new resource.
+ * @param resourceName name of resource
+ * @param description description of resource
+ * @param machineType type of device
+ * @param longitude position of device at time of call, or 0.
+ * @param latitude position of device at time of call, or 0.
+ * @return WS response
+ * @throws IOException on I/O error
+ */
+ UserResourceModel createResource(String resourceName, String description, String machineType, float longitude, float latitude) throws IOException;
+
+ /**
+ *
+ * Update a resource.
+ * @param resourceId id of resource
+ * @param resourceName name of resource
+ * @param resourceDescription description of resource
+ * @param type type of resource
+ * @param machineType type of device
+ * @return WS response
+ * @throws IOException on I/O or authentication error.
+ */
+ SwarmWSResponse updateResource(String resourceId, String resourceName, String resourceDescription, MemberType type, String machineType) throws IOException;
+
+ /**
+ * Get all owned resources.
+ *
+ * @return List of ResourceModel or empty list of no matches are found.
+ * @throws IOException on I/O or authentication error.
+ */
+ List<UserResourceModel> getResources() throws IOException;
+
+ /**
+ * Get a specific resource.
+ *
+ * @param resourceId id of resource
+ * @return specific instance or null if no match found.
+ * @throws IOException on I/O or authentication error.
+ */
+ UserResourceModel getResource(String resourceId) throws IOException;
+
+ /**
+ * Remove a resource.
+ * @param resourceId id of resource
+ * @return WS response code
+ * @throws IOException on I/O or authentication error.
+ */
+ SwarmWSResponse removeResource(String resourceId) throws IOException;
+
+ /**
+ *
+ * Get the list of swarms where <resource_id> is a resource.
+ * @param resourceId id of resource
+ * @return List of SwarmResourceModel or empty list if no matches are found
+ * @throws IOException on I/O or authentication error.
+ */
+ List<SwarmModel> getMemberSwarms(String resourceId) throws IOException;
+
+ /**
+ * Get the list of resources for the user.
+ *
+ * @return List of ResourceModel or empty list if no resources are available.
+ * @throws IOException
+ */
+ List<UserResourceModel> listResource() throws IOException;
+}
138 com.buglabs.bug.swarm.client/src/com/buglabs/bug/swarm/client/ISwarmInviteClient.java
@@ -0,0 +1,138 @@
+package com.buglabs.bug.swarm.client;
+
+import java.io.IOException;
+import java.util.List;
+
+import com.buglabs.bug.swarm.client.ISwarmResourcesClient.MemberType;
+import com.buglabs.bug.swarm.client.model.Invitation;
+
+/**
+ * Contract for the API defined at:
+ *
+ * http://developer.bugswarm.net/restful_invitations.html
+ *
+ * @author kgilmer
+ *
+ */
+public interface ISwarmInviteClient {
+ /**
+ * An invitation sent to a resource can be accepted or rejected by the owner (user) of that resource.
+ */
+ public enum InvitationResponse {
+ /**
+ * A response to accept an invitation.
+ */
+ ACCEPT("accept"),
+ /**
+ * A response to reject an invitation.
+ */
+ REJECT("reject");
+
+ /**
+ * Name of member.
+ */
+ private final String name;
+
+ /**
+ * @param name
+ * of member
+ */
+ private InvitationResponse(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+ }
+
+ /**
+ * An invitation sent to a resource can be accepted or rejected by the owner (user) of that resource.
+ */
+ public enum InvitationState {
+ /**
+ * Accepted state.
+ */
+ ACCEPTED("accepted"),
+ /**
+ * Rejected state.
+ */
+ REJECTED("rejected"),
+ /**
+ * New or undecided state.
+ */
+ NEW("new");
+
+ /**
+ * Name of member.
+ */
+ private final String name;
+
+ /**
+ * @param name
+ * of member
+ */
+ private InvitationState(final String name) {
+ this.name = name;
+ }
+
+ @Override<