From: Olivier Lamy Date: Thu, 15 Sep 2011 18:17:06 +0000 (+0000) Subject: [MRM-1520] remove duplicate beans : fix for RepositoryGroup service X-Git-Tag: archiva-1.4-M1~275 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4f136bffe87db093638ea68f14108ba102082999;p=archiva.git [MRM-1520] remove duplicate beans : fix for RepositoryGroup service git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1171205 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RepositoryGroup.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RepositoryGroup.java deleted file mode 100644 index aaa908d5a..000000000 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RepositoryGroup.java +++ /dev/null @@ -1,136 +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; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Olivier Lamy - * @since 1.4 - */ -@XmlRootElement( name = "repositoryGroup" ) -public class RepositoryGroup - implements Serializable -{ - /** - * repository group Id - */ - private String id; - - /** - * repositories ids - */ - private List repositories; - - public RepositoryGroup() - { - // no op - } - - public RepositoryGroup( String id, List repositories ) - { - this.id = id; - this.repositories = repositories; - } - - /** - * Get the id of the repository group. - * - * @return String - */ - public String getId() - { - return this.id; - } - - /** - * Method getRepositories. - * - * @return List - */ - public List getRepositories() - { - if ( this.repositories == null ) - { - this.repositories = new ArrayList(); - } - - return this.repositories; - } - - - /** - * Set the id of the repository group. - * - * @param id - */ - public void setId( String id ) - { - this.id = id; - } - - /** - * Set the list of repository ids under the group. - * - * @param repositories - */ - public void setRepositories( List repositories ) - { - this.repositories = repositories; - } - - public boolean equals( Object other ) - { - if ( this == other ) - { - return true; - } - - if ( !( other instanceof RepositoryGroup ) ) - { - return false; - } - - RepositoryGroup that = (RepositoryGroup) other; - boolean result = true; - result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) ); - return result; - } - - 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( "RepositoryGroup" ); - sb.append( "{id='" ).append( id ).append( '\'' ); - sb.append( ", repositories=" ).append( repositories ); - 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/RepositoryGroupService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java index 4c20da16d..d9fd9274d 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java @@ -18,7 +18,7 @@ package org.apache.archiva.rest.api.services; * under the License. */ -import org.apache.archiva.rest.api.model.RepositoryGroup; +import org.apache.archiva.admin.model.beans.RepositoryGroup; 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/DefaultRepositoryGroupService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java index d461c7fb7..c1dd85ca1 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java @@ -19,8 +19,8 @@ package org.apache.archiva.rest.services; */ import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.beans.RepositoryGroup; import org.apache.archiva.admin.model.group.RepositoryGroupAdmin; -import org.apache.archiva.rest.api.model.RepositoryGroup; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.RepositoryGroupService; import org.apache.commons.lang.StringUtils; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java index 18f8a1a1f..c872d8268 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java @@ -19,7 +19,7 @@ package org.apache.archiva.rest.services; */ import org.apache.archiva.admin.model.beans.ManagedRepository; -import org.apache.archiva.rest.api.model.RepositoryGroup; +import org.apache.archiva.admin.model.beans.RepositoryGroup; import org.apache.archiva.rest.api.services.ManagedRepositoriesService; import org.apache.archiva.rest.api.services.RepositoryGroupService; import org.apache.cxf.jaxrs.client.WebClient;