maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joak...@apache.org
Subject svn commit: r504749 [1/3] - in /maven/wagon/trunk: ./ wagon-manager/ wagon-manager/src/ wagon-manager/src/main/ wagon-manager/src/main/java/ wagon-manager/src/main/java/org/ wagon-manager/src/main/java/org/apache/ wagon-manager/src/main/java/org/apache...
Date Thu, 08 Feb 2007 00:09:04 GMT
Author: joakime
Date: Wed Feb  7 16:08:59 2007
New Revision: 504749

URL: http://svn.apache.org/viewvc?view=rev&rev=504749
Log:
* Adding wagon-manager
* Adding WagonStatistics tracking
* Updated events to properly include Repository
* Deprecated many Wagon.connect() methods (but not all of them)
* Moved Wagon.openConnection() to AbstractWagon where it belongs
* Updated many more license headers. (should really do them all)



Added:
    maven/wagon/trunk/wagon-manager/   (with props)
    maven/wagon/trunk/wagon-manager/pom.xml   (with props)
    maven/wagon/trunk/wagon-manager/src/
    maven/wagon/trunk/wagon-manager/src/main/
    maven/wagon/trunk/wagon-manager/src/main/java/
    maven/wagon/trunk/wagon-manager/src/main/java/org/
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java   (with props)
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/Messages.java   (with props)
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryBinding.java   (with props)
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryNotFoundException.java   (with props)
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/WagonManager.java   (with props)
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/TransferStatistics.java   (with props)
    maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/WagonStatistics.java   (with props)
    maven/wagon/trunk/wagon-manager/src/main/resources/
    maven/wagon/trunk/wagon-manager/src/main/resources/org/
    maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/
    maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/maven/
    maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/maven/wagon/
    maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/maven/wagon/manager/
    maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/maven/wagon/manager/messages.properties
    maven/wagon/trunk/wagon-manager/src/test/
    maven/wagon/trunk/wagon-manager/src/test/data/
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar   (with props)
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.md5
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.sha1
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar   (with props)
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.md5
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.sha1
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar   (with props)
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.md5
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.sha1
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.md5
    maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.sha1
    maven/wagon/trunk/wagon-manager/src/test/java/
    maven/wagon/trunk/wagon-manager/src/test/java/org/
    maven/wagon/trunk/wagon-manager/src/test/java/org/apache/
    maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/
    maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/
    maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/
    maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/WagonManagerTest.java   (with props)
    maven/wagon/trunk/wagon-manager/src/test/resources/
    maven/wagon/trunk/wagon-manager/src/test/resources/org/
    maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/
    maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/
    maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/
    maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/
    maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/WagonManagerTest.xml   (with props)
    maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/servlet/
    maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/servlet/Context.java
      - copied, changed from r503909, maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/Context.java
    maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/servlet/Servlet.java
      - copied, changed from r503909, maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/Servlet.java
    maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/servlet/ServletServer.java
      - copied, changed from r503909, maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/ServletServer.java
Removed:
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/Context.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/Servlet.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/ServletServer.java
Modified:
    maven/wagon/trunk/pom.xml
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/Wagon.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEventSupport.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEventSupport.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/WagonEvent.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java
    maven/wagon/trunk/wagon-provider-api/src/test/java/org/apache/maven/wagon/WagonMock.java
    maven/wagon/trunk/wagon-provider-api/src/test/java/org/apache/maven/wagon/events/SessionEventSupportTest.java
    maven/wagon/trunk/wagon-provider-api/src/test/java/org/apache/maven/wagon/events/SessionEventTest.java
    maven/wagon/trunk/wagon-provider-api/src/test/java/org/apache/maven/wagon/events/TransferEventSupportTest.java
    maven/wagon/trunk/wagon-provider-api/src/test/java/org/apache/maven/wagon/events/TransferEventTest.java
    maven/wagon/trunk/wagon-provider-test/pom.xml
    maven/wagon/trunk/wagon-provider-test/src/main/java/org/apache/maven/wagon/WagonTestCase.java
    maven/wagon/trunk/wagon-providers/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-file/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java
    maven/wagon/trunk/wagon-providers/wagon-file/src/test/java/org/apache/maven/wagon/providers/file/FileWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-ftp/   (props changed)
    maven/wagon/trunk/wagon-providers/wagon-ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java
    maven/wagon/trunk/wagon-providers/wagon-http-lightweight/src/main/java/org/apache/maven/wagon/providers/http/LightweightHttpWagon.java
    maven/wagon/trunk/wagon-providers/wagon-http-lightweight/src/main/java/org/apache/maven/wagon/providers/http/LightweightHttpsWagon.java
    maven/wagon/trunk/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/LightweightHttpWagonGzipTest.java
    maven/wagon/trunk/wagon-providers/wagon-http/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/HttpWagon.java
    maven/wagon/trunk/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/PutInputStream.java
    maven/wagon/trunk/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonGzipTest.java
    maven/wagon/trunk/wagon-providers/wagon-ssh-common-test/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-ssh-common-test/src/main/java/org/apache/maven/wagon/providers/ssh/knownhost/KnownHostsProviderTestCase.java
    maven/wagon/trunk/wagon-providers/wagon-ssh-common/src/test/java/org/apache/maven/wagon/providers/ssh/LSParserTest.java
    maven/wagon/trunk/wagon-providers/wagon-ssh-external/src/main/java/org/apache/maven/wagon/providers/ssh/external/ScpExternalWagon.java
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagon.java
    maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagon.java
    maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/SftpWagon.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/pom.xml
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PutInputStream.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/AuthenticatedWebDavWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/PutInputStreamTest.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonGzipTest.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/resources/org/apache/maven/wagon/providers/webdav/AuthenticatedWebDavWagonTest.xml
    maven/wagon/trunk/wagon-providers/wagon-webdav/src/test/resources/org/apache/maven/wagon/providers/webdav/WebDavWagonTest.xml

Modified: maven/wagon/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/pom.xml?view=diff&rev=504749&r1=504748&r2=504749
==============================================================================
--- maven/wagon/trunk/pom.xml (original)
+++ maven/wagon/trunk/pom.xml Wed Feb  7 16:08:59 2007
@@ -131,6 +131,10 @@
             <artifactId>plexus-utils</artifactId>
           </exclusion>
           <exclusion>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-container-default</artifactId>
+          </exclusion>
+          <exclusion>
             <groupId>classworlds</groupId>
             <artifactId>classworlds</artifactId>
           </exclusion>
@@ -139,7 +143,8 @@
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-container-default</artifactId>
-        <version>1.0-alpha-8</version>
+        <version>1.0-alpha-9</version>
+        <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>

Propchange: maven/wagon/trunk/wagon-manager/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Feb  7 16:08:59 2007
@@ -0,0 +1,14 @@
+target
+*~
+.*.swp
+*.log
+*.patch
+*.diff
+*.ipr
+*.iws
+*.iml
+.classpath
+.project
+.settings
+.wtpmodules
+cobertura.ser

Added: maven/wagon/trunk/wagon-manager/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/pom.xml?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/pom.xml (added)
+++ maven/wagon/trunk/wagon-manager/pom.xml Wed Feb  7 16:08:59 2007
@@ -0,0 +1,72 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>wagon</artifactId>
+    <groupId>org.apache.maven.wagon</groupId>
+    <version>1.0-beta-3-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>wagon-manager</artifactId>
+  <name>Maven Wagon Manager</name>
+  <description>Manager tools to best utilize wagon.</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-provider-api</artifactId>
+    </dependency>
+    <!-- Add some stable wagon providers that could be considered the 'default set' -->
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-file</artifactId>
+      <version>1.0-beta-3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-ftp</artifactId>
+      <version>1.0-beta-3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-http-lightweight</artifactId>
+      <version>1.0-beta-3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-ssh</artifactId>
+      <version>1.0-beta-3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-ssh-external</artifactId>
+      <version>1.0-beta-3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-webdav</artifactId>
+      <version>1.0-beta-3-SNAPSHOT</version>
+    </dependency>
+    <!-- TEST SCOPE -->
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.webdav</groupId>
+      <artifactId>plexus-webdav-simple</artifactId>
+      <version>1.0-alpha-1-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mortbay.jetty</groupId>
+      <artifactId>jetty</artifactId>
+      <version>6.0.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
+

