Author: olamy
Date: Wed Oct 24 19:50:33 2012
New Revision: 1401844

URL: http://svn.apache.org/viewvc?rev=1401844&view=rev
Log:
transform this interface to use a bean request will ease future enhancements: 
add the bean request

Added:
    
archiva/trunk/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
   (with props)

Added: 
archiva/trunk/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java?rev=1401844&view=auto
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
 (added)
+++ 
archiva/trunk/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
 Wed Oct 24 19:50:33 2012
@@ -0,0 +1,102 @@
+package org.apache.archiva.proxy.common;
+/*
+ * 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.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M4
+ */
+public class WagonFactoryRequest
+{
+    /**
+     * the protocol to find the Wagon for, which must be prefixed with 
<code>wagon#</code>, for example
+     * <code>wagon#http</code>. <b>to have a wagon supporting ntlm add 
-ntlm</b>
+     */
+    private String protocol;
+
+    private Map<String, String> headers = new HashMap<String, String>();
+
+    private String userAgent = "Java-Archiva";
+
+    public WagonFactoryRequest()
+    {
+        // no op
+    }
+
+    public WagonFactoryRequest( String protocol, Map<String, String> headers )
+    {
+        this.protocol = protocol;
+        this.headers = headers;
+    }
+
+    public String getProtocol()
+    {
+        return protocol;
+    }
+
+    public void setProtocol( String protocol )
+    {
+        this.protocol = protocol;
+    }
+
+    public WagonFactoryRequest protocol( String protocol )
+    {
+        this.protocol = protocol;
+        return this;
+    }
+
+    public Map<String, String> getHeaders()
+    {
+        if ( this.headers == null )
+        {
+            this.headers = new HashMap<String, String>();
+        }
+        return headers;
+    }
+
+    public void setHeaders( Map<String, String> headers )
+    {
+        this.headers = headers;
+    }
+
+    public WagonFactoryRequest headers( Map<String, String> headers )
+    {
+        this.headers = headers;
+        return this;
+    }
+
+    public String getUserAgent()
+    {
+        return userAgent;
+    }
+
+    public void setUserAgent( String userAgent )
+    {
+        this.userAgent = userAgent;
+    }
+
+    public WagonFactoryRequest userAgent( String userAgent )
+    {
+        this.userAgent = userAgent;
+        return this;
+    }
+}

Propchange: 
archiva/trunk/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
archiva/trunk/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision


Reply via email to