Author: jvanzyl
Date: Sat May 24 09:16:51 2008
New Revision: 659847

URL: http://svn.apache.org/viewvc?rev=659847&view=rev
Log: (empty)

Added:
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/MercuryException.java
   (contents, props changed)
      - copied, changed from r659715, 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/BatchException.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalRequest.java
   (contents, props changed)
      - copied, changed from r659715, 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/RetrievalRequestImpl.java
Removed:
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/BatchException.java
    
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/RetrievalRequestImpl.java
Modified:
    maven/sandbox/trunk/mercury/.settings/org.eclipse.jdt.core.prefs
    maven/sandbox/trunk/mercury/.settings/org.maven.ide.eclipse.prefs
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/Binding.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployResponse.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployer.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeployResponse.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeploymentTarget.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/FilePutExchange.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalResponse.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetriever.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/FileGetExchange.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalRequest.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalResponse.java
    
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalTarget.java
    
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyDeployerTest.java
    
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyRetrieverTest.java

Modified: maven/sandbox/trunk/mercury/.settings/org.eclipse.jdt.core.prefs
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/.settings/org.eclipse.jdt.core.prefs?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- maven/sandbox/trunk/mercury/.settings/org.eclipse.jdt.core.prefs (original)
+++ maven/sandbox/trunk/mercury/.settings/org.eclipse.jdt.core.prefs Sat May 24 
09:16:51 2008
@@ -1,5 +1,6 @@
-#Fri May 23 16:04:57 PDT 2008
+#Fri May 23 16:49:34 PDT 2008
 eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=ignore
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
 org.eclipse.jdt.core.compiler.compliance=1.5
 org.eclipse.jdt.core.compiler.source=1.5

Modified: maven/sandbox/trunk/mercury/.settings/org.maven.ide.eclipse.prefs
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/.settings/org.maven.ide.eclipse.prefs?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- maven/sandbox/trunk/mercury/.settings/org.maven.ide.eclipse.prefs (original)
+++ maven/sandbox/trunk/mercury/.settings/org.maven.ide.eclipse.prefs Sat May 
24 09:16:51 2008
@@ -1,9 +1,9 @@
-#Fri May 23 16:04:55 PDT 2008
+#Fri May 23 16:49:28 PDT 2008
 activeProfiles=
 eclipse.preferences.version=1
-filterResources=false
+filterResources=true
 includeModules=false
 resolveWorkspaceProjects=true
 resourceFilterGoals=process-resources resources\:testResources
-useMavenFolders=false
+useMavenFolders=true
 version=1

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/Binding.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/Binding.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/Binding.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/Binding.java
 Sat May 24 09:16:51 2008
@@ -33,6 +33,17 @@
     protected String remoteUrl;
     protected File localFile;
     protected boolean lenientChecksum;
+       
+    public Binding()
+    {        
+    }
+    
+    public Binding( String remoteUrl, File localFile, boolean lenientChecksum )
+    {
+        this.remoteUrl = remoteUrl;
+        this.localFile = localFile;
+        this.lenientChecksum = lenientChecksum;
+    }
 
     public String getRemoteUrl()
     {

Copied: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/MercuryException.java
 (from r659715, 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/BatchException.java)
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/MercuryException.java?p2=maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/MercuryException.java&p1=maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/BatchException.java&r1=659715&r2=659847&rev=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/BatchException.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/MercuryException.java
 Sat May 24 09:16:51 2008
@@ -39,24 +39,24 @@
  * Exception that occurs whilst deploying or retrieving files
  * asynchronously.
  */
-public class BatchException
+public class MercuryException
     extends Exception
 {
     private Binding binding;
 
-    public BatchException( Binding b, String s )
+    public MercuryException( Binding b, String s )
     {
         super( s );
         binding = b;
     }
 
-    public BatchException( Binding b, String s, Throwable throwable )
+    public MercuryException( Binding b, String s, Throwable throwable )
     {
         super( s, throwable );
         binding = b;
     }
 
-    public BatchException( Binding b, Throwable throwable )
+    public MercuryException( Binding b, Throwable throwable )
     {
         super( throwable );
         binding = b;

Propchange: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/MercuryException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/MercuryException.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/MercuryException.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployResponse.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployResponse.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployResponse.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployResponse.java
 Sat May 24 09:16:51 2008
@@ -23,22 +23,22 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 
 public class DefaultDeployResponse implements DeployResponse
 {
-    private Set<BatchException> _exceptions = Collections.synchronizedSet( new 
HashSet<BatchException>() );
+    private Set<MercuryException> _exceptions = Collections.synchronizedSet( 
new HashSet<MercuryException>() );
 
     public DefaultDeployResponse()
     {
     }
 
-    public void add( BatchException e )
+    public void add( MercuryException e )
     {
         _exceptions.add( e );
     }
 
-    public Set<BatchException> getExceptions()
+    public Set<MercuryException> getExceptions()
     {
         return _exceptions;
     }

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployer.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployer.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployer.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DefaultDeployer.java
 Sat May 24 09:16:51 2008
@@ -19,7 +19,7 @@
 
 package org.apache.maven.mercury.client.deploy;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 import org.apache.maven.mercury.client.Binding;
 import org.apache.maven.mercury.client.FileExchange;
 import org.apache.maven.mercury.client.HandshakeExchange;
@@ -46,7 +46,7 @@
 
 
     public DefaultDeployer()
-        throws BatchException
+        throws MercuryException
     {
         _idGenerator = new RandomBatchIdGenerator();
         _httpClient = new HttpClient();
@@ -57,17 +57,17 @@
         }
         catch ( Exception e )
         {
-            throw new BatchException( null, "unable to start http client", e );
+            throw new MercuryException( null, "unable to start http client", e 
);
         }
     }
 
     public DefaultDeployer( HttpClient client, BatchIdGenerator idGenerator )
-        throws BatchException
+        throws MercuryException
     {
         _idGenerator = idGenerator;
         if ( _idGenerator == null )
         {
-            throw new BatchException( null, "no id generator supplied" );
+            throw new MercuryException( null, "no id generator supplied" );
         }
 
         _httpClient = client;
@@ -80,7 +80,7 @@
         }
         catch ( Exception e )
         {
-            throw new BatchException( null, "unable to start http client", e );
+            throw new MercuryException( null, "unable to start http client", e 
);
         }
     }
 
@@ -179,7 +179,7 @@
                         checkComplete( callback, batchId, count, request, 
response, remoteHandshakeUrls );
                     }
 
-                    public void onError( BatchException exception )
+                    public void onError( MercuryException exception )
                     {
                         if ( getRemoteJettyUrl() != null )
                         {
@@ -193,7 +193,7 @@
             }
             catch ( Exception e )
             {
-                response.add( new BatchException( binding, e ) );
+                response.add( new MercuryException( binding, e ) );
                 checkComplete( callback, batchId, count, request, response, 
remoteHandshakeUrls );
             }
         }
@@ -264,7 +264,7 @@
 
                     public void onHandshakeError( String url, Exception e )
                     {
-                        response.getExceptions().add( new BatchException( 
null, e ) );
+                        response.getExceptions().add( new MercuryException( 
null, e ) );
                         checkHandshakeComplete( callback, response, count );
                     }
                 };

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeployResponse.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeployResponse.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeployResponse.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeployResponse.java
 Sat May 24 09:16:51 2008
@@ -21,7 +21,7 @@
 
 import java.util.Set;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 
 /**
  * DeployResponse
@@ -38,5 +38,5 @@
      *
      * @return
      */
-    public Set<BatchException> getExceptions();
+    public Set<MercuryException> getExceptions();
 }

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeploymentTarget.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeploymentTarget.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeploymentTarget.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/DeploymentTarget.java
 Sat May 24 09:16:51 2008
@@ -19,7 +19,7 @@
 
 package org.apache.maven.mercury.client.deploy;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 import org.apache.maven.mercury.client.Binding;
 import org.apache.maven.mercury.validate.Validator;
 import org.mortbay.jetty.client.HttpClient;
