Tabnine Logo
HttpConfig.getUserAgent
Code IndexAdd Tabnine to your IDE (free)

How to use
getUserAgent
method
in
com.hubspot.horizon.HttpConfig

Best Java code snippets using com.hubspot.horizon.HttpConfig.getUserAgent (Showing top 2 results out of 315)

origin: com.hubspot/HorizonApache

 @Override
 public void process(HttpRequest request, HttpContext context) {
  if (!request.containsHeader(HttpHeaders.ACCEPT_ENCODING)) {
   request.addHeader(HttpHeaders.ACCEPT_ENCODING, "snappy,gzip,deflate");
  }
  if (!request.containsHeader(HttpHeaders.USER_AGENT)) {
   request.addHeader(HttpHeaders.USER_AGENT, config.getUserAgent());
  }
 }
}
origin: com.hubspot/HorizonNing

public NingAsyncHttpClient(HttpConfig config) {
 Preconditions.checkNotNull(config);
 NettyAsyncHttpProviderConfig nettyConfig = new NettyAsyncHttpProviderConfig();
 int workerThreads = Math.min(Runtime.getRuntime().availableProcessors(), 4);
 this.workerExecutorService = newWorkerThreadPool(workerThreads);
 this.channelFactory = newSocketChannelFactory(this.workerExecutorService, workerThreads);
 nettyConfig.setSocketChannelFactory(this.channelFactory);
 nettyConfig.setNettyTimer(TIMER);
 AsyncHttpClientConfig ningConfig = new AsyncHttpClientConfig.Builder()
     .addRequestFilter(new ThrottleRequestFilter(config.getMaxConnections()))
     .addRequestFilter(new AcceptEncodingRequestFilter())
     .setMaxConnectionsPerHost(config.getMaxConnectionsPerHost())
     .setConnectTimeout(config.getConnectTimeoutMillis())
     .setRequestTimeout(config.getRequestTimeoutMillis())
     .setReadTimeout(config.getRequestTimeoutMillis())
     .setMaxRedirects(config.getMaxRedirects())
     .setFollowRedirect(config.isFollowRedirects())
     .setHostnameVerifier(new NingHostnameVerifier(config.getSSLConfig()))
     .setSSLContext(NingSSLContext.forConfig(config.getSSLConfig()))
     .setAsyncHttpClientProviderConfig(nettyConfig)
     .setUserAgent(config.getUserAgent())
     .setIOThreadMultiplier(1)
     .build();
 this.ningClient = new com.ning.http.client.AsyncHttpClient(ningConfig);
 this.requestConverter = new NingHttpRequestConverter(config.getObjectMapper());
 this.defaultOptions = config.getOptions();
 this.mapper = config.getObjectMapper();
}
com.hubspot.horizonHttpConfiggetUserAgent

Popular methods of HttpConfig

  • newBuilder
  • getConnectTimeoutMillis
  • getMaxConnections
  • getMaxConnectionsPerHost
  • getMaxRedirects
  • getObjectMapper
  • getOptions
  • getRequestTimeoutMillis
  • getSSLConfig
  • isFollowRedirects
  • <init>
  • getDefaultKeepAliveMillis
  • <init>,
  • getDefaultKeepAliveMillis,
  • isRejectRelativeRedirects

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Kernel (java.awt.image)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now