Class BaseRestClient<T>

    • Field Detail

      • baseEndpoint

        protected final String baseEndpoint
      • mapper

        protected final com.fasterxml.jackson.databind.ObjectMapper mapper
      • reader

        protected final com.fasterxml.jackson.databind.ObjectReader reader
      • serverUri

        protected final URI serverUri
      • targetType

        protected final Class<T> targetType
    • Constructor Detail

      • BaseRestClient

        public BaseRestClient​(HttpClient http,
                              String serverUrl,
                              Class<T> targetType,
                              com.fasterxml.jackson.databind.ObjectMapper mapper,
                              String baseEndpoint)
    • Method Detail

      • create

        public T create()
                 throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • createFullUri

        public URI createFullUri​(String requestUrl)
      • doDeleteRequestForString

        protected String doDeleteRequestForString​(String requestUrl)
                                           throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doGetRequestForObject

        protected T doGetRequestForObject​(String requestUrl)
                                   throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doGetRequestForObject

        protected Object doGetRequestForObject​(String requestUrl,
                                               Class<?> targetType)
                                        throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doGetRequestForObjectList

        protected List<T> doGetRequestForObjectList​(String requestUrl)
                                             throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doGetRequestForObjectList

        protected List doGetRequestForObjectList​(String requestUrl,
                                                 Class<?> targetType)
                                          throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doGetRequestForObjectList

        protected List doGetRequestForObjectList​(String requestUrl,
                                                 Class<?> targetType,
                                                 de.digitalcollections.model.list.filtering.Filtering filtering)
                                          throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doGetRequestForPagedObjectList

        protected de.digitalcollections.model.list.paging.PageResponse<T> doGetRequestForPagedObjectList​(String requestUrl,
                                                                                                         de.digitalcollections.model.list.paging.PageRequest pageRequest)
                                                                                                  throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doGetRequestForPagedObjectList

        protected de.digitalcollections.model.list.paging.PageResponse doGetRequestForPagedObjectList​(String requestUrl,
                                                                                                      de.digitalcollections.model.list.paging.PageRequest pageRequest,
                                                                                                      Class<?> targetType)
                                                                                               throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doGetRequestForString

        protected String doGetRequestForString​(String requestUrl)
                                        throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPatchRequestForString

        protected String doPatchRequestForString​(String requestUrl)
                                          throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPatchRequestForString

        protected String doPatchRequestForString​(String requestUrl,
                                                 Object object)
                                          throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPostRequestForObject

        protected T doPostRequestForObject​(String requestUrl,
                                           T object)
                                    throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPostRequestForObject

        protected Object doPostRequestForObject​(String requestUrl,
                                                Object bodyObject,
                                                Class<?> targetType)
                                         throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPostRequestForObject

        protected T doPostRequestForObject​(String requestUrl)
                                    throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPostRequestForObject

        protected Object doPostRequestForObject​(String requestUrl,
                                                Class<?> targetType)
                                         throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPostRequestForObjectList

        protected List<T> doPostRequestForObjectList​(String requestUrl,
                                                     List<T> list)
                                              throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPostRequestForObjectList

        protected List<Class<?>> doPostRequestForObjectList​(String requestUrl,
                                                            List<Class<?>> list,
                                                            Class<?> targetType)
                                                     throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPostRequestForString

        protected String doPostRequestForString​(String requestUrl)
                                         throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPostRequestForString

        protected String doPostRequestForString​(String requestUrl,
                                                Object object)
                                         throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPutRequestForObject

        protected T doPutRequestForObject​(String requestUrl,
                                          T object)
                                   throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPutRequestForObject

        protected Object doPutRequestForObject​(String requestUrl,
                                               Object bodyObject,
                                               Class<?> targetType)
                                        throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPutRequestForObjectList

        protected List<Class<?>> doPutRequestForObjectList​(String requestUrl,
                                                           List<Class<?>> list,
                                                           Class<?> targetType)
                                                    throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • doPutRequestForString

        protected String doPutRequestForString​(String requestUrl,
                                               Object object)
                                        throws de.digitalcollections.model.exception.TechnicalException
        Throws:
        de.digitalcollections.model.exception.TechnicalException
      • filterCriterionToUrlParam

        protected String filterCriterionToUrlParam​(de.digitalcollections.model.list.filtering.FilterCriterion filterCriterion)
      • getBaseEndpoint

        public String getBaseEndpoint()
        Get the base endpoint path for testing purposes
        Returns:
        the relative base endpoint of the client