Skip to content

Commit

Permalink
mapping set info table pages stored
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jan 2, 2014
1 parent c4bb1d0 commit d8f43a9
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.bridgedb.ws.uri;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;

import javax.servlet.ServletContext;
Expand Down Expand Up @@ -60,6 +61,8 @@ public class WSOtherservices extends WSAPI implements ServletContextListener {
private static boolean EXCLUDE_GRAPH = false;
private static boolean INCLUDE_GRAPH = true;

private static final HashMap<String,Response> setMappings = new HashMap<String,Response>();

private static final Logger logger = Logger.getLogger(WSOtherservices.class);
private ServletContext context;

Expand Down Expand Up @@ -167,6 +170,23 @@ public Response getSetMapping(@QueryParam(WsUriConstants.SOURCE_DATASOURCE_SYSTE
@QueryParam(WsUriConstants.LENS_URI) String lensUri,
@Context HttpServletRequest httpServletRequest)
throws BridgeDBException, UnsupportedEncodingException {
String key = scrCode + targetCode + lensUri;
Response result = setMappings.get(key);
if (result == null){
result = getSetMappingNew(scrCode, targetCode, lensUri, httpServletRequest);
setMappings.put(key, result);
}
return result;
}

@GET
@Produces(MediaType.TEXT_HTML)
@Path("/" + SetMappings.METHOD_NAME)
public Response getSetMappingNew(@QueryParam(WsUriConstants.SOURCE_DATASOURCE_SYSTEM_CODE) String scrCode,
@QueryParam(WsUriConstants.TARGET_DATASOURCE_SYSTEM_CODE) String targetCode,
@QueryParam(WsUriConstants.LENS_URI) String lensUri,
@Context HttpServletRequest httpServletRequest)
throws BridgeDBException, UnsupportedEncodingException {
List<MappingSetInfo> mappingSetInfos = uriMapper.getMappingSetInfos(scrCode, targetCode, lensUri);
String lensName;
if (lensUri != null && !lensUri.isEmpty()){
Expand Down

0 comments on commit d8f43a9

Please sign in to comment.