Class CudamiBaseClient<T>
- java.lang.Object
-
- de.digitalcollections.cudami.client.CudamiBaseClient<T>
-
- Direct Known Subclasses:
CudamiArticlesClient,CudamiCollectionsClient,CudamiConfigClient,CudamiEntitiesClient,CudamiEntityRelationsClient,CudamiHeadwordEntriesClient,CudamiHeadwordsClient,CudamiIdentifiablesClient,CudamiIdentifierTypesClient,CudamiLocalesClient,CudamiPredicatesClient,CudamiProjectsClient,CudamiRenderingTemplatesClient,CudamiTopicsClient,CudamiUrlAliasClient,CudamiUsersClient,CudamiWebpagesClient,CudamiWebsitesClient
public class CudamiBaseClient<T> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected HttpClienthttpprotected com.fasterxml.jackson.databind.ObjectMappermapperprotected com.fasterxml.jackson.databind.ObjectReaderreaderprotected URIserverUriprotected Class<T>targetType
-
Constructor Summary
Constructors Constructor Description CudamiBaseClient(HttpClient http, String serverUrl, Class<T> targetType, com.fasterxml.jackson.databind.ObjectMapper mapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected URIcreateFullUri(String requestUrl)protected StringdoDeleteRequestForString(String requestUrl)protected TdoGetRequestForObject(String requestUrl)protected ObjectdoGetRequestForObject(String requestUrl, Class<?> targetType)protected List<T>doGetRequestForObjectList(String requestUrl)protected ListdoGetRequestForObjectList(String requestUrl, Class<?> targetType)protected ListdoGetRequestForObjectList(String requestUrl, Class<?> targetType, de.digitalcollections.model.filter.Filtering filtering)protected de.digitalcollections.model.paging.PageResponse<T>doGetRequestForPagedObjectList(String requestUrl, de.digitalcollections.model.paging.PageRequest pageRequest)protected de.digitalcollections.model.paging.PageResponsedoGetRequestForPagedObjectList(String requestUrl, de.digitalcollections.model.paging.PageRequest pageRequest, Class<?> targetType)protected StringdoGetRequestForString(String requestUrl)protected de.digitalcollections.model.paging.SearchPageResponse<T>doGetSearchRequestForPagedObjectList(String requestUrl, de.digitalcollections.model.paging.SearchPageRequest searchPageRequest)protected <X> de.digitalcollections.model.paging.SearchPageResponse<X>doGetSearchRequestForPagedObjectList(String requestUrl, de.digitalcollections.model.paging.SearchPageRequest searchPageRequest, Class<X> type)protected StringdoPatchRequestForString(String requestUrl)protected StringdoPatchRequestForString(String requestUrl, Object object)protected TdoPostRequestForObject(String requestUrl)protected ObjectdoPostRequestForObject(String requestUrl, Class<?> targetType)protected ObjectdoPostRequestForObject(String requestUrl, Object bodyObject, Class<?> targetType)protected TdoPostRequestForObject(String requestUrl, T object)protected List<Class<?>>doPostRequestForObjectList(String requestUrl, List<Class<?>> list, Class<?> targetType)protected List<T>doPostRequestForObjectList(String requestUrl, List<T> list)protected StringdoPostRequestForString(String requestUrl)protected StringdoPostRequestForString(String requestUrl, Object object)protected ObjectdoPutRequestForObject(String requestUrl, Object bodyObject, Class<?> targetType)protected TdoPutRequestForObject(String requestUrl, T object)protected List<Class<?>>doPutRequestForObjectList(String requestUrl, List<Class<?>> list, Class<?> targetType)protected StringdoPutRequestForString(String requestUrl, Object object)de.digitalcollections.model.paging.PageResponse<T>findByLanguageAndInitial(String baseUrl, int pageNumber, int pageSize, String sortField, String sortDirection, String nullHandling, String language, String initial)de.digitalcollections.model.paging.PageResponse<T>findByLanguageAndInitial(String baseUrl, de.digitalcollections.model.paging.PageRequest pageRequest, String language, String initial)
-
-
-
Field Detail
-
http
protected final HttpClient http
-
mapper
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
-
reader
protected final com.fasterxml.jackson.databind.ObjectReader reader
-
serverUri
protected final URI serverUri
-
-
Constructor Detail
-
CudamiBaseClient
public CudamiBaseClient(HttpClient http, String serverUrl, Class<T> targetType, com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Detail
-
doDeleteRequestForString
protected String doDeleteRequestForString(String requestUrl) throws HttpException
- Throws:
HttpException
-
doGetRequestForObject
protected T doGetRequestForObject(String requestUrl) throws HttpException
- Throws:
HttpException
-
doGetRequestForObject
protected Object doGetRequestForObject(String requestUrl, Class<?> targetType) throws HttpException
- Throws:
HttpException
-
doGetRequestForObjectList
protected List<T> doGetRequestForObjectList(String requestUrl) throws HttpException
- Throws:
HttpException
-
doGetRequestForObjectList
protected List doGetRequestForObjectList(String requestUrl, Class<?> targetType) throws HttpException
- Throws:
HttpException
-
doGetRequestForObjectList
protected List doGetRequestForObjectList(String requestUrl, Class<?> targetType, de.digitalcollections.model.filter.Filtering filtering) throws HttpException
- Throws:
HttpException
-
doGetRequestForPagedObjectList
protected de.digitalcollections.model.paging.PageResponse<T> doGetRequestForPagedObjectList(String requestUrl, de.digitalcollections.model.paging.PageRequest pageRequest) throws HttpException
- Throws:
HttpException
-
doGetRequestForPagedObjectList
protected de.digitalcollections.model.paging.PageResponse doGetRequestForPagedObjectList(String requestUrl, de.digitalcollections.model.paging.PageRequest pageRequest, Class<?> targetType) throws HttpException
- Throws:
HttpException
-
doGetRequestForString
protected String doGetRequestForString(String requestUrl) throws HttpException
- Throws:
HttpException
-
doGetSearchRequestForPagedObjectList
protected <X> de.digitalcollections.model.paging.SearchPageResponse<X> doGetSearchRequestForPagedObjectList(String requestUrl, de.digitalcollections.model.paging.SearchPageRequest searchPageRequest, Class<X> type) throws HttpException
- Throws:
HttpException
-
doGetSearchRequestForPagedObjectList
protected de.digitalcollections.model.paging.SearchPageResponse<T> doGetSearchRequestForPagedObjectList(String requestUrl, de.digitalcollections.model.paging.SearchPageRequest searchPageRequest) throws HttpException
- Throws:
HttpException
-
doPatchRequestForString
protected String doPatchRequestForString(String requestUrl) throws HttpException
- Throws:
HttpException
-
doPatchRequestForString
protected String doPatchRequestForString(String requestUrl, Object object) throws HttpException
- Throws:
HttpException
-
doPostRequestForObject
protected T doPostRequestForObject(String requestUrl, T object) throws HttpException
- Throws:
HttpException
-
doPostRequestForObject
protected Object doPostRequestForObject(String requestUrl, Object bodyObject, Class<?> targetType) throws HttpException
- Throws:
HttpException
-
doPostRequestForObject
protected T doPostRequestForObject(String requestUrl) throws HttpException
- Throws:
HttpException
-
doPostRequestForObject
protected Object doPostRequestForObject(String requestUrl, Class<?> targetType) throws HttpException
- Throws:
HttpException
-
doPostRequestForObjectList
protected List<T> doPostRequestForObjectList(String requestUrl, List<T> list) throws HttpException
- Throws:
HttpException
-
doPostRequestForObjectList
protected List<Class<?>> doPostRequestForObjectList(String requestUrl, List<Class<?>> list, Class<?> targetType) throws HttpException
- Throws:
HttpException
-
doPostRequestForString
protected String doPostRequestForString(String requestUrl) throws HttpException
- Throws:
HttpException
-
doPostRequestForString
protected String doPostRequestForString(String requestUrl, Object object) throws HttpException
- Throws:
HttpException
-
doPutRequestForObject
protected T doPutRequestForObject(String requestUrl, T object) throws HttpException
- Throws:
HttpException
-
doPutRequestForObject
protected Object doPutRequestForObject(String requestUrl, Object bodyObject, Class<?> targetType) throws HttpException
- Throws:
HttpException
-
doPutRequestForObjectList
protected List<Class<?>> doPutRequestForObjectList(String requestUrl, List<Class<?>> list, Class<?> targetType) throws HttpException
- Throws:
HttpException
-
doPutRequestForString
protected String doPutRequestForString(String requestUrl, Object object) throws HttpException
- Throws:
HttpException
-
findByLanguageAndInitial
public de.digitalcollections.model.paging.PageResponse<T> findByLanguageAndInitial(String baseUrl, de.digitalcollections.model.paging.PageRequest pageRequest, String language, String initial) throws HttpException
- Throws:
HttpException
-
findByLanguageAndInitial
public de.digitalcollections.model.paging.PageResponse<T> findByLanguageAndInitial(String baseUrl, int pageNumber, int pageSize, String sortField, String sortDirection, String nullHandling, String language, String initial) throws HttpException
- Throws:
HttpException
-
-