From 472c72d85c2666b0f2ad64c61e434d6c9bb48c6a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 2 Sep 2011 15:54:35 +0000 Subject: [PATCH] [MRM-1506] api to configure RemoteRepository : implement get methods git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1164590 13f79535-47bb-0310-9956-ffa450edef68 --- .../repository/remote/RemoteRepository.java | 68 +++++++++++++++++-- .../remote/RemoteRepositoryAdmin.java | 1 - .../AddRemoteRepositoryAction.java | 2 - 3 files changed, 64 insertions(+), 7 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java index 156ca0047..db9f965d7 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java @@ -32,28 +32,88 @@ public class RemoteRepository implements Serializable { - private String location; + private String url; + + private String userName; + + private String password; + + private int timeout = 60; public RemoteRepository() { // no op } - public RemoteRepository( String id, String name, String location, String layout ) + public RemoteRepository( String id, String name, String url, String layout ) { super( id, name, layout ); - this.location = location; + this.url = url; } + public RemoteRepository( String id, String name, String url, String layout, String userName, String password, + int timeOut ) + { + super( id, name, layout ); + this.url = url; + this.userName = userName; + this.password = password; + this.timeout = timeOut; + } + + public String getUrl() + { + return url; + } + + public void setUrl( String url ) + { + this.url = url; + } + + public String getUserName() + { + return userName; + } + + public void setUserName( String userName ) + { + this.userName = userName; + } + + public String getPassword() + { + return password; + } + + public void setPassword( String password ) + { + this.password = password; + } + + public int getTimeout() + { + return timeout; + } + + public void setTimeout( int timeout ) + { + this.timeout = timeout; + } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append( "RemoteRepository" ); - sb.append( "{location='" ).append( location ).append( '\'' ); + sb.append( "{url='" ).append( url ).append( '\'' ); + sb.append( ", userName='" ).append( userName ).append( '\'' ); + sb.append( ", password='" ).append( password ).append( '\'' ); + sb.append( ", timeout=" ).append( timeout ); sb.append( '}' ); sb.append( super.toString() ); return sb.toString(); } + + } \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdmin.java index c29bd56dc..6a23ea9f4 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdmin.java @@ -41,7 +41,6 @@ public interface RemoteRepositoryAdmin Boolean addRemoteRepository( RemoteRepository remoteRepository ) throws RepositoryAdminException; - Boolean updateRemoteRepository( RemoteRepository remoteRepository ) throws RepositoryAdminException; } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java index 48761e1f8..7edddd031 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java @@ -34,8 +34,6 @@ import java.io.IOException; * AddRemoteRepositoryAction * * @version $Id$ - *

- * plexus.component role="com.opensymphony.xwork2.Action" role-hint="addRemoteRepositoryAction" instantiation-strategy="per-lookup" */ @Controller( "addRemoteRepositoryAction" ) @Scope( "prototype" )