From 34c25bfd45f42689d857826b41a176643192aebf Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Wed, 8 Oct 2008 10:42:03 +0000 Subject: [PATCH] -added additional service interfaces -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 --- .../archiva-xmlrpc/archiva-xmlrpc-api/pom.xml | 21 ++++ .../web/xmlrpc/api/AdministrationService.java | 47 ++++++++ .../archiva/web/xmlrpc/api/SearchService.java | 28 +++++ .../src/main/mdo/archiva-service.xml | 105 ++++++++++++++++++ .../xmlrpc/security/XmlRpcAuthenticator.java | 2 + .../services/AdministrationServiceImpl.java | 83 ++++++++++++++ 6 files changed, 286 insertions(+) create mode 100644 MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/AdministrationService.java create mode 100644 MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/SearchService.java create mode 100644 MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/mdo/archiva-service.xml create mode 100644 MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/maven/archiva/web/xmlrpc/services/AdministrationServiceImpl.java diff --git a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml index 38f230718..29b707728 100644 --- a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml +++ b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml @@ -37,4 +37,25 @@ atlassian-xmlrpc-binder-annotations + + + + org.codehaus.modello + modello-maven-plugin + 1.0-alpha-15 + + + + java + + + + + 1.0.0 + src/main/mdo/archiva-service.xml + false + + + + 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 index 000000000..187fb14e1 --- /dev/null +++ b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/AdministrationService.java @@ -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 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 getAllRepositoryConsumers( String repoId ); + + public List getAllManagedRepositories(); + + public List 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 index 000000000..f92c450fd --- /dev/null +++ b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/maven/archiva/web/xmlrpc/api/SearchService.java @@ -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 index 000000000..e370abea8 --- /dev/null +++ b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/mdo/archiva-service.xml @@ -0,0 +1,105 @@ + + + + archiva-client + ArchivaClient + 1.0.0 + Archiva web services model. + + + package + org.apache.maven.archiva.web.xmlrpc.api + + + + + ManagedRepository + 1.0.0+ + + + + id + 1.0.0+ + true + String + true + + + name + 1.0.0+ + String + + + url + 1.0.0+ + String + + + layout + 1.0.0+ + String + + + snapshots + 1.0.0+ + boolean + + + releases + 1.0.0+ + boolean + + + + + RemoteRepository + 1.0.0+ + + + + id + 1.0.0+ + true + String + true + + + name + 1.0.0+ + String + + + url + 1.0.0+ + String + + + layout + 1.0.0+ + String + + + + + diff --git a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/maven/archiva/xmlrpc/security/XmlRpcAuthenticator.java b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/maven/archiva/xmlrpc/security/XmlRpcAuthenticator.java index bf658ed66..e7ba4466f 100644 --- a/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/maven/archiva/xmlrpc/security/XmlRpcAuthenticator.java +++ b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/maven/archiva/xmlrpc/security/XmlRpcAuthenticator.java @@ -85,6 +85,8 @@ public class XmlRpcAuthenticator { try { + //TODO authorization/permissions should be checked depending on the service being accessed + return securitySystem.authorize( session, ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE ); } catch ( AuthorizationException e ) 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 index 000000000..bb52d56ad --- /dev/null +++ b/MRM-124/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/maven/archiva/web/xmlrpc/services/AdministrationServiceImpl.java @@ -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 getAllDatabaseConsumers() + { + // TODO Auto-generated method stub + return null; + } + + public List getAllRepositoryConsumers( String repoId ) + { + // TODO Auto-generated method stub + return null; + } + + public List getAllManagedRepositories() + { + return null; + } + + public List getAllRemoteRepositories() + { + return null; + } +} -- 2.39.5