Class AbstractBase<B extends AbstractBase<B>>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​okhttp3.Interceptor> headerInterceptors  
      protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headerValues  
      protected okhttp3.OkHttpClient.Builder okhttpBuilder  
      protected retrofit2.Retrofit retrofit  
      protected retrofit2.Retrofit.Builder retrofitBuilder  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void buildRetrofit()
      Re-build the retrofit context.
      B connectTimeout​(long connectTimeout)
      The timeout unit is seconds.
      B depth​(java.lang.String value)
      Sets the depth.
      B enrichers​(boolean append, java.lang.String type, java.lang.String enricher, java.lang.String... enrichers)  
      B enrichers​(java.lang.String type, java.lang.String enricher, java.lang.String... enrichers)
      Replaces the current enrichers associate to the input type by the input one.
      B enrichersForDocument​(java.lang.String enricher, java.lang.String... enrichers)
      Replaces the current enrichers associate to document type by the input one.
      B fetchProperties​(boolean append, java.lang.String fetch, java.lang.String fetchProperty, java.lang.String... fetchProperties)  
      B fetchProperties​(java.lang.String type, java.lang.String fetchProperty, java.lang.String... fetchProperties)
      Replaces the current fetch properties associate to the input type by the input one.
      B fetchPropertiesForDocument​(java.lang.String fetchProperty, java.lang.String... fetchProperties)
      Replaces the current fetch properties associate to document type by the input one.
      B fetchPropertiesForGroup​(java.lang.String fetchProperty, java.lang.String... fetchProperties)
      Replaces the current fetch properties associate to group type by the input one.
      B header​(boolean append, java.lang.String header, int value, int... values)
      Replaces or appends the header value with the input one separated by ','.
      B header​(boolean append, java.lang.String header, java.io.Serializable value, java.io.Serializable... values)
      Replaces or appends the header value with the input one separated by ','.
      B header​(boolean append, java.lang.String header, java.lang.String value, java.lang.String... values)
      Replaces or appends the input header value with the input one separated by ','.
      B header​(java.lang.String header, boolean value)
      Replaces the header value with input one.
      B header​(java.lang.String header, int value, int... values)
      Replaces the header value with the input one separated by ','.
      B header​(java.lang.String header, java.io.Serializable value, java.io.Serializable... values)
      Replaces the header value with the input one separated by ','.
      B header​(java.lang.String header, java.lang.String value, java.lang.String... values)
      Replaces the header value with the input one separated by ','.
      B readTimeout​(long readTimeout)
      The timeout unit is seconds.
      protected void replaceWith​(AbstractBase<?> base)
      Replaces the input AbstractBase into this one.
      B retryOnConnectionFailure​(boolean enable)
      Sets retry on connection failure or not.
      B schemas​(boolean append, java.lang.String property, java.lang.String... properties)  
      B schemas​(java.lang.String property, java.lang.String... properties)
      Replaces the current schemas by the input one.
      B timeout​(long timeout)
      Sets the given timeout to connect, read and write timeout settings of client.
      B transactionTimeout​(long timeout)  
      B version​(java.lang.String value)  
      B writeTimeout​(long writeTimeout)
      The timeout unit is seconds.
      • Methods inherited from class java.lang.Object

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

      • okhttpBuilder

        protected okhttp3.OkHttpClient.Builder okhttpBuilder
      • retrofitBuilder

        protected retrofit2.Retrofit.Builder retrofitBuilder
      • headerInterceptors

        protected java.util.Map<java.lang.String,​okhttp3.Interceptor> headerInterceptors
      • headerValues

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headerValues
      • retrofit

        protected retrofit2.Retrofit retrofit
    • Constructor Detail

      • AbstractBase

        public AbstractBase()
      • AbstractBase

        protected AbstractBase​(AbstractBase<?> base)
    • Method Detail

      • retryOnConnectionFailure

        public B retryOnConnectionFailure​(boolean enable)
        Sets retry on connection failure or not.
      • timeout

        public B timeout​(long timeout)
        Sets the given timeout to connect, read and write timeout settings of client. The timeout unit is seconds.
      • connectTimeout

        public B connectTimeout​(long connectTimeout)
        The timeout unit is seconds.
      • readTimeout

        public B readTimeout​(long readTimeout)
        The timeout unit is seconds.
      • writeTimeout

        public B writeTimeout​(long writeTimeout)
        The timeout unit is seconds.
      • header

        public B header​(java.lang.String header,
                        boolean value)
        Replaces the header value with input one.
        Since:
        3.2
      • header

        public B header​(java.lang.String header,
                        int value,
                        int... values)
        Replaces the header value with the input one separated by ','.
        Since:
        3.2
      • header

        public B header​(boolean append,
                        java.lang.String header,
                        int value,
                        int... values)
        Replaces or appends the header value with the input one separated by ','.
        Since:
        3.2
      • header

        public B header​(java.lang.String header,
                        java.io.Serializable value,
                        java.io.Serializable... values)
        Replaces the header value with the input one separated by ','.
        Since:
        3.2
      • header

        public B header​(boolean append,
                        java.lang.String header,
                        java.io.Serializable value,
                        java.io.Serializable... values)
        Replaces or appends the header value with the input one separated by ','.
        Since:
        3.2
      • header

        public B header​(java.lang.String header,
                        java.lang.String value,
                        java.lang.String... values)
        Replaces the header value with the input one separated by ','.
      • header

        public B header​(boolean append,
                        java.lang.String header,
                        java.lang.String value,
                        java.lang.String... values)
        Replaces or appends the input header value with the input one separated by ','.
      • transactionTimeout

        public B transactionTimeout​(long timeout)
      • enrichers

        public B enrichers​(boolean append,
                           java.lang.String type,
                           java.lang.String enricher,
                           java.lang.String... enrichers)
      • enrichers

        public B enrichers​(java.lang.String type,
                           java.lang.String enricher,
                           java.lang.String... enrichers)
        Replaces the current enrichers associate to the input type by the input one.
      • enrichersForDocument

        public B enrichersForDocument​(java.lang.String enricher,
                                      java.lang.String... enrichers)
        Replaces the current enrichers associate to document type by the input one.
      • fetchProperties

        public B fetchProperties​(boolean append,
                                 java.lang.String fetch,
                                 java.lang.String fetchProperty,
                                 java.lang.String... fetchProperties)
      • fetchProperties

        public B fetchProperties​(java.lang.String type,
                                 java.lang.String fetchProperty,
                                 java.lang.String... fetchProperties)
        Replaces the current fetch properties associate to the input type by the input one.
      • fetchPropertiesForDocument

        public B fetchPropertiesForDocument​(java.lang.String fetchProperty,
                                            java.lang.String... fetchProperties)
        Replaces the current fetch properties associate to document type by the input one.
      • fetchPropertiesForGroup

        public B fetchPropertiesForGroup​(java.lang.String fetchProperty,
                                         java.lang.String... fetchProperties)
        Replaces the current fetch properties associate to group type by the input one. Possible values are:
        • memberUsers
        • memberGroups
        • parentGroups
      • depth

        public B depth​(java.lang.String value)
        Sets the depth. Possible values are: `root`, `children` and `max`.
        See Also:
        org.nuxeo.ecm.core.io.registry.context.DepthValues
      • version

        public B version​(java.lang.String value)
      • schemas

        public B schemas​(boolean append,
                         java.lang.String property,
                         java.lang.String... properties)
      • schemas

        public B schemas​(java.lang.String property,
                         java.lang.String... properties)
        Replaces the current schemas by the input one.
      • buildRetrofit

        protected void buildRetrofit()
        Re-build the retrofit context.

        You may want to override this method if you want to do more with the built retrofit, for instance create a new retrofit API.

      • replaceWith

        protected final void replaceWith​(AbstractBase<?> base)
        Replaces the input AbstractBase into this one. This method will create a new retrofit object in order to correctly isolate this configuration.

        DON'T REMOVE FINAL KEYWORD, THIS METHOD IS USED IN A CONSTRUCTOR.

        Parameters:
        base - the base to replace