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,
    P extends Enum

, CONFIG extends StoreClientConfig > extends NetworkClient { protected final ObjectMapper _mapper; protected final CONFIG _config; /** * End point that basic CRUD accessors use. */ protected final P _singleEntryEndpoint; /** * End point that entry lister will use */ protected final P _entryListEndpoint; /** * The usual constructor to call; configures AHC using standard * settings. */ protected BaseJdkHttpNetworkClient(CONFIG config, P singleEntryEndpoint, P entryListEndpoint) { _config = config; _singleEntryEndpoint = singleEntryEndpoint; _entryListEndpoint = entryListEndpoint; _mapper = config.getJsonMapper(); } /* /********************************************************************** /* Standard factory methods /********************************************************************** */ @Override public JdkHttpClientPathBuilder pathBuilder(IpAndPort server) { return new JdkHttpClientPathBuilder(server); } @Override public void shutdown() { // nothing to do here } @Override public EntryAccessors getEntryAccessors() { return new JdkHttpEntryAccessors(_config, _singleEntryEndpoint, _entryListEndpoint); } @Override public EntryKeyConverter getKeyConverter() { return _config.getKeyConverter(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy