[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
This commit is contained in:
Maria Odea B. Ching 2009-11-22 12:23:00 +00:00
parent 081473a2e3
commit 9c0bce1390
5 changed files with 15 additions and 8 deletions

View File

@ -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>

View File

@ -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();
}

View 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";
}

View File

@ -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 );

View File

@ -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()
{