Skip to content
Snippets Groups Projects
Commit 4cd93730 authored by cramakri's avatar cramakri
Browse files

LMS-1527 Added rpc-name-server to openBIS.

SVN: 15930
parent f281c271
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed 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.
*/
package ch.systemsx.cisd.openbis.generic.server;
import javax.annotation.Resource;
import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import ch.systemsx.cisd.common.api.IRpcServiceNameServer;
import ch.systemsx.cisd.common.api.RpcServiceInterfaceVersionDTO;
import ch.systemsx.cisd.common.api.server.RpcServiceNameServer;
import ch.systemsx.cisd.common.spring.ServiceExceptionTranslator;
/**
* A servlet that exports the name server via the HttpInvoker interface.
*
* @author Chandrasekhar Ramakrishnan
*/
@Controller
@RequestMapping(
{ NameServerServlet.NAME_SERVER_URL, "/openbis" + NameServerServlet.NAME_SERVER_URL })
public class NameServerServlet extends HttpInvokerServiceExporter
{
private final static String NAME_SERVER_URL = IRpcServiceNameServer.PREFFERED_URL_SUFFIX;
private final static String NAME_SERVER_SERVICE_NAME =
IRpcServiceNameServer.PREFFERED_SERVICE_NAME;
@Resource(name = IRpcServiceNameServer.PREFFERED_BEAN_NAME)
private RpcServiceNameServer nameServer;
@Override
public void afterPropertiesSet()
{
setServiceInterface(IRpcServiceNameServer.class);
setService(nameServer);
setInterceptors(new Object[]
{ new ServiceExceptionTranslator() });
RpcServiceInterfaceVersionDTO ifaceVersion =
new RpcServiceInterfaceVersionDTO(NAME_SERVER_SERVICE_NAME, NAME_SERVER_URL, 1, 0);
nameServer.addSupportedInterfaceVersion(ifaceVersion);
super.afterPropertiesSet();
}
}
...@@ -22,12 +22,13 @@ import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter; ...@@ -22,12 +22,13 @@ import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import ch.systemsx.cisd.common.api.IRpcServiceNameServer;
import ch.systemsx.cisd.common.api.RpcServiceInterfaceVersionDTO;
import ch.systemsx.cisd.common.api.server.RpcServiceNameServer;
import ch.systemsx.cisd.common.spring.ServiceExceptionTranslator; import ch.systemsx.cisd.common.spring.ServiceExceptionTranslator;
import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.IQueryApiServer; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.IQueryApiServer;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
@Controller @Controller
...@@ -38,12 +39,21 @@ public class QueryServiceServer extends HttpInvokerServiceExporter ...@@ -38,12 +39,21 @@ public class QueryServiceServer extends HttpInvokerServiceExporter
@Resource(name = ResourceNames.QUERY_PLUGIN_SERVER) @Resource(name = ResourceNames.QUERY_PLUGIN_SERVER)
private IQueryApiServer server; private IQueryApiServer server;
@Resource(name = IRpcServiceNameServer.PREFFERED_BEAN_NAME)
private RpcServiceNameServer nameServer;
@Override @Override
public void afterPropertiesSet() public void afterPropertiesSet()
{ {
setServiceInterface(IQueryApiServer.class); setServiceInterface(IQueryApiServer.class);
setService(server); setService(server);
setInterceptors(new Object[] {new ServiceExceptionTranslator()}); setInterceptors(new Object[]
{ new ServiceExceptionTranslator() });
RpcServiceInterfaceVersionDTO ifaceVersion =
new RpcServiceInterfaceVersionDTO("query", ResourceNames.QUERY_PLUGIN_SERVER_URL,
1, 0);
nameServer.addSupportedInterfaceVersion(ifaceVersion);
super.afterPropertiesSet(); super.afterPropertiesSet();
} }
} }
...@@ -25,8 +25,8 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryDescription; ...@@ -25,8 +25,8 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryDescription;
import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryTableModel; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryTableModel;
/** /**
* Public API interface to query server (version 1). * Public API interface to query server (version 1).
* *
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
// DO NOT CHANGE THE INTERFACE CONTRACT IN A NON-BACKWARD COMPATIBLE WAY! // DO NOT CHANGE THE INTERFACE CONTRACT IN A NON-BACKWARD COMPATIBLE WAY!
...@@ -36,15 +36,16 @@ public interface IQueryApiServer ...@@ -36,15 +36,16 @@ public interface IQueryApiServer
* Tries to authenticate specified user with specified password. Returns session token if * Tries to authenticate specified user with specified password. Returns session token if
* succeeded otherwise <code>null</code> is returned. * succeeded otherwise <code>null</code> is returned.
*/ */
@Transactional // this is not a readOnly transaction - it can create new users @Transactional
// this is not a readOnly transaction - it can create new users
public String tryToAuthenticateAtQueryServer(String userID, String userPassword); public String tryToAuthenticateAtQueryServer(String userID, String userPassword);
/** /**
* Logout the session with the specified session token. * Logout the session with the specified session token.
*/ */
@Transactional(readOnly = true) @Transactional(readOnly = true)
public void logout(String sessionToken); public void logout(String sessionToken);
/** /**
* Lists all queries available for the user of the specified session. * Lists all queries available for the user of the specified session.
*/ */
...@@ -55,6 +56,7 @@ public interface IQueryApiServer ...@@ -55,6 +56,7 @@ public interface IQueryApiServer
* Executes specified query using specified parameter bindings. * Executes specified query using specified parameter bindings.
*/ */
@Transactional(readOnly = true) @Transactional(readOnly = true)
public QueryTableModel executeQuery(String sessionToken, long queryID, Map<String, String> parameterBindings); public QueryTableModel executeQuery(String sessionToken, long queryID,
Map<String, String> parameterBindings);
} }
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
<property name="onlineHelpSpecificPageTemplate" value="${onlinehelp.specific.page-template}"/> <property name="onlineHelpSpecificPageTemplate" value="${onlinehelp.specific.page-template}"/>
</bean> </bean>
<bean id="rpc-name-server" class="ch.systemsx.cisd.common.api.server.RpcServiceNameServer" />
<!-- <!--
// Tracking // Tracking
--> -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment