Package org.nuxeo.client.objects
Class AbstractBase<B extends AbstractBase<B>>
- java.lang.Object
-
- org.nuxeo.client.objects.AbstractBase<B>
-
- Type Parameters:
B- The type of object extending this one.
- Direct Known Subclasses:
AbstractConnectable,NuxeoClient,NuxeoClient.Builder
public class AbstractBase<B extends AbstractBase<B>> extends java.lang.Object- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,okhttp3.Interceptor>headerInterceptorsprotected java.util.Map<java.lang.String,java.util.List<java.lang.String>>headerValuesprotected okhttp3.OkHttpClient.BuilderokhttpBuilderprotected retrofit2.Retrofitretrofitprotected retrofit2.Retrofit.BuilderretrofitBuilder
-
Constructor Summary
Constructors Modifier Constructor Description AbstractBase()protectedAbstractBase(AbstractBase<?> base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildRetrofit()Re-build the retrofit context.BconnectTimeout(long connectTimeout)The timeout unit is seconds.Bdepth(java.lang.String value)Sets the depth.Benrichers(boolean append, java.lang.String type, java.lang.String enricher, java.lang.String... enrichers)Benrichers(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.BenrichersForDocument(java.lang.String enricher, java.lang.String... enrichers)Replaces the current enrichers associate to document type by the input one.BfetchProperties(boolean append, java.lang.String fetch, java.lang.String fetchProperty, java.lang.String... fetchProperties)BfetchProperties(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.BfetchPropertiesForDocument(java.lang.String fetchProperty, java.lang.String... fetchProperties)Replaces the current fetch properties associate to document type by the input one.BfetchPropertiesForGroup(java.lang.String fetchProperty, java.lang.String... fetchProperties)Replaces the current fetch properties associate to group type by the input one.Bheader(boolean append, java.lang.String header, int value, int... values)Replaces or appends the header value with the input one separated by ','.Bheader(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 ','.Bheader(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 ','.Bheader(java.lang.String header, boolean value)Replaces the header value with input one.Bheader(java.lang.String header, int value, int... values)Replaces the header value with the input one separated by ','.Bheader(java.lang.String header, java.io.Serializable value, java.io.Serializable... values)Replaces the header value with the input one separated by ','.Bheader(java.lang.String header, java.lang.String value, java.lang.String... values)Replaces the header value with the input one separated by ','.BreadTimeout(long readTimeout)The timeout unit is seconds.protected voidreplaceWith(AbstractBase<?> base)Replaces the inputAbstractBaseinto this one.BretryOnConnectionFailure(boolean enable)Sets retry on connection failure or not.Bschemas(boolean append, java.lang.String property, java.lang.String... properties)Bschemas(java.lang.String property, java.lang.String... properties)Replaces the current schemas by the input one.Btimeout(long timeout)Sets the given timeout to connect, read and write timeout settings of client.BtransactionTimeout(long timeout)Bversion(java.lang.String value)BwriteTimeout(long writeTimeout)The timeout unit is seconds.
-
-
-
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 inputAbstractBaseinto 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
-
-