Class ClientBase

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    DefaultZmsClient, DefaultZtsClient

    public abstract class ClientBase
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Author:
    bjorncs
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ClientBase​(java.lang.String userAgent, java.util.function.Supplier<javax.net.ssl.SSLContext> sslContextSupplier, ClientBase.ClientExceptionFactory exceptionFactory, javax.net.ssl.HostnameVerifier hostnameVerifier)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      protected <T> T execute​(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.client.ResponseHandler<T> responseHandler)  
      protected <T> T readEntity​(org.apache.http.HttpResponse response, java.lang.Class<T> entityType)  
      protected org.apache.http.entity.StringEntity toJsonStringEntity​(java.lang.Object entity)  
      • Methods inherited from class java.lang.Object

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

      • ClientBase

        protected ClientBase​(java.lang.String userAgent,
                             java.util.function.Supplier<javax.net.ssl.SSLContext> sslContextSupplier,
                             ClientBase.ClientExceptionFactory exceptionFactory,
                             javax.net.ssl.HostnameVerifier hostnameVerifier)
    • Method Detail

      • execute

        protected <T> T execute​(org.apache.http.client.methods.HttpUriRequest request,
                                org.apache.http.client.ResponseHandler<T> responseHandler)
      • toJsonStringEntity

        protected org.apache.http.entity.StringEntity toJsonStringEntity​(java.lang.Object entity)
      • readEntity

        protected <T> T readEntity​(org.apache.http.HttpResponse response,
                                   java.lang.Class<T> entityType)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable