Class HttpWrapper

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public final class HttpWrapper
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpWrapper​(java.util.function.Consumer<org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder> builderConfigurer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient client()  
      void close()  
      <T> java.util.concurrent.CompletableFuture<OreResponse<T>> get​(java.net.URI destination, org.apache.hc.core5.http.nio.AsyncEntityConsumer<T> responseConsumer)  
      <T> java.util.concurrent.CompletableFuture<OreResponse<T>> request​(org.apache.hc.client5.http.async.methods.SimpleHttpRequest request, org.apache.hc.core5.http.nio.AsyncEntityConsumer<T> responseConsumer)  
      <T> java.util.concurrent.CompletableFuture<OreResponse<T>> request​(org.apache.hc.core5.http.nio.AsyncRequestProducer request, org.apache.hc.core5.http.nio.AsyncEntityConsumer<T> responseConsumer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpWrapper

        public HttpWrapper​(java.util.function.Consumer<org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder> builderConfigurer)
    • Method Detail

      • client

        public org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient client()
      • request

        public <T> java.util.concurrent.CompletableFuture<OreResponse<T>> request​(org.apache.hc.client5.http.async.methods.SimpleHttpRequest request,
                                                                                  org.apache.hc.core5.http.nio.AsyncEntityConsumer<T> responseConsumer)
      • request

        public <T> java.util.concurrent.CompletableFuture<OreResponse<T>> request​(org.apache.hc.core5.http.nio.AsyncRequestProducer request,
                                                                                  org.apache.hc.core5.http.nio.AsyncEntityConsumer<T> responseConsumer)
      • get

        public <T> java.util.concurrent.CompletableFuture<OreResponse<T>> get​(java.net.URI destination,
                                                                              org.apache.hc.core5.http.nio.AsyncEntityConsumer<T> responseConsumer)
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException