Class AbstractApiClient

    • Field Detail

      • log

        protected org.slf4j.Logger log
      • baseUrl

        protected String baseUrl
      • trustAll

        protected boolean trustAll
      • connectionRequestTimeout

        protected Duration connectionRequestTimeout
      • connectTimeout

        protected Duration connectTimeout
      • socketTimeout

        protected Duration socketTimeout
      • maxConnections

        protected Integer maxConnections
      • maxConnectionsPerRoute

        protected Integer maxConnectionsPerRoute
      • maxConnectionsNoTimeout

        protected Integer maxConnectionsNoTimeout
      • maxConnectionsPerRouteNoTimeout

        protected Integer maxConnectionsPerRouteNoTimeout
      • connectionInPoolTTL

        protected Duration connectionInPoolTTL
      • validateAfterInactivity

        protected Duration validateAfterInactivity
      • countWindow

        protected Duration countWindow
      • bucketCount

        protected Integer bucketCount
      • warnThreshold

        protected Duration warnThreshold
      • acceptableLanguages

        protected List<Locale> acceptableLanguages
      • accept

        protected javax.ws.rs.core.MediaType accept
      • contentType

        protected javax.ws.rs.core.MediaType contentType
      • browserCache

        protected boolean browserCache
      • mbeanName

        protected String mbeanName
      • registerMBean

        protected boolean registerMBean
      • userAgent

        protected final String userAgent
      • eager

        protected boolean eager
    • Method Detail

      • postConstruct

        @PostConstruct
        public void postConstruct()
      • getAccept

        public javax.ws.rs.core.MediaType getAccept()
      • setAccept

        public void setAccept​(javax.ws.rs.core.MediaType mediaType)
      • getContentType

        public javax.ws.rs.core.MediaType getContentType()
      • setContentType

        public void setContentType​(javax.ws.rs.core.MediaType mediaType)
      • setTrustAll

        public void setTrustAll​(boolean b)
      • setObjectMapper

        public void setObjectMapper​(Jackson2Mapper objectMapper)
      • getObjectName

        protected ObjectName getObjectName()
      • produceIfNull

        protected <T> T produceIfNull​(Supplier<T> supplier,
                                      Supplier<T> producer)
        Checks whether supplier has null, if so produces it while locking, so it happens only once
      • getClientHttpEngine

        public org.jboss.resteasy.client.jaxrs.ClientHttpEngine getClientHttpEngine()
      • getClientHttpEngineNoTimeout

        public org.jboss.resteasy.client.jaxrs.ClientHttpEngine getClientHttpEngineNoTimeout()
      • setCountWindow

        public void setCountWindow​(Duration countWindow)
      • setWarnThreshold

        public void setWarnThreshold​(Duration warnThreshold)
      • setAcceptableLanguages

        public void setAcceptableLanguages​(List<Locale> acceptableLanguages)
      • build

        protected <T,​S,​E> T build​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                                              Class<T> service,
                                              Class<S> restEasyService,
                                              Class<E> errorClass,
                                              Consumer<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> buildFurther)
      • proxyErrorsAndCount

        protected <T> T proxyErrorsAndCount​(Class<T> service,
                                            T proxy)
      • proxyErrorsAndCount

        protected <T,​E> T proxyErrorsAndCount​(Class<T> service,
                                                    T proxy,
                                                    Class<E> errorClass)
      • proxyErrors

        protected <T> T proxyErrors​(Class<T> service,
                                    T proxy)
      • proxyErrors

        protected <T,​E> T proxyErrors​(Class<T> service,
                                            T proxy,
                                            Class<E> errorClass)
        Type Parameters:
        T - The type of the service interface
        Parameters:
        service - The service interface
        proxy - The current proxy object for the service interface
        errorClass - The class representing an error
        Returns:
        A new proxy, with the functionality of ErrorAspect added.
      • proxyCounter

        protected <T> T proxyCounter​(Class<T> service,
                                     T proxy)
        Type Parameters:
        T - The type of the service interface
        Parameters:
        service - The service interface
        proxy - The current proxy object for the service interface
        Returns:
        A new proxy, with the functionality of CountAspect added.
      • build

        protected <T> T build​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                              Class<T> service,
                              Consumer<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> buildFurther)
      • build

        protected <T> T build​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                              Class<T> service)
      • build

        protected <T,​S> T build​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                                      Class<T> service,
                                      Class<S> restEasyInterface,
                                      Consumer<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> buildFurther)
      • buildWithErrorClass

        protected <T,​S> T buildWithErrorClass​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                                                    Class<T> service,
                                                    Class<S> restEasyInterface,
                                                    Class<?> errorClass,
                                                    Consumer<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> buildFurther)
      • buildWithErrorClass

        protected <T,​S> T buildWithErrorClass​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                                                    Class<T> service,
                                                    Class<S> restEasyInterface,
                                                    Class<?> errorClass)
      • buildWithErrorClass

        protected <T> T buildWithErrorClass​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                                            Class<T> service,
                                            Class<?> errorClass,
                                            Consumer<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> buildFurther)
      • buildWithErrorClass

        protected <T> T buildWithErrorClass​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                                            Class<T> service,
                                            Class<?> errorClass)
      • build

        protected <T> T build​(Class<T> service,
                              Consumer<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> buildFurther)
      • build

        protected <T> T build​(Class<T> service)
      • resteasyClientBuilder

        protected org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder resteasyClientBuilder​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                                                                                              Consumer<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> buildFurther)
      • defaultResteasyClientBuilder

        protected org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder defaultResteasyClientBuilder​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine)
      • buildResteasy

        protected void buildResteasy​(org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder builder)
        For further building the client you can override this method. If you need more control you can also use the several 'buildFurther' arguments.
      • getTarget

        protected final org.jboss.resteasy.client.jaxrs.ResteasyWebTarget getTarget​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine,
                                                                                    Consumer<org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder> buildFurther)
      • getTarget

        protected final org.jboss.resteasy.client.jaxrs.ResteasyWebTarget getTarget​(org.jboss.resteasy.client.jaxrs.ClientHttpEngine engine)
      • getInfo

        protected String getInfo()
      • getBrowserCache

        public org.jboss.resteasy.client.jaxrs.cache.BrowserCache getBrowserCache()
      • clearBrowserCache

        public void clearBrowserCache()
      • setBrowserCache

        public void setBrowserCache​(javax.cache.Cache<?,​?> browserCache)
        Default the client is backed by a LightweightBrowserCache, you may replace it by JavaxBrowserCache, backed with a more generic Cache, so that the client can hitch on your preferred caching framework.
      • setBrowserCache

        public void setBrowserCache​(org.jboss.resteasy.client.jaxrs.cache.BrowserCache browserCache)
      • setBrowserCache

        public void setBrowserCache​(boolean browserCache)
      • shutdown

        @PreDestroy
        public void shutdown()
      • closeClients

        protected void closeClients()
      • getWarnThreshold

        public Duration getWarnThreshold()
      • getAcceptableLanguages

        public List<Locale> getAcceptableLanguages()