aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api
diff options
context:
space:
mode:
authorMaria Odea B. Ching <oching@apache.org>2008-10-20 05:59:47 +0000
committerMaria Odea B. Ching <oching@apache.org>2008-10-20 05:59:47 +0000
commitc303ba78c70a220c54b0501bf5239f5870d03ad9 (patch)
tree6d95b53c96b67ccf0ddba0054080440e49d2d42b /archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api
parentc64358cfd11f1c506afcc9cc2a4df5bc4f01b69a (diff)
downloadarchiva-c303ba78c70a220c54b0501bf5239f5870d03ad9.tar.gz
archiva-c303ba78c70a220c54b0501bf5239f5870d03ad9.zip
merged MRM-124 branch (-r706118) - archiva web services
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@706126 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api')
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml40
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java115
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/SearchService.java28
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/TestService.java28
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/ManagedRepository.java152
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/RemoteRepository.java121
6 files changed, 484 insertions, 0 deletions
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
new file mode 100644
index 000000000..ac145568f
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-xmlrpc</artifactId>
+ <version>1.2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>archiva-xmlrpc-api</artifactId>
+ <name>Archiva Web :: XML-RPC API</name>
+ <dependencies>
+ <dependency>
+ <groupId>com.atlassian.xmlrpc</groupId>
+ <artifactId>atlassian-xmlrpc-binder-annotations</artifactId>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java
new file mode 100644
index 000000000..814933446
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java
@@ -0,0 +1,115 @@
+package org.apache.archiva.web.xmlrpc.api;
+
+/*
+ * 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.util.List;
+
+import org.apache.archiva.web.xmlrpc.api.beans.ManagedRepository;
+import org.apache.archiva.web.xmlrpc.api.beans.RemoteRepository;
+
+import com.atlassian.xmlrpc.ServiceObject;
+
+@ServiceObject( "AdministrationService" )
+public interface AdministrationService
+{
+ /**
+ * Executes repository scanner on the given repository.
+ *
+ * @param repoId id of the repository to be scanned
+ * @return
+ * @throws Exception
+ */
+ public Boolean executeRepositoryScanner( String repoId ) throws Exception;
+
+ /**
+ * Executes the database scanner.
+ *
+ * @return
+ * @throws Exception
+ */
+ public Boolean executeDatabaseScanner() throws Exception;
+
+ /**
+ * Gets all available database consumers.
+ * @return
+ */
+ public List<String> getAllDatabaseConsumers();
+
+ /**
+ * Configures (enable or disable) database consumer.
+ *
+ * @param consumerId id of the database consumer
+ * @param enable flag whether to enable or disable the specified consumer
+ * @return
+ * @throws Exception
+ */
+ public Boolean configureDatabaseConsumer( String consumerId, boolean enable ) throws Exception;
+
+ /**
+ * Gets all available repository consumers.
+ *
+ * @return
+ */
+ public List<String> getAllRepositoryConsumers();
+
+ // TODO should we already implement config of consumers per repository?
+ /**
+ * Configures (enable or disable) repository consumer.
+ *
+ * @param repoId
+ * @param consumerId
+ * @param enable
+ * @return
+ * @throws Exception
+ */
+ public Boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable ) throws Exception;
+
+ /**
+ * Gets all managed repositories.
+ *
+ * @return
+ */
+ public List<ManagedRepository> getAllManagedRepositories();
+
+ /**
+ * Gets all remote repositories.
+ *
+ * @return
+ */
+ public List<RemoteRepository> getAllRemoteRepositories();
+
+ /**
+ * Deletes given artifact from the specified repository.
+ *
+ * @param repoId id of the repository where the artifact to be deleted resides
+ * @param groupId groupId of the artifact to be deleted
+ * @param artifactId artifactId of the artifact to be deleted
+ * @param version version of the artifact to be deleted
+ * @return
+ * @throws Exception
+ */
+ public Boolean deleteArtifact( String repoId, String groupId, String artifactId, String version )
+ throws Exception;
+
+ //TODO
+ // consider the following as additional services:
+ // - getAllConfiguredRepositoryConsumers( String repoId ) - list all enabled consumers for the repo
+ // - getAllConfiguredDatabaseConsumers() - list all enabled db consumers
+}
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
new file mode 100644
index 000000000..cbc47547f
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/SearchService.java
@@ -0,0 +1,28 @@
+package org.apache.archiva.web.xmlrpc.api;
+
+/*
+ * 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 com.atlassian.xmlrpc.ServiceObject;
+
+@ServiceObject("Search")
+public interface SearchService
+{
+
+}
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/TestService.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/TestService.java
new file mode 100644
index 000000000..5eba5144d
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/TestService.java
@@ -0,0 +1,28 @@
+package org.apache.archiva.web.xmlrpc.api;
+
+/*
+ * 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 com.atlassian.xmlrpc.ServiceObject;
+
+@ServiceObject("Test")
+public interface TestService
+{
+ public String ping();
+}
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/ManagedRepository.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/ManagedRepository.java
new file mode 100644
index 000000000..fd0f9ef4f
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/ManagedRepository.java
@@ -0,0 +1,152 @@
+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 com.atlassian.xmlrpc.ServiceBean;
+import com.atlassian.xmlrpc.ServiceBeanField;
+
+@ServiceBean
+public class ManagedRepository
+ implements Serializable
+{
+ private String id;
+
+ private String name;
+
+ private String url;
+
+ private String layout;
+
+ private boolean snapshots = false;
+
+ private boolean releases = false;
+
+ public ManagedRepository()
+ {
+
+ }
+
+ public ManagedRepository( String id, String name, String url, String layout, boolean snapshots, boolean releases )
+ {
+ this.id = id;
+ this.name = name;
+ this.url = url;
+ this.layout = layout;
+ this.snapshots = snapshots;
+ this.releases = releases;
+ }
+
+ public boolean equals(Object other)
+ {
+ if ( this == other)
+ {
+ return true;
+ }
+
+ if ( !(other instanceof ManagedRepository) )
+ {
+ return false;
+ }
+
+ ManagedRepository that = (ManagedRepository) other;
+ boolean result = true;
+ result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
+ return result;
+ }
+
+ public String getId()
+ {
+ return this.id;
+ }
+
+ public String getLayout()
+ {
+ return this.layout;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public String getUrl()
+ {
+ return this.url;
+ }
+
+ public int hashCode()
+ {
+ int result = 17;
+ long tmp;
+ result = 37 * result + ( id != null ? id.hashCode() : 0 );
+ return result;
+ }
+
+ public boolean isReleases()
+ {
+ return this.releases;
+ }
+
+ /**
+ * Get null
+ */
+ public boolean isSnapshots()
+ {
+ return this.snapshots;
+ }
+
+ @ServiceBeanField( "id" )
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @ServiceBeanField( "layout" )
+ public void setLayout(String layout)
+ {
+ this.layout = layout;
+ }
+
+ @ServiceBeanField( "name" )
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @ServiceBeanField( "releases" )
+ public void setReleases(boolean releases)
+ {
+ this.releases = releases;
+ }
+
+ @ServiceBeanField( "snapshots" )
+ public void setSnapshots(boolean snapshots)
+ {
+ this.snapshots = snapshots;
+ }
+
+ @ServiceBeanField( "url" )
+ public void setUrl(String url)
+ {
+ this.url = url;
+ }
+} \ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/RemoteRepository.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/RemoteRepository.java
new file mode 100644
index 000000000..399b59e57
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/beans/RemoteRepository.java
@@ -0,0 +1,121 @@
+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 com.atlassian.xmlrpc.ServiceBean;
+import com.atlassian.xmlrpc.ServiceBeanField;
+
+@ServiceBean
+public class RemoteRepository
+ implements Serializable
+{
+ private String id;
+
+ private String name;
+
+ private String url;
+
+ private String layout;
+
+ public RemoteRepository()
+ {
+
+ }
+
+ public RemoteRepository( String id, String name, String url, String layout )
+ {
+ this.id = id;
+ this.name = name;
+ this.url = url;
+ this.layout = layout;
+ }
+
+ public boolean equals(Object other)
+ {
+ if ( this == other)
+ {
+ return true;
+ }
+
+ if ( !(other instanceof RemoteRepository) )
+ {
+ return false;
+ }
+
+ RemoteRepository that = (RemoteRepository) other;
+ boolean result = true;
+ result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
+ return result;
+ }
+
+ public String getId()
+ {
+ return this.id;
+ }
+
+ public String getLayout()
+ {
+ return this.layout;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public String getUrl()
+ {
+ return this.url;
+ }
+
+ public int hashCode()
+ {
+ int result = 17;
+ long tmp;
+ result = 37 * result + ( id != null ? id.hashCode() : 0 );
+ return result;
+ }
+
+ @ServiceBeanField( "id" )
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @ServiceBeanField( "layout" )
+ public void setLayout(String layout)
+ {
+ this.layout = layout;
+ }
+
+ @ServiceBeanField( "name" )
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @ServiceBeanField( "url" )
+ public void setUrl(String url)
+ {
+ this.url = url;
+ }
+} \ No newline at end of file