private static final WebServer launchGVSServer(final Store store,
ServerBinding serverBinding,
final Map<String, Handler> prefixHandlerMap, GraphOverTime trustedGOT) throws IOException {
WebServerFactory webServerFactory = WebServerFactory.newInstance();
Handler terminator = new Handler() {
public void handle(Request request, Response response)
throws HandlerException {
String requestURI = request.getRequestURI().getPath();
String[] userAgents = request.getHeaderValues(HeaderName.USER_AGENT);
String userAgent;
if (userAgents.length > 0) {
userAgent = userAgents[0];
} else {
userAgent = "unknown";
}
log.info(request.getMethod().getName()+" "+request.getRequestURI().getAbsPath()+" "+userAgent);
while (true) {
Handler handler = prefixHandlerMap.get(requestURI);
if (handler != null) {
handler.handle(request, response);
return;
}
if (requestURI.equals("/")) {
return;
}