Package org.nuxeo.client
Class NuxeoClient
- java.lang.Object
-
- org.nuxeo.client.objects.AbstractBase<NuxeoClient>
-
- org.nuxeo.client.NuxeoClient
-
public class NuxeoClient extends AbstractBase<NuxeoClient>
- Since:
- 0.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNuxeoClient.BuilderNuxeoClientbuilder.
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.PatternCMIS_PRODUCT_VERSION_PATTERNprotected NuxeoConverterFactoryconverterFactoryprotected UsercurrentUserprotected NuxeoResponseCachenuxeoCacheprotected NuxeoVersionserverVersion-
Fields inherited from class org.nuxeo.client.objects.AbstractBase
headerInterceptors, headerValues, okhttpBuilder, retrofit, retrofitBuilder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNuxeoClient(NuxeoClient.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddOkHttpInterceptor(okhttp3.Interceptor interceptor)Used by unit tests.BatchUploadManagerbatchUploadManager()protected java.lang.StringcomputeCacheKey(retrofit2.Call<?> call)Compute the cache key with requestprotected java.lang.StringcomputeUserAgent()ConfigManagerconfigManager()protected java.lang.StringdecodeFilename(java.lang.String contentDisposition)okhttp3.Responsedelete(java.lang.String url)okhttp3.Responsedelete(java.lang.String url, java.lang.String json)DirectoryManagerdirectoryManager()voiddisconnect()<T> TfetchResponse(retrofit2.Call<T> call)<T> voidfetchResponse(retrofit2.Call<T> call, retrofit2.Callback<T> callback)okhttp3.Responseget(java.lang.String url)HTTP Services *NuxeoConverterFactorygetConverterFactory()Client Services *UsergetCurrentUser()This method returns the current logged user retrieved onNuxeoClientcreation.NuxeoResponseCachegetNuxeoCache()NuxeoVersiongetServerVersion()This method gets the Nuxeo server version from CMIS the first time and then caches it.protected <T> retrofit2.Response<T>handleResponse(retrofit2.Call<T> call, retrofit2.Response<T> response)booleanisCacheEnabled()Operationoperation(java.lang.String operationId)okhttp3.Responsepost(java.lang.String url, java.lang.String json)okhttp3.Responseput(java.lang.String url, java.lang.String json)NuxeoClientrefreshCache()Repositoryrepository()Repositoryrepository(java.lang.String repositoryName)protected okhttp3.Responserequest(java.lang.String url, java.util.function.UnaryOperator<okhttp3.Request.Builder> method)TaskManagertaskManager()protected booleanuseCache(retrofit2.Call<?> call)UserManageruserManager()-
Methods inherited from class org.nuxeo.client.objects.AbstractBase
buildRetrofit, connectTimeout, depth, enrichers, enrichers, enrichersForDocument, fetchProperties, fetchProperties, fetchPropertiesForDocument, fetchPropertiesForGroup, header, header, header, header, header, header, header, readTimeout, replaceWith, retryOnConnectionFailure, schemas, schemas, timeout, transactionTimeout, version, writeTimeout
-
-
-
-
Field Detail
-
CMIS_PRODUCT_VERSION_PATTERN
public static final java.util.regex.Pattern CMIS_PRODUCT_VERSION_PATTERN
-
converterFactory
protected final NuxeoConverterFactory converterFactory
-
nuxeoCache
protected NuxeoResponseCache nuxeoCache
-
currentUser
protected User currentUser
-
serverVersion
protected NuxeoVersion serverVersion
-
-
Constructor Detail
-
NuxeoClient
protected NuxeoClient(NuxeoClient.Builder builder)
-
-
Method Detail
-
addOkHttpInterceptor
protected void addOkHttpInterceptor(okhttp3.Interceptor interceptor)
Used by unit tests.
-
computeUserAgent
protected java.lang.String computeUserAgent()
-
getConverterFactory
public NuxeoConverterFactory getConverterFactory()
Client Services *
-
getNuxeoCache
public NuxeoResponseCache getNuxeoCache()
-
isCacheEnabled
public boolean isCacheEnabled()
-
refreshCache
public NuxeoClient refreshCache()
-
disconnect
public void disconnect()
-
getCurrentUser
public User getCurrentUser()
This method returns the current logged user retrieved onNuxeoClientcreation.- Returns:
- the current logged user.
-
getServerVersion
public NuxeoVersion getServerVersion()
This method gets the Nuxeo server version from CMIS the first time and then caches it.- Returns:
- The Nuxeo server version.
-
repository
public Repository repository()
- Returns:
- A repository service linked to `default` repository in Nuxeo.
-
repository
public Repository repository(java.lang.String repositoryName)
-
operation
public Operation operation(java.lang.String operationId)
-
userManager
public UserManager userManager()
-
directoryManager
public DirectoryManager directoryManager()
-
taskManager
public TaskManager taskManager()
-
batchUploadManager
public BatchUploadManager batchUploadManager()
-
configManager
public ConfigManager configManager()
-
get
public okhttp3.Response get(java.lang.String url)
HTTP Services *
-
delete
public okhttp3.Response delete(java.lang.String url)
-
delete
public okhttp3.Response delete(java.lang.String url, java.lang.String json)
-
put
public okhttp3.Response put(java.lang.String url, java.lang.String json)
-
post
public okhttp3.Response post(java.lang.String url, java.lang.String json)
-
request
protected okhttp3.Response request(java.lang.String url, java.util.function.UnaryOperator<okhttp3.Request.Builder> method)
-
fetchResponse
public <T> T fetchResponse(retrofit2.Call<T> call)
-
fetchResponse
public <T> void fetchResponse(retrofit2.Call<T> call, retrofit2.Callback<T> callback)
-
handleResponse
protected <T> retrofit2.Response<T> handleResponse(retrofit2.Call<T> call, retrofit2.Response<T> response)
-
decodeFilename
protected java.lang.String decodeFilename(java.lang.String contentDisposition)
-
useCache
protected boolean useCache(retrofit2.Call<?> call)
-
computeCacheKey
protected java.lang.String computeCacheKey(retrofit2.Call<?> call)
Compute the cache key with request
-
-