Search in sources :

Example 1 with RemoteServiceConfiguration

use of com.palantir.atlasdb.http.v2.RemoteServiceConfiguration in project atlasdb by palantir.

the class BroadcastDialogueClientFactory method create.

public static BroadcastDialogueClientFactory create(DialogueClients.ReloadingFactory baseFactory, Refreshable<ServerListConfig> serverListConfigSupplier, UserAgent userAgent, AuxiliaryRemotingParameters parameters) {
    UserAgent versionedAgent = userAgent.addAgent(AtlasDbRemotingConstants.ATLASDB_HTTP_CLIENT_AGENT);
    Refreshable<Map<String, RemoteServiceConfiguration>> timeLockRemoteConfigurations = serverListConfigSupplier.map(serverListConfig -> createRemoteServiceConfigurations(serverListConfig, versionedAgent, parameters));
    DialogueClients.ReloadingFactory reloadingFactory = baseFactory.reloading(timeLockRemoteConfigurations.map(DialogueClientOptions::toServicesConfigBlock)).withUserAgent(versionedAgent);
    return new BroadcastDialogueClientFactory(reloadingFactory, serverListConfigSupplier);
}
Also used : DialogueClientOptions(com.palantir.atlasdb.http.v2.DialogueClientOptions) UserAgent(com.palantir.conjure.java.api.config.service.UserAgent) Map(java.util.Map) DialogueClients(com.palantir.dialogue.clients.DialogueClients)

Example 2 with RemoteServiceConfiguration

use of com.palantir.atlasdb.http.v2.RemoteServiceConfiguration in project atlasdb by palantir.

the class TimeLockDialogueServiceProvider method create.

public static TimeLockDialogueServiceProvider create(TaggedMetricRegistry taggedMetricRegistry, DialogueClients.ReloadingFactory baseFactory, ServerListConfig serverListConfig, AuxiliaryRemotingParameters parameters) {
    UserAgent versionedAgent = parameters.userAgent().addAgent(AtlasDbRemotingConstants.ATLASDB_HTTP_CLIENT_AGENT);
    Map<String, RemoteServiceConfiguration> remoteServiceConfigurations = createRemoteServiceConfigurations(serverListConfig, versionedAgent, parameters);
    DialogueClients.ReloadingFactory reloadingFactory = decorate(baseFactory, Refreshable.only(remoteServiceConfigurations)).withUserAgent(versionedAgent);
    return new TimeLockDialogueServiceProvider(reloadingFactory, taggedMetricRegistry);
}
Also used : UserAgent(com.palantir.conjure.java.api.config.service.UserAgent) ImmutableRemoteServiceConfiguration(com.palantir.atlasdb.http.v2.ImmutableRemoteServiceConfiguration) RemoteServiceConfiguration(com.palantir.atlasdb.http.v2.RemoteServiceConfiguration) DialogueClients(com.palantir.dialogue.clients.DialogueClients)

Aggregations

UserAgent (com.palantir.conjure.java.api.config.service.UserAgent)2 DialogueClients (com.palantir.dialogue.clients.DialogueClients)2 DialogueClientOptions (com.palantir.atlasdb.http.v2.DialogueClientOptions)1 ImmutableRemoteServiceConfiguration (com.palantir.atlasdb.http.v2.ImmutableRemoteServiceConfiguration)1 RemoteServiceConfiguration (com.palantir.atlasdb.http.v2.RemoteServiceConfiguration)1 Map (java.util.Map)1