summaryrefslogtreecommitdiffstats
path: root/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClientFactory.java
blob: aba16e9c9a497c96043b7df4603a7710bf2919cc (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 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.http.client;


import com.yahoo.vespa.http.client.config.SessionParams;
import com.yahoo.vespa.http.client.core.api.FeedClientImpl;

import static com.yahoo.vespa.http.client.SessionFactory.createTimeoutExecutor;

/**
 * Factory for creating FeedClient.
 * @author dybis
 */
public class FeedClientFactory {

    /**
     * Creates FeedClient.
     * @param sessionParams parameters for connection, hosts, cluster configurations and more.
     * @param resultCallback on each result, this callback is called.
     * @return newly created FeedClient API object.
     */
    public static FeedClient create(
            SessionParams sessionParams,
            FeedClient.ResultCallback resultCallback) {
        return new FeedClientImpl(sessionParams, resultCallback, createTimeoutExecutor());
    }
}