[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
This commit is contained in:
Olivier Lamy 2011-09-02 15:54:35 +00:00
parent ac051c8acd
commit 472c72d85c
3 changed files with 64 additions and 7 deletions

View File

@ -32,28 +32,88 @@ public class RemoteRepository
implements Serializable implements Serializable
{ {
private String location; private String url;
private String userName;
private String password;
private int timeout = 60;
public RemoteRepository() public RemoteRepository()
{ {
// no op // 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 ); 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 @Override
public String toString() public String toString()
{ {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
sb.append( "RemoteRepository" ); 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( '}' );
sb.append( super.toString() ); sb.append( super.toString() );
return sb.toString(); return sb.toString();
} }
} }

View File

@ -41,7 +41,6 @@ public interface RemoteRepositoryAdmin
Boolean addRemoteRepository( RemoteRepository remoteRepository ) Boolean addRemoteRepository( RemoteRepository remoteRepository )
throws RepositoryAdminException; throws RepositoryAdminException;
Boolean updateRemoteRepository( RemoteRepository remoteRepository ) Boolean updateRemoteRepository( RemoteRepository remoteRepository )
throws RepositoryAdminException; throws RepositoryAdminException;
} }

View File

@ -34,8 +34,6 @@ import java.io.IOException;
* AddRemoteRepositoryAction * AddRemoteRepositoryAction
* *
* @version $Id$ * @version $Id$
* <p/>
* plexus.component role="com.opensymphony.xwork2.Action" role-hint="addRemoteRepositoryAction" instantiation-strategy="per-lookup"
*/ */
@Controller( "addRemoteRepositoryAction" ) @Controller( "addRemoteRepositoryAction" )
@Scope( "prototype" ) @Scope( "prototype" )