summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaria Odea B. Ching <oching@apache.org>2009-11-22 12:23:00 +0000
committerMaria Odea B. Ching <oching@apache.org>2009-11-22 12:23:00 +0000
commit9c0bce139077a7b063c72421abf02fed40682a1e (patch)
treef7aea53e0e4b9564145acd987f112fd2f65a567c
parent081473a2e3308c75ba42b050d58515da95e33103 (diff)
downloadarchiva-9c0bce139077a7b063c72421abf02fed40682a1e.tar.gz
archiva-9c0bce139077a7b063c72421abf02fed40682a1e.zip
[MRM-1228] Ping service in not working
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
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml6
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/PingService.java (renamed from archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/TestService.java)4
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/ServiceMethodsPermissionsMapping.java3
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/XmlRpcAuthenticator.java6
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/PingServiceImpl.java4
5 files changed, 15 insertions, 8 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
index f640639d8..6f4a80950 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
@@ -30,14 +30,15 @@
<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/TestService.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/PingService.java
index 5eba5144d..492f655fe 100644
--- 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/PingService.java
@@ -21,8 +21,8 @@ package org.apache.archiva.web.xmlrpc.api;
import com.atlassian.xmlrpc.ServiceObject;
-@ServiceObject("Test")
-public interface TestService
+@ServiceObject("PingService")
+public interface PingService
{
public String ping();
}
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/ServiceMethodsPermissionsMapping.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/ServiceMethodsPermissionsMapping.java
index b7119e067..97fe32990 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/ServiceMethodsPermissionsMapping.java
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/ServiceMethodsPermissionsMapping.java
@@ -49,5 +49,6 @@ public class ServiceMethodsPermissionsMapping
"SearchService.getArtifactVersions", "SearchService.getArtifactVersionsByDate",
"SearchService.getDependencies", "SearchService.getDependencyTree",
"SearchService.getDependees" );
-
+
+ public static final String PING = "PingService.ping";
}
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/XmlRpcAuthenticator.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/XmlRpcAuthenticator.java
index 19f854461..663a37e09 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/XmlRpcAuthenticator.java
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/src/main/java/org/apache/archiva/web/xmlrpc/security/XmlRpcAuthenticator.java
@@ -132,7 +132,11 @@ public class XmlRpcAuthenticator
{
throw new XmlRpcException( 401, e.getMessage() );
}
- }
+ }
+ else if ( methodName.equals( ServiceMethodsPermissionsMapping.PING ) )
+ {
+ return new AuthorizationResult( true, username, null );
+ }
else
{
return securitySystem.authorize( session, ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE );
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/PingServiceImpl.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/PingServiceImpl.java
index aa47f5f0e..14b0d2870 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/PingServiceImpl.java
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/PingServiceImpl.java
@@ -19,9 +19,9 @@ package org.apache.archiva.web.xmlrpc.services;
* under the License.
*/
-import org.apache.archiva.web.xmlrpc.api.TestService;
+import org.apache.archiva.web.xmlrpc.api.PingService;
-public class PingServiceImpl implements TestService
+public class PingServiceImpl implements PingService
{
public String ping()
{