aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/federation/http/ConfiguredHTTPClientSearcher.java
blob: 1607d10872283d993558eb9aca05c676b78a0d03 (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
34
35
36
37
38
39
40
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.federation.http;

import java.util.Collections;

import com.yahoo.component.ComponentId;
import com.yahoo.search.federation.ProviderConfig;
import com.yahoo.search.Result;
import com.yahoo.search.searchchain.Execution;
import com.yahoo.statistics.Statistics;


/**
 * Superclass for http client searchers which depends on config. All this is doing is translating
 * the provider and cache configurations to parameters which are passed upwards.
 *
 * @author bratseth
 * @deprecated
 */
// TODO: Remove on Vespa 7
@Deprecated // OK
public abstract class ConfiguredHTTPClientSearcher extends HTTPClientSearcher {

    /** Create this from a configuraton */
    public ConfiguredHTTPClientSearcher(final ComponentId id, final ProviderConfig providerConfig, Statistics manager) {
        super(id, ConfiguredSearcherHelper.toConnectionList(providerConfig), new HTTPParameters(providerConfig), manager);
    }

    /** Create an instance from direct parameters having a single connection. Useful for testing */
    public ConfiguredHTTPClientSearcher(String idString,String host,int port,String path, Statistics manager) {
        super(new ComponentId(idString), Collections.singletonList(new Connection(host,port)),path, manager);
    }

    /** Forwards to the next in chain fill(result,summaryName) */
    @Override
    public void fill(Result result,String summaryName, Execution execution,Connection connection) {
        execution.fill(result,summaryName);
    }

}