Propchange: maven/wagon/trunk/wagon-manager/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java (added)
+++ maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java Wed Feb  7 16:08:59 2007
@@ -0,0 +1,329 @@
+package org.apache.maven.wagon.manager;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.UnsupportedProtocolException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.events.TransferListener;
+import org.apache.maven.wagon.manager.stats.WagonStatistics;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.apache.maven.wagon.repository.Repository;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.codehaus.plexus.util.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * DefaultWagonManager 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="org.apache.maven.wagon.manager.WagonManager"
+ *   role-hint="default"
+ */
+public class DefaultWagonManager
+    extends AbstractLogEnabled
+    implements WagonManager, Initializable, Contextualizable
+{
+    /**
+     * @plexus.configuration default-value="true" 
+     */
+    private boolean interactive = true;
+
+    /**
+     * @plexus.configuration default-value="true" 
+     */
+    private boolean online = true;
+
+    /**
+     * @plexus.requirement
+     */
+    private WagonStatistics stats;
+
+    private PlexusContainer container;
+
+    private Set protocols = new HashSet();
+
+    private Map proxies = new HashMap();
+
+    private Map repositories = new HashMap();
+
+    private List listeners = new ArrayList();
+
+    public void addProxy( String protocol, ProxyInfo proxyInfo )
+    {
+        if ( StringUtils.isEmpty( protocol ) )
+        {
+            throw new IllegalArgumentException( Messages.getString( "wagon.manager.protocol.may.not.be.empty" ) ); //$NON-NLS-1$
+        }
+
+        if ( proxyInfo == null )
+        {
+            throw new IllegalArgumentException( Messages.getString( "wagon.manager.proxy.information.may.not.be.null" ) ); //$NON-NLS-1$
+        }
+
+        if ( proxies.containsKey( protocol ) )
+        {
+            getLogger().debug( Messages.getString( "wagon.manager.warn.overwrite.proxy.mapping", protocol ) ); //$NON-NLS-1$
+        }
+
+        proxies.put( protocol, proxyInfo );
+    }
+
+    public void addProxy( String protocol, String host, int port, String username, String password, String nonProxyHosts )
+    {
+        ProxyInfo proxyInfo = new ProxyInfo();
+        proxyInfo.setHost( host );
+        proxyInfo.setType( protocol );
+        proxyInfo.setPort( port );
+        proxyInfo.setNonProxyHosts( nonProxyHosts );
+        proxyInfo.setUserName( username );
+        proxyInfo.setPassword( password );
+
+        addProxy( protocol, proxyInfo );
+    }
+
+    public void addRepository( Repository repository )
+    {
+        if ( repository == null )
+        {
+            throw new IllegalArgumentException( Messages.getString( "wagon.manager.repository.object.may.not.be.null" ) ); //$NON-NLS-1$
+        }
+
+        if ( StringUtils.isEmpty( repository.getId() ) )
+        {
+            throw new IllegalArgumentException( Messages.getString( "wagon.manager.repository.id.may.not.be.empty" ) ); //$NON-NLS-1$
+        }
+
+        String id = repository.getId();
+
+        if ( repositories.containsKey( id ) )
+        {
+            getLogger().debug( Messages.getString( "wagon.manager.warn.overwrite.repository", id ) ); //$NON-NLS-1$
+        }
+
+        RepositoryBinding repoBinding = new RepositoryBinding( id, repository );
+        repositories.put( id, repoBinding );
+    }
+
+    public void addTransferListener( TransferListener listener )
+    {
+        listeners.add( listener );
+    }
+
+    public Set getProtocols()
+    {
+        return Collections.unmodifiableSet( protocols );
+    }
+
+    public Map getProxies()
+    {
+        return proxies;
+    }
+
+    public ProxyInfo getProxy( String protocol )
+    {
+        if ( StringUtils.isEmpty( protocol ) )
+        {
+            throw new IllegalArgumentException( Messages.getString( "wagon.manager.protocol.may.not.be.empty" ) ); //$NON-NLS-1$
+        }
+
+        return (ProxyInfo) proxies.get( protocol );
+    }
+
+    public Wagon getRawWagon( String protocol )
+        throws UnsupportedProtocolException
+    {
+        if ( StringUtils.isEmpty( protocol ) )
+        {
+            throw new IllegalArgumentException( Messages.getString( "wagon.manager.protocol.may.not.be.empty" ) ); //$NON-NLS-1$
+        }
+
+        if ( !protocols.contains( protocol ) )
+        {
+            throw new UnsupportedProtocolException( Messages
+                .getString( "wagon.manager.protocol.not.supported", protocol ) ); //$NON-NLS-1$
+        }
+
+        try
+        {
+            Wagon wagon = (Wagon) container.lookup( Wagon.ROLE, protocol );
+            wagon.addSessionListener( stats );
+            wagon.addTransferListener( stats );
+            wagon.setProxyInfo( getProxy( protocol ) );
+
+            return wagon;
+        }
+        catch ( ComponentLookupException e )
+        {
+            throw new UnsupportedProtocolException( "Unable to create " + protocol + " Wagon.", e );
+        }
+    }
+
+    public Map getRepositories()
+    {
+        return Collections.unmodifiableMap( repositories );
+    }
+
+    public RepositoryBinding getRepositoryBindings( String id )
+        throws RepositoryNotFoundException
+    {
+        if ( !repositories.containsKey( id ) )
+        {
+            throw new RepositoryNotFoundException( Messages.getString( "wagon.manager.repository.id.not.found", id ) ); //$NON-NLS-1$
+        }
+
+        return (RepositoryBinding) repositories.get( id );
+    }
+
+    public Wagon getWagon( RepositoryBinding repositoryBinding )
+        throws UnsupportedProtocolException
+    {
+        String protocol = repositoryBinding.getRepository().getProtocol();
+        Wagon wagon = getRawWagon( protocol );
+
+        wagon.setRepository( repositoryBinding.getRepository() );
+        wagon.setAuthenticationInfo( repositoryBinding.getAuthenticationInfo() );
+        wagon.setProxyInfo( repositoryBinding.getProxyInfo() );
+
+        return wagon;
+    }
+
+    public Wagon getWagon( String repositoryId )
+        throws UnsupportedProtocolException, RepositoryNotFoundException
+    {
+        RepositoryBinding repositoryBinding = getRepositoryBindings( repositoryId );
+        return getWagon( repositoryBinding );
+    }
+
+    public void removeRepository( RepositoryBinding repositoryBinding )
+        throws RepositoryNotFoundException
+    {
+        removeRepository( repositoryBinding.getId() );
+    }
+
+    public void removeRepository( String repoId )
+        throws RepositoryNotFoundException
+    {
+        repositories.remove( repoId );
+    }
+
+    public void removeTransferListener( TransferListener listener )
+    {
+        listeners.add( listener );
+    }
+
+    public boolean isInteractive()
+    {
+        return interactive;
+    }
+
+    public void setInteractive( boolean interactive )
+    {
+        this.interactive = interactive;
+    }
+
+    public boolean isOnline()
+    {
+        return online;
+    }
+
+    public void setOnline( boolean online )
+    {
+        this.online = online;
+    }
+
+    public void initialize()
+        throws InitializationException
+    {
+        List availableWagonProviders;
+        try
+        {
+            availableWagonProviders = container.lookupList( Wagon.ROLE );
+            Iterator it = availableWagonProviders.iterator();
+
+            while ( it.hasNext() )
+            {
+                Wagon wagon = (Wagon) it.next();
+                protocols.add( wagon.getProtocol() );
+            }
+        }
+        catch ( ComponentLookupException e )
+        {
+            throw new InitializationException( "Unable to find list of available Wagons.", e );
+        }
+    }
+
+    public WagonStatistics getStatistics()
+    {
+        return stats;
+    }
+
+    public void contextualize( Context context )
+        throws ContextException
+    {
+        container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
+    }
+
+    public void releaseWagon( Wagon wagon )
+    {
+        if ( wagon != null )
+        {
+            if ( wagon.isConnected() )
+            {
+                try
+                {
+                    wagon.disconnect();
+                }
+                catch ( ConnectionException e )
+                {
+                    getLogger().warn( "Unable to disconnect wagon (" + wagon.getClass().getName() + ")", e );
+                }
+            }
+
+            try
+            {
+                container.release( wagon );
+            }
+            catch ( ComponentLifecycleException e )
+            {
+                getLogger().warn( "Unable to release wagon (" + wagon.getClass().getName() + ")", e );
+            }
+        }
+    }
+}

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/Messages.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/Messages.java?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/Messages.java (added)
+++ maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/Messages.java Wed Feb  7 16:08:59 2007
@@ -0,0 +1,71 @@
+package org.apache.maven.wagon.manager;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * Messages 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class Messages
+{
+    private static final String BUNDLE_NAME = "org.apache.maven.wagon.manager.messages"; //$NON-NLS-1$
+
+    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
+
+    private Messages()
+    {
+    }
+
+    public static String getString( String key )
+    {
+        try
+        {
+            return RESOURCE_BUNDLE.getString( key );
+        }
+        catch ( MissingResourceException e )
+        {
+            return '!' + key + '!';
+        }
+    }
+
+    public static String getString( String key, Object arg )
+    {
+        return getString( key, new Object[] { arg } );
+    }
+
+    public static String getString( String key, Object[] args )
+    {
+        try
+        {
+            String pattern = RESOURCE_BUNDLE.getString( key );
+            return MessageFormat.format( pattern, args );
+        }
+        catch ( MissingResourceException e )
+        {
+            return '!' + key + '!';
+        }
+    }
+}

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/Messages.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/Messages.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/Messages.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryBinding.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryBinding.java?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryBinding.java (added)
+++ maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryBinding.java Wed Feb  7 16:08:59 2007
@@ -0,0 +1,86 @@
+package org.apache.maven.wagon.manager;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * 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.
+ */
+
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.apache.maven.wagon.repository.Repository;
+
+/**
+ * RepositoryBinding - maps an ID to a Repository, with optional {@link AuthenticationInfo} and {@link ProxyInfo}.
+ * 
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @todo move these into wagon-provider-api later?
+ */
+public class RepositoryBinding
+{
+    private String id;
+    private Repository repository;
+    private AuthenticationInfo authenticationInfo;
+    private ProxyInfo proxyInfo;
+    private Wagon wagon;
+    
+    public RepositoryBinding( String id, Repository repository )
+    {
+        super();
+        this.id = id;
+        this.repository = repository;
+    }
+
+    public AuthenticationInfo getAuthenticationInfo()
+    {
+        return authenticationInfo;
+    }
+
+    public void setAuthenticationInfo( AuthenticationInfo authenticationInfo )
+    {
+        this.authenticationInfo = authenticationInfo;
+    }
+
+    public ProxyInfo getProxyInfo()
+    {
+        return proxyInfo;
+    }
+
+    public void setProxyInfo( ProxyInfo proxyInfo )
+    {
+        this.proxyInfo = proxyInfo;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public Repository getRepository()
+    {
+        return repository;
+    }
+
+    public Wagon getWagon()
+    {
+        return wagon;
+    }
+
+    public void setWagon( Wagon wagon )
+    {
+        this.wagon = wagon;
+    }
+}

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryBinding.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryBinding.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryNotFoundException.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryNotFoundException.java?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryNotFoundException.java (added)
+++ maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryNotFoundException.java Wed Feb  7 16:08:59 2007
@@ -0,0 +1,52 @@
+package org.apache.maven.wagon.manager;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * RepositoryNotFoundException 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RepositoryNotFoundException
+    extends Exception
+{
+
+    public RepositoryNotFoundException()
+    {
+        /* do nothing */
+    }
+
+    public RepositoryNotFoundException( String message )
+    {
+        super( message );
+    }
+
+    public RepositoryNotFoundException( Throwable cause )
+    {
+        super( cause );
+    }
+
+    public RepositoryNotFoundException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+}

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryNotFoundException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryNotFoundException.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/RepositoryNotFoundException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/WagonManager.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/WagonManager.java?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/WagonManager.java (added)
+++ maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/WagonManager.java Wed Feb  7 16:08:59 2007
@@ -0,0 +1,222 @@
+package org.apache.maven.wagon.manager;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.wagon.UnsupportedProtocolException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.events.TransferListener;
+import org.apache.maven.wagon.manager.stats.WagonStatistics;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.apache.maven.wagon.repository.Repository;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * WagonManager 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface WagonManager
+{
+    public static final String ROLE = WagonManager.class.getName();
+
+    /**
+     * Add a Proxy to the underlying manager.
+     * 
+     * @param protocol the protocol to map the proxy to.
+     * @param proxyInfo the proxy information to store
+     * @throws UnsupportedProtocolException 
+     */
+    void addProxy( String protocol, ProxyInfo proxyInfo );
+
+    /**
+     * Add a Proxy to the underlying manager.
+     * 
+     * @param protocol the protocol to map the proxy to.
+     * @param host the hostname of the proxy.
+     * @param port the port of the proxy.
+     * @param username the optional username for the proxy.
+     * @param password the optional password for the proxy.
+     * @param nonProxyHosts the list of nonProxyHosts (comma delimited)
+     */
+    void addProxy( String protocol, String host, int port, String username, String password, String nonProxyHosts );
+
+    /**
+     * Add a TransferListener to the underlying manager.
+     * 
+     * @param listener the transfer listener to add.
+     */
+    void addTransferListener( TransferListener listener );
+
+    /**
+     * List of protocol list.
+     * 
+     * @return a list of Strings representing the available protocols.
+     */
+    Set getProtocols();
+
+    /**
+     * Get a Map of {@link ProxyInfo} objects using the protocol as the key.
+     * @return
+     */
+    Map /*<String, ProxyInfo>*/getProxies();
+
+    /**
+     * Get {@link ProxyInfo} object for specified protocol.
+     * 
+     * @param protocol
+     * @return
+     */
+    ProxyInfo getProxy( String protocol );
+
+    /**
+     * Get a Wagon provider that understands the protocol passed as argument.
+     * It doesn't configure the Wagon.
+     * 
+     * NOTE: This implementation creates a raw Wagon object, regardless of any registered Repositories.
+     *
+     * @param protocol the protocol the {@link Wagon} will handle
+     * @return the {@link Wagon} instance able to handle the protocol provided
+     * @throws UnsupportedProtocolException if there is no provider able to handle the protocol
+     */
+    Wagon getRawWagon( String protocol )
+        throws UnsupportedProtocolException;
+
+    /**
+     * Get the RepositoryBinding for the specific repository id.
+     * 
+     * @param id the repository id to get the bindings for.
+     * @return the {@link RepositoryBinding} for the id.
+     * @throws RepositoryNotFoundException
+     */
+    RepositoryBinding getRepositoryBindings( String id )
+        throws RepositoryNotFoundException;
+
+    /**
+     * Get a Wagon provider that understands the protocol defined within the specified Repository.
+     * It doesn't configure the Wagon.
+     *
+     * @param repository the {@link Repository} the {@link Wagon} will handle
+     * @return the {@link Wagon} instance able to handle the protocol provided
+     * @throws UnsupportedProtocolException if there is no provider able to handle the protocol
+     */
+    Wagon getWagon( RepositoryBinding repository )
+        throws UnsupportedProtocolException;
+
+    /**
+     * Get a Wagon provider that understands the protocol defined within the specified Repository.
+     * It doesn't configure the Wagon.
+     *
+     * @param repository the {@link Repository} the {@link Wagon} will handle
+     * @return the {@link Wagon} instance able to handle the protocol provided
+     * @throws UnsupportedProtocolException if there is no provider able to handle the protocol
+     * @throws RepositoryNotFoundException if the specified id cannot be found.
+     */
+    Wagon getWagon( String repositoryId )
+        throws UnsupportedProtocolException, RepositoryNotFoundException;
+    
+    /**
+     * Release a previously used wagon.
+     * 
+     * All tracking and statistics for this wagon are stopped.
+     * 
+     * @param wagon the wagon to release.
+     */
+    void releaseWagon(Wagon wagon);
+
+    /**
+     * Flag indicating that the interactivity of wagons.
+     *  
+     * @return true if interactive prompts are allowed, false if all transfers are non-interactive.
+     */
+    boolean isInteractive();
+
+    /**
+     * Flag indicating if the manager is online or offline.
+     * 
+     * @return true if the manager is online.
+     */
+    boolean isOnline();
+
+    /**
+     * Remove a specific TransferListener from WagonManager.
+     * 
+     * @param listener the listener to remove.
+     */
+    void removeTransferListener( TransferListener listener );
+
+    /**
+     * Flag that dictates the interactivity of the wagon providers.
+     * 
+     * True means that the wagon providers can prompt the user for input (such as usernames and passwords), false
+     * means that the wagon operation is to be non-interactive.
+     * 
+     * @param interactive true enables the interactive nature of the wagons.
+     */
+    void setInteractive( boolean interactive );
+
+    /**
+     * Flag indicating if the manager is to treat requests for Wagon implementations in a online mode or not.
+     * 
+     * @param online true enables the online nature of the wagon manager.
+     */
+    void setOnline( boolean online );
+
+    /**
+     * Add a {@link Repository} to the underlying list of Wagon Repositories that are used as wagon sources. 
+     * 
+     * @param repository the repository to add, the {@link Repository#getId()} is used as a repository key.
+     */
+    public void addRepository( Repository repository );
+
+    /**
+     * Get a Map of {@link RepositoryBinding} objects being tracked.
+     * 
+     * @return Map of {@link Repository} keys to {@link RepositoryBinding} objects.
+     */
+    public Map getRepositories();
+
+    /**
+     * Get the Statistics gathered so far.
+     * 
+     * @return the statistics gathered so far.
+     */
+    public WagonStatistics getStatistics();
+
+    /**
+     * Remove the repository from the list of repositories being tracked.
+     *  
+     * @param repositoryBinding the repository to remove.
+     * @throws RepositoryNotFoundException
+     */
+    public void removeRepository( RepositoryBinding repositoryBinding )
+        throws RepositoryNotFoundException;
+
+    /**
+     * Remove the repository from the list of repositories being tracked.
+     *  
+     * @param repoId the repository to remove.
+     * @throws RepositoryNotFoundException
+     */
+    public void removeRepository( String repoId )
+        throws RepositoryNotFoundException;
+}

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/WagonManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/WagonManager.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/WagonManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/TransferStatistics.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/TransferStatistics.java?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/TransferStatistics.java (added)
+++ maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/TransferStatistics.java Wed Feb  7 16:08:59 2007
@@ -0,0 +1,172 @@
+package org.apache.maven.wagon.manager.stats;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.wagon.Wagon;
+
+/**
+ * TransferStatistics 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class TransferStatistics
+{
+    private long bytesFetched;
+
+    private long bytesSent;
+
+    private int countFetchFailures;
+
+    private int countSendFailures;
+
+    private int countResourcesFetched;
+
+    private int countResourcesSent;
+    
+    /**
+     * Bytes that have been transferre (both sent and received).
+     * 
+     * Note: This information may not contain protocol overhead.
+     * 
+     * @return the total bytes sent and received.
+     */
+    public long getBytesTransferred()
+    {
+        return this.bytesSent + this.bytesFetched;
+    }
+
+    /**
+     * Bytes that have been fetched.
+     * 
+     * Note: This information may not contain protocol overhead.
+     * 
+     * @return the total bytes received.
+     */
+    public long getBytesFetched()
+    {
+        return this.bytesFetched;
+    }
+
+    /**
+     * Bytes that have been sent.
+     * 
+     * Note: This information may not contain protocol overhead.
+     * 
+     * @return the total bytes sent.
+     */
+    public long getBytesSent()
+    {
+        return this.bytesSent;
+    }
+
+    /**
+     * Get count of resources that have been transferred (both sent and received).
+     * 
+     * This can be viewed as a transaction count too.
+     * 
+     * @return count of resource sent and received.
+     */
+    public int getCountResourcesTransferred()
+    {
+        return this.countResourcesSent + this.countResourcesFetched;
+    }
+
+    /**
+     * Get count of resources that have been received.
+     * 
+     * This can be viewed as a transaction count too.
+     * 
+     * @return count of resource received.
+     */
+    public int getCountResourcesFetched()
+    {
+        return this.countResourcesFetched;
+    }
+
+    /**
+     * Get count of resources that have been sent.
+     * 
+     * This can be viewed as a transaction count too.
+     * 
+     * @return count of resource sent.
+     */
+    public int getCountResourcesSent()
+    {
+        return this.countResourcesSent;
+    }
+
+    /**
+     * Get count of {@link Wagon#get(String, java.io.File)} that resulted in failure.
+     * 
+     * Failure can be any of a raft of situations, including a missing resource, failure to connect, 
+     * authentication failure, or even a proxy failure.
+     * 
+     * @return count of failures.
+     */
+    public int getCountFetchFailures()
+    {
+        return this.countFetchFailures;
+    }
+
+    /**
+     * Get count of {@link Wagon#put(java.io.File, String)} and {@link Wagon#putDirectory(java.io.File, String) 
+     * requests that resulted in failure.
+     * 
+     * Failure can be any of a raft of situations, including a failure to connect, authentication failure,
+     * a required but missing resource on the server side, or even a proxy failure.
+     * 
+     * @return count of failures.
+     */
+    public int getCountSendFailures()
+    {
+        return this.countSendFailures;
+    }
+
+    public void increaseBytesFetched( long bytes )
+    {
+        this.bytesFetched += bytes;
+    }
+
+    public void increaseBytesSent( long bytes )
+    {
+        this.bytesSent += bytes;
+    }
+
+    public void increaseCountFetchFailures( int count )
+    {
+        this.countFetchFailures += count;
+    }
+
+    public void increaseCountResourcesFetched( int count )
+    {
+        this.countResourcesFetched += count;
+    }
+
+    public void increaseCountResourcesSent( int count )
+    {
+        this.countResourcesSent += count;
+    }
+
+    public void increaseCountSendFailures( int count )
+    {
+        this.countSendFailures += count;
+    }
+}

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/TransferStatistics.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/TransferStatistics.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/TransferStatistics.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/WagonStatistics.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/WagonStatistics.java?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/WagonStatistics.java (added)
+++ maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/WagonStatistics.java Wed Feb  7 16:08:59 2007
@@ -0,0 +1,262 @@
+package org.apache.maven.wagon.manager.stats;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.wagon.events.SessionEvent;
+import org.apache.maven.wagon.events.SessionListener;
+import org.apache.maven.wagon.events.TransferEvent;
+import org.apache.maven.wagon.events.TransferListener;
+import org.apache.maven.wagon.repository.Repository;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * WagonStatistics 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="org.apache.maven.wagon.manager.stats.WagonStatistics"
+ *   instantiation-strategy="per-lookup"
+ */
+public class WagonStatistics
+    extends AbstractLogEnabled
+    implements TransferListener, SessionListener
+{
+    private TransferStatistics totals = new TransferStatistics();
+
+    private Map transfersByProtocol = new HashMap();
+
+    private Map transfersByRepository = new HashMap();
+
+    /**
+     * Get the top level transfer statistics.
+     * 
+     * @return the top level transfer statistics.
+     */
+    public TransferStatistics getTotalTransferStatistics()
+    {
+        return totals;
+    }
+
+    /**
+     * Get a map of transfer statistics by protocol.
+     * 
+     * @return Map of {@link TransferStatistics} object values with {@link String} protocol keys.
+     */
+    public Map /*<String, TransferStatistics>*/getTransfersByProtocol()
+    {
+        return transfersByProtocol;
+    }
+
+    /**
+     * Get a map of transfer statistics by repository.
+     * 
+     * @return Map of {@link TransferStatistics} object values with {@link Repository}  keys.
+     */
+    public Map /*<Repository, TransferStatistics>*/getTransfersByRepository()
+    {
+        return transfersByRepository;
+    }
+
+    public void dump()
+    {
+        Iterator it;
+
+        getLogger().info( "-------------------------------------------" );
+        getLogger().info( "  Wagon Statistics " );
+        dumpTransferStats( totals, "Totals:" );
+
+        it = transfersByRepository.entrySet().iterator();
+        while ( it.hasNext() )
+        {
+            Map.Entry entry = (Entry) it.next();
+            String repoid = (String) entry.getKey();
+            TransferStatistics repostats = (TransferStatistics) entry.getValue();
+            dumpTransferStats( repostats, "Repository [" + repoid + "]:" );
+        }
+
+        getLogger().info( "-------------------------------------------" );
+    }
+
+    private void dumpTransferStats( TransferStatistics stats, String header )
+    {
+        DecimalFormat fmt = new DecimalFormat( "#,##0" );
+
+        getLogger().info( "   " + header );
+        getLogger().info( "      bytes transferred: " + fmt.format( stats.getBytesTransferred() ) );
+        getLogger().info(
+                          "      bytes sent: " + fmt.format( stats.getBytesSent() ) + " - fetched: "
+                              + fmt.format( stats.getBytesFetched() ) );
+        getLogger().info(
+                          "      resources sent: " + fmt.format( stats.getCountResourcesSent() ) + " - failures: "
+                              + fmt.format( stats.getCountSendFailures() ) );
+        getLogger().info(
+                          "      resources fetched: " + fmt.format( stats.getCountResourcesFetched() )
+                              + " - failures: " + fmt.format( stats.getCountFetchFailures() ) );
+    }
+
+    private TransferStatistics getTransferStatsByRepository( Repository repo )
+    {
+        String key = repo.getId();
+
+        TransferStatistics xferStats;
+
+        if ( !transfersByRepository.containsKey( key ) )
+        {
+            xferStats = new TransferStatistics();
+            transfersByRepository.put( key, xferStats );
+        }
+        else
+        {
+            xferStats = (TransferStatistics) transfersByRepository.get( key );
+        }
+
+        return xferStats;
+    }
+
+    public void debug( String message )
+    {
+        getLogger().debug( message );
+    }
+
+    public void transferCompleted( TransferEvent transferEvent )
+    {
+        getLogger().info( ".transferCompleted(" + transferEvent + ")" );
+        TransferStatistics repoStats = getTransferStatsByRepository( transferEvent.getRepository() );
+
+        switch ( transferEvent.getRequestType() )
+        {
+            case TransferEvent.REQUEST_GET:
+                repoStats.increaseCountResourcesFetched( 1 );
+                totals.increaseCountResourcesFetched( 1 );
+                break;
+            case TransferEvent.REQUEST_PUT:
+                repoStats.increaseCountResourcesSent( 1 );
+                totals.increaseCountResourcesSent( 1 );
+                break;
+            default:
+                getLogger().error(
+                                   "Unknown Request Type [" + transferEvent.getRequestType()
+                                       + "], unable to process statistics." );
+        }
+    }
+
+    public void transferError( TransferEvent transferEvent )
+    {
+        getLogger().info( ".transferError(" + transferEvent + ")" );
+
+        TransferStatistics repoStats = getTransferStatsByRepository( transferEvent.getRepository() );
+
+        switch ( transferEvent.getRequestType() )
+        {
+            case TransferEvent.REQUEST_GET:
+                repoStats.increaseCountFetchFailures( 1 );
+                totals.increaseCountFetchFailures( 1 );
+                break;
+            case TransferEvent.REQUEST_PUT:
+                repoStats.increaseCountSendFailures( 1 );
+                totals.increaseCountSendFailures( 1 );
+                break;
+            default:
+                getLogger().error(
+                                   "Unknown Request Type [" + transferEvent.getRequestType()
+                                       + "], unable to process statistics." );
+        }
+    }
+
+    public void transferInitiated( TransferEvent transferEvent )
+    {
+        getLogger().info( ".transferInitiated(" + transferEvent + ")" );
+    }
+
+    public void transferProgress( TransferEvent transferEvent, byte[] buffer, int length )
+    {
+        getLogger().info( ".transferProgress(" + transferEvent + ", (byte[]) buffer, " + length + ")" );
+
+        TransferStatistics repoStats = getTransferStatsByRepository( transferEvent.getRepository() );
+
+        switch ( transferEvent.getRequestType() )
+        {
+            case TransferEvent.REQUEST_GET:
+                repoStats.increaseBytesFetched( length );
+                totals.increaseBytesFetched( length );
+                break;
+            case TransferEvent.REQUEST_PUT:
+                repoStats.increaseBytesSent( length );
+                totals.increaseBytesSent( length );
+                break;
+            default:
+                getLogger().error(
+                                   "Unknown Request Type [" + transferEvent.getRequestType()
+                                       + "], unable to process statistics." );
+        }
+    }
+
+    public void transferStarted( TransferEvent transferEvent )
+    {
+        getLogger().info( ".transferStarted(" + transferEvent + ")" );
+    }
+
+    public void sessionConnectionRefused( SessionEvent sessionEvent )
+    {
+        getLogger().info( ".sessionConnectionRefused(" + sessionEvent + ")" );
+    }
+
+    public void sessionDisconnected( SessionEvent sessionEvent )
+    {
+        getLogger().info( ".sessionDisconnected(" + sessionEvent + ")" );
+    }
+
+    public void sessionDisconnecting( SessionEvent sessionEvent )
+    {
+        getLogger().info( ".sessionDisconnecting(" + sessionEvent + ")" );
+    }
+
+    public void sessionError( SessionEvent sessionEvent )
+    {
+        getLogger().info( ".sessionError(" + sessionEvent + ")" );
+    }
+
+    public void sessionLoggedIn( SessionEvent sessionEvent )
+    {
+        getLogger().info( ".sessionLoggedIn(" + sessionEvent + ")" );
+    }
+
+    public void sessionLoggedOff( SessionEvent sessionEvent )
+    {
+        getLogger().info( ".sessionLoggedOff(" + sessionEvent + ")" );
+    }
+
+    public void sessionOpened( SessionEvent sessionEvent )
+    {
+        getLogger().info( ".sessionOpened(" + sessionEvent + ")" );
+    }
+
+    public void sessionOpening( SessionEvent sessionEvent )
+    {
+        getLogger().info( ".sessionOpening(" + sessionEvent + ")" );
+    }
+}

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/WagonStatistics.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/WagonStatistics.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/main/java/org/apache/maven/wagon/manager/stats/WagonStatistics.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/maven/wagon/manager/messages.properties
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/maven/wagon/manager/messages.properties?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/maven/wagon/manager/messages.properties (added)
+++ maven/wagon/trunk/wagon-manager/src/main/resources/org/apache/maven/wagon/manager/messages.properties Wed Feb  7 16:08:59 2007
@@ -0,0 +1,8 @@
+wagon.manager.protocol.may.not.be.empty=Protocol cannot be empty.
+wagon.manager.proxy.information.may.not.be.null=Proxy information object cannot be null.
+wagon.manager.repository.object.may.not.be.null=Repository object cannot be null.
+wagon.manager.repository.id.may.not.be.empty=Repository.id cannot be empty.
+wagon.manager.protocol.not.supported=Protocol [{0}] is unsupported by the current configuration.
+wagon.manager.warn.overwrite.proxy.mapping=Proxy binding to protocol [{0}] already exists in WagonManager, overriding previous definition.
+wagon.manager.warn.overwrite.repository=Repository binding with id [{0}] already exists in WagonManager, overriding previous definition.
+wagon.manager.repository.id.not.found=Unable to find Repository [{0}].

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar?view=auto&rev=504749
==============================================================================
Binary file - no diff available.

