java.lang.Object
info.ejava.assignments.api.houserenters.client.houses.HousesAPIClient
All Implemented Interfaces:
HousesAPI

public class HousesAPIClient extends Object implements HousesAPI
  • Field Details

    • baseUrl

      protected URI baseUrl
    • restTemplate

      protected org.springframework.web.client.RestTemplate restTemplate
    • mediaType

      protected org.springframework.http.MediaType mediaType
  • Constructor Details

    • HousesAPIClient

      public HousesAPIClient(org.springframework.web.client.RestTemplate restTemplate, ServerConfig serverConfig, org.springframework.http.MediaType mediaType)
  • Method Details

    • withRestTemplate

      public HousesAPIClient withRestTemplate(org.springframework.web.client.RestTemplate restTemplate)
      Description copied from interface: HousesAPI
      Used to change the authenticated identity of the client when security has been enabled.
      Specified by:
      withRestTemplate in interface HousesAPI
      Parameters:
      restTemplate - contains basis for client/identity
      Returns:
      new client using the supplied restTemplate
    • createHouse

      public org.springframework.http.ResponseEntity<HouseDTO> createHouse(HouseDTO house)
      Specified by:
      createHouse in interface HousesAPI
    • makeRequestParams

      protected org.springframework.web.util.UriBuilder makeRequestParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, HouseSearchParams searchParams, org.springframework.data.domain.Pageable pageable)
    • findHousesBy

      public org.springframework.http.ResponseEntity<HouseListDTO> findHousesBy(HouseSearchParams searchParams, org.springframework.data.domain.Pageable pageable)
      Description copied from interface: HousesAPI
      An example query using a GET and query parameters. Useful in expressing range searches.
      Specified by:
      findHousesBy in interface HousesAPI
      Parameters:
      searchParams - object expressing min/max properties
      pageable - paging constraints
      Returns:
      list of results
    • getHouse

      public org.springframework.http.ResponseEntity<HouseDTO> getHouse(String id)
      Specified by:
      getHouse in interface HousesAPI
    • hasHouse

      public org.springframework.http.ResponseEntity<Void> hasHouse(String id)
      Specified by:
      hasHouse in interface HousesAPI
    • updateHouse

      public org.springframework.http.ResponseEntity<HouseDTO> updateHouse(String id, HouseDTO house)
      Specified by:
      updateHouse in interface HousesAPI
    • removeHouse

      public org.springframework.http.ResponseEntity<Void> removeHouse(String id)
      Specified by:
      removeHouse in interface HousesAPI
    • removeAllHouses

      public org.springframework.http.ResponseEntity<Void> removeAllHouses()
      Specified by:
      removeAllHouses in interface HousesAPI