summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/federation/http/ConfiguredSearcherHelper.java
blob: cb7f32d8e7e0b8bb29a4d7d0695651de1e50be3d (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
// Copyright 2016 Yahoo Inc. 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.ArrayList;
import java.util.List;

import com.yahoo.search.federation.ProviderConfig;

/**
 * Some static helper classes for configured*Searcher classes
 *
 * @author bratseth
 */
class ConfiguredSearcherHelper {

    /** No instantiation */
    private ConfiguredSearcherHelper() { }

    public static List<Connection> toConnectionList(ProviderConfig providerConfig) {
        List<Connection> connections=new ArrayList<>();
        for(ProviderConfig.Node node : providerConfig.node()) {
            connections.add(new Connection(node.host(), node.port()));
        }
        return connections;
    }

}