All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.clustermate.client.jdk.BaseJdkHttpNetworkClient Maven / Gradle / Ivy

Go to download

ClusterMate NetworkClient implementation built on default JDK-provided HTTP client (HTTPUrlConnection)

There is a newer version: 0.10.5
Show newest version
package com.fasterxml.clustermate.client.jdk;

import com.fasterxml.jackson.databind.ObjectMapper;

import com.fasterxml.storemate.shared.IpAndPort;

import com.fasterxml.clustermate.api.*;
import com.fasterxml.clustermate.client.*;
import com.fasterxml.clustermate.std.JdkHttpClientPathBuilder;

public abstract class BaseJdkHttpNetworkClient<
    K extends EntryKey,
    CONFIG extends StoreClientConfig
>
    extends NetworkClient
{
    protected final ObjectMapper _mapper;

    protected final CONFIG _config;

    /**
     * The usual constructor to call; configures AHC using standard
     * settings.
     */
    protected BaseJdkHttpNetworkClient(CONFIG config)
    {
        _config = config;
        _mapper = config.getJsonMapper();
    }

    /*
    /**********************************************************************
    /* Standard factory methods
    /**********************************************************************
     */

    @Override
    public RequestPathBuilder pathBuilder(IpAndPort server)
    {
        return new JdkHttpClientPathBuilder(server);
    }
    
    @Override
    public void shutdown() {
        // nothing to do here
    }
    
    @Override
    public EntryAccessors getEntryAccessors() {
        return new JdkHttpEntryAccessors(_config);
    }

    @Override
    public EntryKeyConverter getKeyConverter() {
        return _config.getKeyConverter();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy