From 9d345b6c945cbffa3ed35f3e0420ae9c661dcf6d Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Mon, 3 Nov 2008 22:23:23 +0000 Subject: [MRM-206] -added search + test cases in web services git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@710189 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-xmlrpc/archiva-xmlrpc-api/pom.xml | 4 + .../archiva/web/xmlrpc/api/SearchService.java | 30 +++++ .../archiva/web/xmlrpc/api/beans/Artifact.java | 124 +++++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/Artifact.java (limited to 'archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api') diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml index ac145568f..8dc30b5d3 100644 --- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml +++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml @@ -32,6 +32,10 @@ archiva-xmlrpc-api Archiva Web :: XML-RPC API + + org.apache.archiva + archiva-indexer + com.atlassian.xmlrpc atlassian-xmlrpc-binder-annotations diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/SearchService.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/SearchService.java index cbc47547f..d820be458 100644 --- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/SearchService.java +++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/SearchService.java @@ -19,10 +19,40 @@ package org.apache.archiva.web.xmlrpc.api; * under the License. */ +import java.util.Date; +import java.util.List; + +import org.apache.archiva.web.xmlrpc.api.beans.Artifact; import com.atlassian.xmlrpc.ServiceObject; @ServiceObject("Search") public interface SearchService { + /* + * quick/general text search which returns a list of artifacts + * query for an artifact based on a checksum + * query for all available versions of an artifact, sorted in version significance order + * query for all available versions of an artifact since a given date + * query for an artifact's direct dependencies + * query for an artifact's dependency tree (as with mvn dependency:tree - no duplicates should be included) + * query for all artifacts that depend on a given artifact + */ + + public List quickSearch( String queryString ) + throws Exception; + + public List getArtifactByChecksum( String checksum) throws Exception; + + public List getArtifactVersions( String groupId, String artifactId ) throws Exception; + + public List getArtifactVersionsByDate( String groupId, String artifactId, String version, Date whenGathered ) + throws Exception; + public List getDirectDependencies( String repositoryId, String groupId, String artifactId, String version ) + throws Exception; + + public List getDependencyTree( String groupId, String artifactId, String version ) throws Exception; + + public List getDependees( String groupId, String artifactId, String version ) + throws Exception; } diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/Artifact.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/Artifact.java new file mode 100644 index 000000000..bc553e3cd --- /dev/null +++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/Artifact.java @@ -0,0 +1,124 @@ +package org.apache.archiva.web.xmlrpc.api.beans; + +/* + * 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.io.Serializable; +import java.util.Date; + +import com.atlassian.xmlrpc.ServiceBean; +import com.atlassian.xmlrpc.ServiceBeanField; + +@ServiceBean +public class Artifact + implements Serializable +{ + private String repositoryId; + + private String groupId; + + private String artifactId; + + private String version; + + private String type; + + private Date whenGathered; + + public Artifact() + { + + } + + public Artifact( String repositoryId, String groupId, String artifactId, String version, + String type, Date whenGathered ) + { + this.repositoryId = repositoryId; + this.groupId = groupId; + this.artifactId = artifactId; + this.version = version; + this.type = type; + this.whenGathered = whenGathered; + } + + public String getGroupId() + { + return groupId; + } + + public String getArtifactId() + { + return artifactId; + } + + public String getVersion() + { + return version; + } + + public String getType() + { + return type; + } + + public Date getWhenGathered() + { + return whenGathered; + } + + @ServiceBeanField( "groupId" ) + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + @ServiceBeanField( "artifactId" ) + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + @ServiceBeanField( "version" ) + public void setVersion( String version ) + { + this.version = version; + } + + @ServiceBeanField( "type" ) + public void setType( String type ) + { + this.type = type; + } + + @ServiceBeanField( "whenGathered" ) + public void setWhenGathered( Date whenGathered ) + { + this.whenGathered = whenGathered; + } + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } +} -- cgit v1.2.3