]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1228] Ping service in not working
authorMaria Odea B. Ching <oching@apache.org>
Sun, 22 Nov 2009 12:23:00 +0000 (12:23 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Sun, 22 Nov 2009 12:23:00 +0000 (12:23 +0000)
o changed from TestService to PingService
o fixed bean config in applicationContext in webapp
o added service object annotation for xmlrpc binder

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

archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/PingService.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/TestService.java [deleted file]
archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/ServiceMethodsPermissionsMapping.java
archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/XmlRpcAuthenticator.java
archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/PingServiceImpl.java

index f640639d88375e0e9ccaf8708ea80f5cd48e0049..6f4a80950f21e5d76896c93279f1f570c67f3dd5 100644 (file)
   <bean id="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
     <property name="location" value="classpath:application.properties" />
   </bean>
-  
-  <bean name="testXmlRpcService" lazy-init="true" scope="singleton" class="org.apache.archiva.web.xmlrpc.services.PingServiceImpl"/>
    
   <bean name="xmlRpcUserRepositories" class="org.apache.archiva.web.xmlrpc.security.XmlRpcUserRepositories">
     <constructor-arg ref="userRepositories"/>
     <constructor-arg ref="xmlRpcAuthenticator"/>    
   </bean> 
   
+  <!--  Web Service : Ping Service -->
+  <bean name="pingService" lazy-init="true" scope="singleton" class="org.apache.archiva.web.xmlrpc.services.PingServiceImpl"/> 
+  
   <!-- Web Services : Search Service -->
   <bean name="searchService" lazy-init="true" scope="singleton" class="org.apache.archiva.web.xmlrpc.services.SearchServiceImpl">    
     <constructor-arg ref="xmlRpcUserRepositories"/>   
@@ -64,6 +65,7 @@
       <list>
         <ref bean="administrationService"/>
         <ref bean="searchService"/>
+        <ref bean="pingService"/>
       </list>
     </constructor-arg>
   </bean>
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/PingService.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/PingService.java
new file mode 100644 (file)
index 0000000..492f655
--- /dev/null
@@ -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("PingService")
+public interface PingService
+{
+    public String ping();
+}
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
deleted file mode 100644 (file)
index 5eba514..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-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();
-}
index b7119e0677bb55271c206df63565ea16e3c62772..97fe329906cec096174f1dc043c7cc756c0fb065 100644 (file)
@@ -49,5 +49,6 @@ public class ServiceMethodsPermissionsMapping
                        "SearchService.getArtifactVersions", "SearchService.getArtifactVersionsByDate",
                        "SearchService.getDependencies", "SearchService.getDependencyTree",
                        "SearchService.getDependees" );
-
+    
+    public static final String PING = "PingService.ping";
 }
index 19f8544618d77f5665277af4a8d15573e72afed8..663a37e099a5f7861c876252e19923795e4af2dd 100644 (file)
@@ -132,7 +132,11 @@ public class XmlRpcAuthenticator
                 {\r
                     throw new XmlRpcException( 401, e.getMessage() );\r
                 }\r
-            }   \r
+            }\r
+            else if ( methodName.equals( ServiceMethodsPermissionsMapping.PING ) )\r
+            {\r
+                return new AuthorizationResult( true, username, null );\r
+            }\r
             else\r
             {\r
                 return securitySystem.authorize( session, ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE );\r
index aa47f5f0e2dff9c4a02cb71f95a4e6e7774544e1..14b0d2870910cbb2ebc35936143689c1a46f067c 100644 (file)
@@ -19,9 +19,9 @@ package org.apache.archiva.web.xmlrpc.services;
  * under the License.\r
  */\r
 \r
-import org.apache.archiva.web.xmlrpc.api.TestService;\r
+import org.apache.archiva.web.xmlrpc.api.PingService;\r
 \r
-public class PingServiceImpl implements TestService\r
+public class PingServiceImpl implements PingService\r
 {\r
     public String ping()\r
     {\r