@@ -42,13 +42,13 @@
     private String _calculatedChecksum;
     private TargetState _targetState;
     private TargetState _checksumState;
-    private BatchException _exception;
+    private MercuryException _exception;
     private String _remoteJettyUrl;
 
 
     public abstract void onComplete();
 
-    public abstract void onError( BatchException exception );
+    public abstract void onError( MercuryException exception );
 
 
     public class TargetState
@@ -143,7 +143,7 @@
     {
         if ( t != null && _exception == null )
         {
-            _exception = ( t instanceof BatchException ? (BatchException) t : 
new BatchException( _binding, t ) );
+            _exception = ( t instanceof MercuryException ? (MercuryException) 
t : new MercuryException( _binding, t ) );
         }
 
         //if the target file can be fetched then get it

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/FilePutExchange.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/FilePutExchange.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/FilePutExchange.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/deploy/FilePutExchange.java
 Sat May 24 09:16:51 2008
@@ -19,7 +19,7 @@
 
 package org.apache.maven.mercury.client.deploy;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 import org.apache.maven.mercury.client.Binding;
 import org.apache.maven.mercury.client.ChecksumCalculator;
 import org.apache.maven.mercury.client.FileExchange;
@@ -116,13 +116,13 @@
         {
             if ( _status != HttpServletResponse.SC_OK && _status != 
HttpServletResponse.SC_CREATED && _status != HttpServletResponse.SC_NO_CONTENT )
             {
-                onFileError( _url, new BatchException( _binding, "Http status 
code=" + _status ) );
+                onFileError( _url, new MercuryException( _binding, "Http 
status code=" + _status ) );
                 return;
             }
 
             if ( _remoteBatchId != null && !_batchId.equals( _remoteBatchId ) )
             {
-                onFileError( _url, new BatchException( _binding,
+                onFileError( _url, new MercuryException( _binding,
                     "Non matching mercury ids. Sent=" + _batchId + " 
received=" + _remoteBatchId ) );
                 return;
             }
@@ -136,7 +136,7 @@
         }
         catch ( Exception e )
         {
-            onFileError( _url, new BatchException( _binding, 
e.getLocalizedMessage() ) );
+            onFileError( _url, new MercuryException( _binding, 
e.getLocalizedMessage() ) );
         }
     }
 

Copied: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalRequest.java
 (from r659715, 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/RetrievalRequestImpl.java)
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalRequest.java?p2=maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalRequest.java&p1=maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/RetrievalRequestImpl.java&r1=659715&r2=659847&rev=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/RetrievalRequestImpl.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalRequest.java
 Sat May 24 09:16:51 2008
@@ -17,16 +17,15 @@
  * under the License.
  */
 
-package org.apache.maven.mercury.client;
+package org.apache.maven.mercury.client.retrieve;
 
 import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.maven.mercury.client.Binding;
-import org.apache.maven.mercury.client.retrieve.RetrievalRequest;
 import org.apache.maven.mercury.validate.Validator;
 
-public class RetrievalRequestImpl implements RetrievalRequest
+public class DefaultRetrievalRequest implements RetrievalRequest
 {
     private boolean _isFailFast;
     private Set<Binding> _bindings;
@@ -42,6 +41,18 @@
         return _isFailFast;
     }
     
+    public RetrievalRequest addBinding( Binding binding )
+    {
+        if ( _bindings == null )
+        {
+            _bindings = new HashSet<Binding>();
+        }
+        
+        _bindings.add( binding );
+        
+        return this;
+    }
+    
     public void setBindings(Set<Binding> bindings)
     {
         _bindings = new HashSet<Binding>(bindings);

Propchange: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalRequest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalRequest.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalResponse.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalResponse.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalResponse.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetrievalResponse.java
 Sat May 24 09:16:51 2008
@@ -23,22 +23,22 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 
 public class DefaultRetrievalResponse implements RetrievalResponse
 {
-    private Set<BatchException> _exceptions = Collections.synchronizedSet( new 
HashSet<BatchException>() );
+    private Set<MercuryException> _exceptions = Collections.synchronizedSet( 
new HashSet<MercuryException>() );
 
     public DefaultRetrievalResponse()
     {
     }
 
-    protected void add( BatchException exception )
+    protected void add( MercuryException exception )
     {
         _exceptions.add( exception );
     }
 
-    public Set<BatchException> getExceptions()
+    public Set<MercuryException> getExceptions()
     {
         return _exceptions;
     }
@@ -47,5 +47,10 @@
     {
         return _exceptions.toString();
     }
+    
+    public boolean hasExceptions()
+    {
+        return _exceptions != null;
+    }
 
 }

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetriever.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetriever.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetriever.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/DefaultRetriever.java
 Sat May 24 09:16:51 2008
@@ -17,22 +17,9 @@
  * under the License.
  */
 
-// ========================================================================
-// Copyright 2008 Sonatype Inc.
-// ------------------------------------------------------------------------
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
 package org.apache.maven.mercury.client.retrieve;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 import org.apache.maven.mercury.client.Binding;
 import org.mortbay.jetty.client.HttpClient;
 
@@ -40,29 +27,30 @@
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
-
 public class DefaultRetriever implements Retriever
 {
     private HttpClient _httpClient;
 
     public DefaultRetriever()
-        throws BatchException
+        throws MercuryException
     {
         // TODO take the default settings for now
         _httpClient = new HttpClient();
         _httpClient.setConnectorType( HttpClient.CONNECTOR_SELECT_CHANNEL );
         try
         {
+            //TODOJ: What are all the reasons that the httpclient couldn't 
start up correctly?
+            
             _httpClient.start();
         }
         catch ( Exception e )
         {
-            throw new BatchException( null, "unable to start http client", e );
+            throw new MercuryException( null, "Unable to start http client.", 
e );
         }
     }
 
     public DefaultRetriever( HttpClient client )
-        throws BatchException
+        throws MercuryException
     {
         // TODO take the default settings for now
         _httpClient = client;
@@ -75,7 +63,7 @@
         }
         catch ( Exception e )
         {
-            throw new BatchException( null, "unable to start http client", e );
+            throw new MercuryException( null, "unable to start http client", e 
);
         }
     }
 
@@ -165,7 +153,7 @@
                         boolean checksumOK = verifyChecksum();
                         if ( !checksumOK )
                         {
-                            response.add( new BatchException( binding,
+                            response.add( new MercuryException( binding,
                                 "Checksum failed: " + getRetrievedChecksum() + 
"!=" + getCalculatedChecksum() ) );
                         }
 
@@ -177,7 +165,7 @@
                             {
                                 for ( String s : validateErrors )
                                 {
-                                    response.add( new BatchException( binding, 
s ) );
+                                    response.add( new MercuryException( 
binding, s ) );
                                 }
                             }
                         }
@@ -188,7 +176,7 @@
                         }
                     }
 
-                    public void onError( BatchException exception )
+                    public void onError( MercuryException exception )
                     {
                         response.add( exception );
                         if ( DefaultRetriever.this.isComplete( count, request, 
response, targets ) )
@@ -202,7 +190,7 @@
             }
             catch ( Exception e )
             {
-                response.add( new BatchException( binding, e ) );
+                response.add( new MercuryException( binding, e ) );
                 if ( isComplete( count, request, response, targets ) )
                 {
                     callback.onComplete( response );

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/FileGetExchange.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/FileGetExchange.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/FileGetExchange.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/FileGetExchange.java
 Sat May 24 09:16:51 2008
@@ -19,7 +19,7 @@
 
 package org.apache.maven.mercury.client.retrieve;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 import org.apache.maven.mercury.client.Binding;
 import org.apache.maven.mercury.client.ChecksumCalculator;
 import org.apache.maven.mercury.client.FileExchange;
@@ -100,7 +100,7 @@
         }
         catch ( Exception e )
         {
-            onFileError( _url, new BatchException( _binding, 
e.getLocalizedMessage() ) );
+            onFileError( _url, new MercuryException( _binding, 
e.getLocalizedMessage() ) );
         }
     }
 

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalRequest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalRequest.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalRequest.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalRequest.java
 Sat May 24 09:16:51 2008
@@ -32,10 +32,10 @@
  * and a set of validators to apply to them.
  */
 public interface RetrievalRequest
-{
-    public abstract Set<Binding> getBindings();
+{    
+    Set<Binding> getBindings();
 
-    public abstract boolean isFailFast();
+    boolean isFailFast();
     
-    public Set<Validator> getValidators();
+    Set<Validator> getValidators();
 }

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalResponse.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalResponse.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalResponse.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalResponse.java
 Sat May 24 09:16:51 2008
@@ -21,7 +21,7 @@
 
 import java.util.Set;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 
 
 /**
@@ -38,5 +38,7 @@
      *
      * @return
      */
-    Set<BatchException> getExceptions();
+    Set<MercuryException> getExceptions();
+    
+    boolean hasExceptions();
 }

Modified: 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalTarget.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalTarget.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalTarget.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/main/java/org/apache/maven/mercury/client/retrieve/RetrievalTarget.java
 Sat May 24 09:16:51 2008
@@ -19,7 +19,7 @@
 
 package org.apache.maven.mercury.client.retrieve;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 import org.apache.maven.mercury.client.Binding;
 import org.apache.maven.mercury.client.FileExchange;
 import org.apache.maven.mercury.validate.Validator;
@@ -51,8 +51,8 @@
 
     private int _checksumState;
     private int _targetState;
-
-    private BatchException _exception;
+    
+    private MercuryException _exception;
     private Binding _binding;
     private File _tempFile;
     private String _checksumUrl;
@@ -65,7 +65,7 @@
 
     public abstract void onComplete();
 
-    public abstract void onError( BatchException exception );
+    public abstract void onError( MercuryException exception );
 
 
     /**
@@ -89,11 +89,11 @@
         _tempFile.deleteOnExit();
         if ( _tempFile.exists() )
         {
-            onError( new BatchException( binding, "File exists " + 
_tempFile.getAbsolutePath() ) );
+            onError( new MercuryException( binding, "File exists " + 
_tempFile.getAbsolutePath() ) );
         }
         else if ( !_tempFile.getParentFile().canWrite() )
         {
-            onError( new BatchException( binding,
+            onError( new MercuryException( binding,
                 "Unable to write to dir " + 
_tempFile.getParentFile().getAbsolutePath() ) );
         }
     }
@@ -217,13 +217,13 @@
         _checksumState = state;
         if ( _exception == null && ex != null )
         {
-            if ( ex instanceof BatchException )
+            if ( ex instanceof MercuryException )
             {
-                _exception = (BatchException) ex;
+                _exception = (MercuryException) ex;
             }
             else
             {
-                _exception = new BatchException( _binding, ex );
+                _exception = new MercuryException( _binding, ex );
             }
         }
 
@@ -252,13 +252,13 @@
         _targetState = state;
         if ( _exception == null && ex != null )
         {
-            if ( ex instanceof BatchException )
+            if ( ex instanceof MercuryException )
             {
-                _exception = (BatchException) ex;
+                _exception = (MercuryException) ex;
             }
             else
             {
-                _exception = new BatchException( _binding, ex );
+                _exception = new MercuryException( _binding, ex );
             }
         }
 

Modified: 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyDeployerTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyDeployerTest.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyDeployerTest.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyDeployerTest.java
 Sat May 24 09:16:51 2008
@@ -21,7 +21,7 @@
 
 import junit.framework.TestCase;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 import org.apache.maven.mercury.client.Binding;
 import org.apache.maven.mercury.client.deploy.DeployRequest;
 import org.apache.maven.mercury.client.deploy.DeployResponse;
@@ -157,7 +157,7 @@
         
         DeployResponse response = _deployer.deploy(request);
 
-        for (BatchException t:response.getExceptions())
+        for (MercuryException t:response.getExceptions())
             t.printStackTrace();
         
         assertEquals(0, response.getExceptions().size());

Modified: 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyRetrieverTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyRetrieverTest.java?rev=659847&r1=659846&r2=659847&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyRetrieverTest.java
 (original)
+++ 
maven/sandbox/trunk/mercury/src/test/java/org/apache/maven/mercury/client/JettyRetrieverTest.java
 Sat May 24 09:16:51 2008
@@ -21,9 +21,10 @@
 
 import junit.framework.TestCase;
 
-import org.apache.maven.mercury.client.BatchException;
+import org.apache.maven.mercury.client.MercuryException;
 import org.apache.maven.mercury.client.Binding;
 import org.apache.maven.mercury.client.retrieve.DefaultRetriever;
+import org.apache.maven.mercury.client.retrieve.DefaultRetrievalRequest;
 import org.apache.maven.mercury.client.retrieve.RetrievalResponse;
 import org.apache.maven.mercury.server.SimpleTestServer;
 import org.apache.maven.mercury.validate.Validator;
@@ -133,7 +134,7 @@
     {
         //make local dir to put stuff in
         final File dir = mkTempDir();
-        RetrievalRequestImpl request = new RetrievalRequestImpl();
+        DefaultRetrievalRequest request = new DefaultRetrievalRequest();
         HashSet<Binding> bindings = new HashSet<Binding>();
 
         file0 = new File(dir, "file0.txt");
@@ -189,7 +190,7 @@
     {
         //make local dir to put stuff in
         final File dir = mkTempDir();
-        RetrievalRequestImpl request = new RetrievalRequestImpl();
+        DefaultRetrievalRequest request = new DefaultRetrievalRequest();
         HashSet<Binding> bindings = new HashSet<Binding>();
 
         file0 = new File(dir, "file0.txt");
@@ -225,7 +226,7 @@
         bindings.add(binding5);
 
 
-        request = new RetrievalRequestImpl();
+        request = new DefaultRetrievalRequest();
         request.setBindings(bindings);
         request.setFailFast(true);
 
@@ -251,7 +252,7 @@
     {
         //make local dir to put stuff in
         final File dir = mkTempDir();
-        RetrievalRequestImpl request = new RetrievalRequestImpl();
+        DefaultRetrievalRequest request = new DefaultRetrievalRequest();
         HashSet<Binding> bindings = new HashSet<Binding>();
 
         file0 = new File(dir, "file0.txt");
@@ -305,7 +306,7 @@
     {
         //make local dir to put stuff in
         final File dir = mkTempDir();
-        RetrievalRequestImpl request = new RetrievalRequestImpl();
+        DefaultRetrievalRequest request = new DefaultRetrievalRequest();
         HashSet<Binding> bindings = new HashSet<Binding>();
 
         file0 = new File(dir, "file0.txt");
@@ -339,7 +340,7 @@
         request.setFailFast(false);
         RetrievalResponse response = retriever.retrieve(request);
 
-        for (BatchException t:response.getExceptions())
+        for (MercuryException t:response.getExceptions())
             t.printStackTrace();
 
         assertEquals(0,response.getExceptions().size());
@@ -356,7 +357,7 @@
     {
             //make local dir to put stuff in
             final File dir = mkTempDir();
-            RetrievalRequestImpl request = new RetrievalRequestImpl();
+            DefaultRetrievalRequest request = new DefaultRetrievalRequest();
             HashSet<Binding> bindings = new HashSet<Binding>();
             HashSet<Validator> validators = new HashSet<Validator>();
             validators.add(new TxtValidator());
@@ -410,7 +411,7 @@
     {
         //make local dir to put stuff in
         final File dir = mkTempDir();
-        RetrievalRequestImpl request = new RetrievalRequestImpl();
+        DefaultRetrievalRequest request = new DefaultRetrievalRequest();
         HashSet<Binding> bindings = new HashSet<Binding>();
         HashSet<Validator> validators = new HashSet<Validator>();
         validators.add(new AlwaysFalseTxtValidator());


Reply via email to