Propchange: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.md5
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.md5?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.md5 (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.md5 Wed Feb  7 16:08:59 2007
@@ -0,0 +1 @@
+d10bcecf5cfd5a232e2c9852d87c9ff3  daytrader-streamer-2.0-SNAPSHOT-javadoc.jar

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.sha1
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.sha1?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.sha1 (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-javadoc.jar.sha1 Wed Feb  7 16:08:59 2007
@@ -0,0 +1 @@
+f6c34949c8ec5fc7605f2e5b308826952d455468  daytrader-streamer-2.0-SNAPSHOT-javadoc.jar

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar?view=auto&rev=504749
==============================================================================
Binary file - no diff available.

Propchange: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.md5
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.md5?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.md5 (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.md5 Wed Feb  7 16:08:59 2007
@@ -0,0 +1 @@
+88526652477cffde86b4fb6d3c4d9b09  daytrader-streamer-2.0-SNAPSHOT-sources.jar

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.sha1
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.sha1?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.sha1 (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT-sources.jar.sha1 Wed Feb  7 16:08:59 2007
@@ -0,0 +1 @@
+8e32bee44b3179b2534e7dae45f823cfc97985a3  daytrader-streamer-2.0-SNAPSHOT-sources.jar

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar?view=auto&rev=504749
==============================================================================
Binary file - no diff available.

Propchange: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.md5
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.md5?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.md5 (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.md5 Wed Feb  7 16:08:59 2007
@@ -0,0 +1 @@
+ffed1a6a0f9a18c940e5176c83d0bf17  daytrader-streamer-2.0-SNAPSHOT.jar

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.sha1
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.sha1?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.sha1 (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.jar.sha1 Wed Feb  7 16:08:59 2007
@@ -0,0 +1 @@
+60aacd0b5166182a133a62d8df23f6d6fc77a67c  daytrader-streamer-2.0-SNAPSHOT.jar

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom Wed Feb  7 16:08:59 2007
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <parent>
+    <artifactId>daytrader</artifactId>
+    <groupId>org.apache.geronimo.daytrader</groupId>
+    <version>2.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>daytrader-streamer</artifactId>
+  <name>DayTrader :: Quote Streamer</name>
+  <version>2.0-SNAPSHOT</version>
+  <description>Streamer Application for Day Trader</description>
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/daytrader/trunk/modules/streamer</connection>
+    <developerConnection>scm:svn:http://svn.apache.org/repos/asf/geronimo/daytrader/trunk/modules/streamer</developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/geronimo/daytrader/trunk/modules/ear</url>
+  </scm>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestEntries>
+              <class-path>dt-ejb.jar</class-path>
+            </manifestEntries>
+            <manifest>
+              <main-class>org.apache.geronimo.samples.daytrader.client.TradeClient</main-class>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.geronimo.daytrader</groupId>
+      <artifactId>daytrader-ejb</artifactId>
+      <version>2.0-SNAPSHOT</version>
+      <type>ejb</type>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-ejb_2.1_spec</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jms_1.1_spec</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jpa_3.0_spec</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openjpa</groupId>
+      <artifactId>openjpa-all</artifactId>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+  <distributionManagement>
+    <status>deployed</status>
+  </distributionManagement>
+</project>
\ No newline at end of file

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.md5
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.md5?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.md5 (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.md5 Wed Feb  7 16:08:59 2007
@@ -0,0 +1 @@
+76a04efad19db1246f31c34190f8b15d  daytrader-streamer-2.0-SNAPSHOT.pom

Added: maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.sha1
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.sha1?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.sha1 (added)
+++ maven/wagon/trunk/wagon-manager/src/test/data/daytrader-streamer-2.0-SNAPSHOT.pom.sha1 Wed Feb  7 16:08:59 2007
@@ -0,0 +1 @@
+b62855d411ae2798e4089c8260247d4aa69a0411  daytrader-streamer-2.0-SNAPSHOT.pom

Added: maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/WagonManagerTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/WagonManagerTest.java?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/WagonManagerTest.java (added)
+++ maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/WagonManagerTest.java Wed Feb  7 16:08:59 2007
@@ -0,0 +1,361 @@
+package org.apache.maven.wagon.manager;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.wagon.TransferFailedException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.manager.stats.TransferStatistics;
+import org.apache.maven.wagon.manager.stats.WagonStatistics;
+import org.apache.maven.wagon.repository.Repository;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.webdav.DavServerManager;
+import org.codehaus.plexus.webdav.servlet.basic.BasicWebDavServlet;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.Context;
+import org.mortbay.jetty.servlet.DefaultServlet;
+import org.mortbay.jetty.servlet.ServletHandler;
+import org.mortbay.jetty.servlet.ServletHolder;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Set;
+
+/**
+ * WagonManagerTest 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class WagonManagerTest
+    extends PlexusTestCase
+{
+    private static final String DAV_CONTEXT = "/dav";
+
+    private static final int DAV_PORT = 51119;
+
+    private static final int HTTP_PORT = 51117;
+
+    private File httpRootDir;
+
+    private File davRootDir;
+
+    private File localDownloadDir;
+
+    private WagonManager wagonManager;
+
+    private Server httpServer;
+
+    private Server davServer;
+
+    private File testDataDir;
+
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        httpRootDir = setupDir( "/target/test-repos/http-test-server/" );
+        davRootDir = setupDir( "/target/test-repos/dav-test-server/" );
+        localDownloadDir = setupDir( "/target/test-repos/downloads/" );
+
+        System.setProperty( "DEBUG", "" );
+        System.setProperty( "org.mortbay.log.class", "org.slf4j.impl.SimpleLogger" );
+
+        httpServer = createHttpServer();
+        davServer = createDavServer();
+
+        wagonManager = (WagonManager) lookup( WagonManager.ROLE, "default" );
+
+        testDataDir = new File( getBasedir(), "src/test/data" );
+    }
+
+    private Server createHttpServer()
+        throws Exception
+    {
+        // Setup the Jetty Server.
+
+        Server server = new Server( HTTP_PORT );
+        Context rootJettyContext = new Context( server, "/", Context.SESSIONS );
+
+        rootJettyContext.setContextPath( "/" );
+        rootJettyContext.setAttribute( PlexusConstants.PLEXUS_KEY, getContainer() );
+
+        ServletHandler servletHandler = rootJettyContext.getServletHandler();
+
+        ServletHolder holder = servletHandler.addServletWithMapping( DefaultServlet.class, "/*" );
+
+        holder.setInitParameter( "resourceBase", httpRootDir.getAbsolutePath() );
+        holder.setInitParameter( "dirAllowed", "true" );
+
+        server.start();
+
+        return server;
+    }
+
+    private Server createDavServer()
+        throws Exception
+    {
+        /* kick start the dav management on the right foot */
+        DavServerManager manager = (DavServerManager) lookup( DavServerManager.ROLE, "simple" );
+        assertNotNull( manager );
+
+        /* create the jetty server */
+        Server server = new Server( DAV_PORT );
+        Context rootJettyContext = new Context( server, "/", Context.SESSIONS );
+
+        rootJettyContext.setContextPath( "/" );
+        rootJettyContext.setAttribute( PlexusConstants.PLEXUS_KEY, getContainer() );
+
+        ServletHandler servletHandler = rootJettyContext.getServletHandler();
+
+        ServletHolder holder = servletHandler.addServletWithMapping( BasicWebDavServlet.class, DAV_CONTEXT + "/*" );
+
+        holder.setInitParameter( "dav.root", davRootDir.getAbsolutePath() );
+
+        server.start();
+
+        return server;
+    }
+
+    private File setupDir( String rootPath )
+        throws IOException
+    {
+        File rootDir = new File( getBasedir(), rootPath );
+
+        // Clean up from old tests.
+        if ( rootDir.exists() )
+        {
+            FileUtils.deleteDirectory( rootDir );
+        }
+
+        // Create dir
+        rootDir.mkdirs();
+
+        return rootDir;
+    }
+
+    protected void tearDown()
+        throws Exception
+    {
+        release( wagonManager );
+
+        if ( httpServer != null )
+        {
+            try
+            {
+                httpServer.stop();
+            }
+            catch ( Exception e )
+            {
+                /* do nothing */
+            }
+        }
+
+        if ( davServer != null )
+        {
+            try
+            {
+                davServer.stop();
+            }
+            catch ( Exception e )
+            {
+                /* do nothing */
+            }
+        }
+
+        super.tearDown();
+    }
+
+    private void assertExistInHttpServer( String path )
+    {
+        File file = new File( httpRootDir, path );
+        if ( !file.exists() )
+        {
+            fail( "Missing expected file in http server home [" + file.getAbsolutePath() + "]" );
+        }
+    }
+
+    private void assertExistInDavServer( String path )
+    {
+        File file = new File( davRootDir, path );
+        if ( !file.exists() )
+        {
+            fail( "Missing expected file in dav server home [" + file.getAbsolutePath() + "]" );
+        }
+    }
+
+    public void testSupportedProtocols()
+        throws MalformedURLException
+    {
+        Set protocols = wagonManager.getProtocols();
+        assertNotNull( protocols );
+
+        String expectedProtocols[] = new String[] { "file", "ftp", "http", "https", "scp", "scpexe", "sftp", "dav" };
+
+        assertEquals( "Supported Protocols : " + protocols, expectedProtocols.length, protocols.size() );
+    }
+
+    public void testRepositoryPut()
+        throws Exception
+    {
+        Repository testRepo = createTestRepository();
+        Repository davRepo = createDavRepository();
+
+        wagonManager.addRepository( testRepo );
+        wagonManager.addRepository( davRepo );
+
+        Wagon davWagon = wagonManager.getWagon( "davrepo" );
+        Wagon httpWagon = wagonManager.getWagon( "testrepo" );
+
+        assertNotNull( davWagon );
+        assertNotNull( httpWagon );
+
+        try
+        {
+            davWagon.connect();
+
+            String destFilename = "daytrader-streamer-2.0-SNAPSHOT.jar";
+            String destPath = "org/apache/geronimo/daytrader-streamer/2.0-SNAPSHOT/" + destFilename;
+
+            davWagon.put( new File( testDataDir, destFilename ), destPath );
+
+            assertExistInDavServer( destPath );
+        }
+        finally
+        {
+            davWagon.disconnect();
+            wagonManager.releaseWagon( davWagon );
+        }
+
+        try
+        {
+            httpWagon.connect();
+
+            String destFilename = "daytrader-streamer-2.0-SNAPSHOT.jar";
+            String destPath = "org/apache/geronimo/daytrader-streamer/2.0-SNAPSHOT/" + destFilename;
+
+            httpWagon.put( new File( testDataDir, destFilename ), destPath );
+            fail( "Should not have been able to perform a PUT on the http repository." );
+        }
+        catch ( TransferFailedException e )
+        {
+            /* expected path */
+        }
+        finally
+        {
+            httpWagon.disconnect();
+            wagonManager.releaseWagon( httpWagon );
+        }
+    }
+
+    public void testStatistics()
+        throws Exception
+    {
+        Repository testRepo = createTestRepository();
+        Repository davRepo = createDavRepository();
+
+        wagonManager.addRepository( testRepo );
+        wagonManager.addRepository( davRepo );
+
+        Wagon davWagon = wagonManager.getWagon( "davrepo" );
+        Wagon httpWagon = wagonManager.getWagon( "testrepo" );
+
+        assertNotNull( davWagon );
+        assertNotNull( httpWagon );
+
+        // Put create some put requests on the dav protocol
+
+        try
+        {
+            davWagon.connect();
+
+            String destFilename = "daytrader-streamer-2.0-SNAPSHOT.jar";
+            String destPath = "org/apache/geronimo/daytrader-streamer/2.0-SNAPSHOT/" + destFilename;
+
+            davWagon.put( new File( testDataDir, destFilename ), destPath );
+            assertExistInDavServer( destPath );
+
+            File destFile = new File( localDownloadDir, destFilename );
+
+            davWagon.get( destPath, destFile );
+        }
+        finally
+        {
+            davWagon.disconnect();
+            wagonManager.releaseWagon( davWagon );
+        }
+
+        // Lets create some get requests on the http protocol.
+
+        FileUtils.copyDirectory( testDataDir, httpRootDir );
+
+        try
+        {
+            httpWagon.connect();
+
+            String filenames[] = new String[] {
+                "daytrader-streamer-2.0-SNAPSHOT-javadoc.jar",
+                "daytrader-streamer-2.0-SNAPSHOT-sources.jar",
+                "daytrader-streamer-2.0-SNAPSHOT.pom" };
+
+            for ( int i = 0; i < filenames.length; i++ )
+            {
+                httpWagon.get( filenames[i], new File( localDownloadDir, filenames[i] ) );
+            }
+        }
+        finally
+        {
+            httpWagon.disconnect();
+            wagonManager.releaseWagon( httpWagon );
+        }
+
+        // Now lets get the statistics.
+
+        WagonStatistics wagonStats = wagonManager.getStatistics();
+        assertNotNull( "Wagon Statistics should not be null.", wagonStats );
+        
+        TransferStatistics totals = wagonStats.getTotalTransferStatistics();
+        assertNotNull( "Total Transfer Statistics should not be null.", totals );
+        
+        wagonStats.dump();
+
+        assertEquals( 4, totals.getCountResourcesFetched() );
+        assertEquals( 1, totals.getCountResourcesSent() );
+        assertEquals( 5, totals.getCountResourcesTransferred() );
+        assertEquals( 234605, totals.getBytesFetched() );
+        assertEquals( 38056, totals.getBytesSent() );
+        assertEquals( 272661, totals.getBytesTransferred() );
+    }
+
+    private Repository createDavRepository()
+    {
+        Repository repo = new Repository( "davrepo", "dav:http://localhost:" + DAV_PORT + DAV_CONTEXT + "/" );
+        return repo;
+    }
+
+    private Repository createTestRepository()
+    {
+        Repository repo = new Repository( "testrepo", "http://localhost:" + HTTP_PORT + "/" );
+        return repo;
+    }
+}

Propchange: maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/WagonManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/WagonManagerTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/test/java/org/apache/maven/wagon/manager/WagonManagerTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/WagonManagerTest.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/WagonManagerTest.xml?view=auto&rev=504749
==============================================================================
--- maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/WagonManagerTest.xml (added)
+++ maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/WagonManagerTest.xml Wed Feb  7 16:08:59 2007
@@ -0,0 +1,24 @@
+<plexus>
+  <components>
+    <component>
+      <role>org.codehaus.plexus.webdav.DavServerManager</role>
+      <role-hint>simple</role-hint>
+      <implementation>org.codehaus.plexus.webdav.DefaultDavServerManager</implementation>
+      <description>DefaultDavServerManager</description>
+      <configuration>
+        <provider-hint>simple</provider-hint>
+      </configuration>
+    </component>
+    
+    <!-- 
+    <component>
+      <role>org.codehaus.plexus.webdav.DavServerComponent</role>
+      <role-hint>simple</role-hint>
+      <implementation>org.codehaus.plexus.webdav.simple.SimpleDavServerComponent</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <description>SimpleDavServerComponent</description>
+    </component>
+       -->
+    
+  </components>
+</plexus>
\ No newline at end of file

Propchange: maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/WagonManagerTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/WagonManagerTest.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/wagon/trunk/wagon-manager/src/test/resources/org/apache/maven/wagon/manager/WagonManagerTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-commits-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-commits-help@maven.apache.org


Mime
View raw message