From d2f2163fe7ecb3776ae89f944cc4d84d266292ec Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 15 Sep 2011 19:51:58 +0000 Subject: [PATCH] [MRM-1520] remove duplicate beans : fix for NetworkProxy git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1171242 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/rest/api/model/NetworkProxy.java | 179 ------------------ .../api/services/NetworkProxyService.java | 2 +- .../services/DefaultNetworkProxyService.java | 2 +- .../services/NetworkProxyServiceTest.java | 2 +- 4 files changed, 3 insertions(+), 182 deletions(-) delete mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/NetworkProxy.java diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/NetworkProxy.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/NetworkProxy.java deleted file mode 100644 index 0dd6543c9..000000000 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/NetworkProxy.java +++ /dev/null @@ -1,179 +0,0 @@ -package org.apache.archiva.rest.api.model; -/* - * 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 javax.xml.bind.annotation.XmlRootElement; -import java.io.Serializable; - -/** - * @author Olivier Lamy - * @since 1.4 - */ -@XmlRootElement( name = "networkProxy" ) -public class NetworkProxy - implements Serializable -{ - private String id; - - /** - * The network protocol to use with this proxy: "http", "socks-4" - * . - */ - private String protocol = "http"; - - /** - * The proxy host. - */ - private String host; - - /** - * The proxy port. - */ - private int port = 8080; - - /** - * The proxy user. - */ - private String username; - - /** - * The proxy password. - */ - private String password; - - public NetworkProxy() - { - // no op - } - - public NetworkProxy( String id, String protocol, String host, int port, String username, String password ) - { - this.id = id; - this.protocol = protocol; - this.host = host; - this.port = port; - this.username = username; - this.password = password; - } - - public String getId() - { - return id; - } - - public void setId( String id ) - { - this.id = id; - } - - public String getProtocol() - { - return protocol; - } - - public void setProtocol( String protocol ) - { - this.protocol = protocol; - } - - public String getHost() - { - return host; - } - - public void setHost( String host ) - { - this.host = host; - } - - public int getPort() - { - return port; - } - - public void setPort( int port ) - { - this.port = port; - } - - 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; - } - - @Override - public boolean equals( Object o ) - { - if ( this == o ) - { - return true; - } - if ( o == null || getClass() != o.getClass() ) - { - return false; - } - - NetworkProxy that = (NetworkProxy) o; - - if ( id != null ? !id.equals( that.id ) : that.id != null ) - { - return false; - } - - return true; - } - - @Override - public int hashCode() - { - int result = 17; - result = 37 * result + ( id != null ? id.hashCode() : 0 ); - return result; - } - - @Override - public String toString() - { - final StringBuilder sb = new StringBuilder(); - sb.append( "NetworkProxy" ); - sb.append( "{id='" ).append( id ).append( '\'' ); - sb.append( ", protocol='" ).append( protocol ).append( '\'' ); - sb.append( ", host='" ).append( host ).append( '\'' ); - sb.append( ", port=" ).append( port ); - sb.append( ", username='" ).append( username ).append( '\'' ); - sb.append( ", password='" ).append( password ).append( '\'' ); - sb.append( '}' ); - return sb.toString(); - } -} diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java index 7913cbaf4..7a01952a5 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java @@ -18,7 +18,7 @@ package org.apache.archiva.rest.api.services; * under the License. */ -import org.apache.archiva.rest.api.model.NetworkProxy; +import org.apache.archiva.admin.model.beans.NetworkProxy; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.codehaus.plexus.redback.authorization.RedbackAuthorization; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java index 262dae5bf..82aebac4c 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java @@ -20,8 +20,8 @@ package org.apache.archiva.rest.services; import net.sf.beanlib.provider.replicator.BeanReplicator; import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.beans.NetworkProxy; import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin; -import org.apache.archiva.rest.api.model.NetworkProxy; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.NetworkProxyService; import org.springframework.stereotype.Service; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/NetworkProxyServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/NetworkProxyServiceTest.java index a3d8af416..0ebcf826f 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/NetworkProxyServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/NetworkProxyServiceTest.java @@ -18,7 +18,7 @@ package org.apache.archiva.rest.services; * under the License. */ -import org.apache.archiva.rest.api.model.NetworkProxy; +import org.apache.archiva.admin.model.beans.NetworkProxy; import org.junit.Test; /**