]> source.dussan.org Git - archiva.git/commitdiff
-added additional service interfaces
authorMaria Odea B. Ching <oching@apache.org>
Wed, 8 Oct 2008 10:42:03 +0000 (10:42 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Wed, 8 Oct 2008 10:42:03 +0000 (10:42 +0000)
-added stub impl of AdministrationService
-configured modello to generate archiva objects used for ws

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches@702801 13f79535-47bb-0310-9956-ffa450edef68

MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/AdministrationService.java [new file with mode: 0644]
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/SearchService.java [new file with mode: 0644]
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/mdo/archiva-service.xml [new file with mode: 0644]
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/maven/archiva/xmlrpc/security/XmlRpcAuthenticator.java
MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/maven/archiva/web/xmlrpc/services/AdministrationServiceImpl.java [new file with mode: 0644]

index 38f230718097865968fb912a88639b49eccb1f33..29b707728bbbd0cd17069d955688251a080a217a 100644 (file)
       <artifactId>atlassian-xmlrpc-binder-annotations</artifactId>
     </dependency>
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-15</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <version>1.0.0</version>
+          <model>src/main/mdo/archiva-service.xml</model>
+          <packageWithVersion>false</packageWithVersion>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>
diff --git a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/AdministrationService.java b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/AdministrationService.java
new file mode 100644 (file)
index 0000000..187fb14
--- /dev/null
@@ -0,0 +1,47 @@
+package org.apache.maven.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 com.atlassian.xmlrpc.ServiceObject;
+
+@ServiceObject( "Administration" )
+public interface AdministrationService
+{
+    public boolean executeRepositoryScanner( String repoId );
+
+    public boolean executeDatabaseScanner();
+
+    public List<String> getAllDatabaseConsumers();
+
+    public boolean configureDatabaseConsumer( String consumerId, boolean enable );
+
+    // TODO should we already implement config of consumers per repository?
+    public boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable );
+
+    public List<String> getAllRepositoryConsumers( String repoId );
+
+    public List<ManagedRepository> getAllManagedRepositories();
+
+    public List<RemoteRepository> getAllRemoteRepositories();
+
+    public boolean deleteArtifact( String repoId, String groupId, String artifactId, String version );
+}
diff --git a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/SearchService.java b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/SearchService.java
new file mode 100644 (file)
index 0000000..f92c450
--- /dev/null
@@ -0,0 +1,28 @@
+package org.apache.maven.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/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/mdo/archiva-service.xml b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/mdo/archiva-service.xml
new file mode 100644 (file)
index 0000000..e370abe
--- /dev/null
@@ -0,0 +1,105 @@
+<?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.
+  -->
+<model>
+  <id>archiva-client</id>
+  <name>ArchivaClient</name>
+  <version>1.0.0</version>
+  <description>Archiva web services model.</description>
+  <defaults>
+    <default>
+      <key>package</key>
+      <value>org.apache.maven.archiva.web.xmlrpc.api</value>
+    </default>
+  </defaults>
+  <classes>
+    <class>
+      <name>ManagedRepository</name>
+      <version>1.0.0+</version>
+      <description><![CDATA[
+        This class represents a managed repository.
+      ]]></description>
+      <fields>
+        <field>
+          <name>id</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <type>String</type>
+          <identifier>true</identifier>
+        </field>
+        <field>
+          <name>name</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>url</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>layout</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>snapshots</name>
+          <version>1.0.0+</version>
+          <type>boolean</type>
+        </field>
+        <field>
+          <name>releases</name>
+          <version>1.0.0+</version>
+          <type>boolean</type>
+        </field>
+      </fields>
+    </class>    
+    <class>
+      <name>RemoteRepository</name>
+      <version>1.0.0+</version>
+      <description><![CDATA[
+        This class represents a remote repository.
+      ]]></description>
+      <fields>
+        <field>
+          <name>id</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <type>String</type>
+          <identifier>true</identifier>
+        </field>
+        <field>
+          <name>name</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>url</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>layout</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+      </fields>
+    </class>        
+  </classes>
+</model>
index bf658ed66067c945eec0372cad46d053caa7f9db..e7ba4466f87f1d6d04881532a76819ca3d17abbc 100644 (file)
@@ -85,6 +85,8 @@ public class XmlRpcAuthenticator
     {\r
         try\r
         {\r
+            //TODO authorization/permissions should be checked depending on the service being accessed\r
+            \r
             return securitySystem.authorize( session, ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE );\r
         }\r
         catch ( AuthorizationException e )\r
diff --git a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/maven/archiva/web/xmlrpc/services/AdministrationServiceImpl.java b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/maven/archiva/web/xmlrpc/services/AdministrationServiceImpl.java
new file mode 100644 (file)
index 0000000..bb52d56
--- /dev/null
@@ -0,0 +1,83 @@
+package org.apache.maven.archiva.web.xmlrpc.services;
+
+/*
+ * 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.maven.archiva.web.xmlrpc.api.AdministrationService;
+import org.apache.maven.archiva.web.xmlrpc.api.ManagedRepository;
+import org.apache.maven.archiva.web.xmlrpc.api.RemoteRepository;
+
+public class AdministrationServiceImpl
+    implements AdministrationService
+{
+
+    public boolean configureDatabaseConsumer( String consumerId, boolean enable )
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable )
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public boolean deleteArtifact( String repoId, String groupId, String artifactId, String version )
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public boolean executeDatabaseScanner()
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public boolean executeRepositoryScanner( String repoId )
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public List<String> getAllDatabaseConsumers()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public List<String> getAllRepositoryConsumers( String repoId )
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public List<ManagedRepository> getAllManagedRepositories()
+    {
+        return null;
+    }
+
+    public List<RemoteRepository> getAllRemoteRepositories()
+    {
+        return null;
+    }
+}