Class HousesAPIClient
java.lang.Object
info.ejava.assignments.api.houserenters.client.houses.HousesAPIClient
- All Implemented Interfaces:
HousesAPI
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected URIprotected org.springframework.http.MediaTypeprotected org.springframework.web.client.RestTemplateFields inherited from interface info.ejava.assignments.api.houserenters.client.houses.HousesAPI
HOUSE_PATH, HOUSES_PATH -
Constructor Summary
ConstructorsConstructorDescriptionHousesAPIClient(org.springframework.web.client.RestTemplate restTemplate, ServerConfig serverConfig, org.springframework.http.MediaType mediaType) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<HouseDTO> createHouse(HouseDTO house) org.springframework.http.ResponseEntity<HouseListDTO> findHousesBy(HouseSearchParams searchParams, org.springframework.data.domain.Pageable pageable) An example query using a GET and query parameters.org.springframework.http.ResponseEntity<HouseDTO> org.springframework.http.ResponseEntity<Void> protected org.springframework.web.util.UriBuildermakeRequestParams(org.springframework.web.util.UriComponentsBuilder uriBuilder, HouseSearchParams searchParams, org.springframework.data.domain.Pageable pageable) org.springframework.http.ResponseEntity<Void> org.springframework.http.ResponseEntity<Void> removeHouse(String id) org.springframework.http.ResponseEntity<HouseDTO> updateHouse(String id, HouseDTO house) withRestTemplate(org.springframework.web.client.RestTemplate restTemplate) Used to change the authenticated identity of the client when security has been enabled.
-
Field Details
-
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
Description copied from interface:HousesAPIUsed to change the authenticated identity of the client when security has been enabled.- Specified by:
withRestTemplatein interfaceHousesAPI- Parameters:
restTemplate- contains basis for client/identity- Returns:
- new client using the supplied restTemplate
-
createHouse
- Specified by:
createHousein interfaceHousesAPI
-
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:HousesAPIAn example query using a GET and query parameters. Useful in expressing range searches.- Specified by:
findHousesByin interfaceHousesAPI- Parameters:
searchParams- object expressing min/max propertiespageable- paging constraints- Returns:
- list of results
-
getHouse
-
hasHouse
-
updateHouse
- Specified by:
updateHousein interfaceHousesAPI
-
removeHouse
- Specified by:
removeHousein interfaceHousesAPI
-
removeAllHouses
- Specified by:
removeAllHousesin interfaceHousesAPI
-