summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin/src/main/java/com/yahoo/feedhandler/VespaFeedHandlerVisit.java
blob: bb5e8c056db790bbd988c45e9b6334f61a1d84cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.feedhandler;

import java.util.Collections;
import java.util.concurrent.Executor;
import javax.inject.Inject;

import com.yahoo.jdisc.Metric;
import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.ThreadedHttpRequestHandler;
import com.yahoo.search.handler.SearchHandler;

/**
 * @author thomasg
 */
@Deprecated
public class VespaFeedHandlerVisit extends ThreadedHttpRequestHandler {

    private final SearchHandler searchHandler;

    @Inject
    public VespaFeedHandlerVisit(SearchHandler searchHandler, Executor executor, Metric metric) {
        super(executor, metric, true);
        this.searchHandler = searchHandler;
    }

    @Override
    public HttpResponse handle(HttpRequest request) {
        return searchHandler.handle(new HttpRequest(request.getJDiscRequest(), request.getData(), Collections.singletonMap("searchChain", "vespavisit")));
    }

}