OpenSearch

- improve logging
- support for specifying search locale
- fix some minor authentication issues

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4713 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2007-01-03 17:57:15 +00:00
parent 7a5bb10b67
commit 91056f8274
6 changed files with 205 additions and 64 deletions

View File

@@ -51,6 +51,7 @@ public class APIServiceRegistry
{
// retrieve service authenticator
MethodInterceptor authenticator = (MethodInterceptor)appContext.getBean("web.api.Authenticator");
MethodInterceptor serviceLogger = (MethodInterceptor)appContext.getBean("web.api.ServiceLogger");
// register all API Services
// NOTE: An API Service is one registered in Spring which is of type APIServiceImpl
@@ -70,19 +71,31 @@ public class APIServiceRegistry
}
// wrap API Service in appropriate interceptors (e.g. authentication)
if (service.getRequiredAuthentication() != APIRequest.RequiredAuthentication.None)
if (serviceLogger != null && authenticator != null)
{
if (authenticator == null)
ProxyFactory authFactory = new ProxyFactory((APIService)service);
// authentication
if (service.getRequiredAuthentication() != APIRequest.RequiredAuthentication.None)
{
throw new APIException("Web API Authenticator not specified");
if (authenticator == null)
{
throw new APIException("Web API Authenticator not specified");
}
RegexpMethodPointcutAdvisor advisor = new RegexpMethodPointcutAdvisor(".*execute", authenticator);
authFactory.addAdvisor(advisor);
}
// logging
if (serviceLogger != null)
{
RegexpMethodPointcutAdvisor advisor = new RegexpMethodPointcutAdvisor(".*execute", serviceLogger);
authFactory.addAdvisor(advisor);
}
RegexpMethodPointcutAdvisor advisor = new RegexpMethodPointcutAdvisor(".*execute", authenticator);
ProxyFactory authFactory = new ProxyFactory((APIService)service);
authFactory.addAdvisor(advisor);
service = (APIService)authFactory.getProxy();
}
// register service
methods.add(method);
uris.add(httpUri);