Class GesturesAPISyncWebClient
java.lang.Object
info.ejava.examples.svc.httpapi.gestures.client.GesturesAPISyncWebClient
- All Implemented Interfaces:
GesturesAPI
This class demonstrates an implementation of the Gestures client using
WebClient in a purely *synchronous* / *blocking* manner. The primary
difference between this and the RestTemplate version is the specific
types of exceptions thrown. Even though they are logically equivalent
(i.e., NotFound, BadRequest, etc.), they are from two different
class hierarchies.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final URI
private final org.springframework.web.reactive.function.client.WebClient
Fields inherited from interface info.ejava.examples.svc.httpapi.gestures.api.GesturesAPI
GESTURE_PATH, GESTURES_PATH, target
-
Constructor Summary
ConstructorsConstructorDescriptionGesturesAPISyncWebClient
(org.springframework.web.reactive.function.client.WebClient webClient, ServerConfig serverConfig) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void>
org.springframework.http.ResponseEntity<Void>
deleteGesture
(String gestureType) org.springframework.http.ResponseEntity<Void>
org.springframework.http.ResponseEntity<String>
getGesture
(String gestureType, String target) org.springframework.http.ResponseEntity<String>
upsertGesture
(String gestureType, String gesture)
-
Field Details
-
baseUrl
-
webClient
private final org.springframework.web.reactive.function.client.WebClient webClient
-
-
Constructor Details
-
GesturesAPISyncWebClient
public GesturesAPISyncWebClient(org.springframework.web.reactive.function.client.WebClient webClient, ServerConfig serverConfig)
-
-
Method Details
-
upsertGesture
public org.springframework.http.ResponseEntity<String> upsertGesture(String gestureType, String gesture) - Specified by:
upsertGesture
in interfaceGesturesAPI
-
getGesture
public org.springframework.http.ResponseEntity<String> getGesture(String gestureType, String target) - Specified by:
getGesture
in interfaceGesturesAPI
-
deleteAllGestures
- Specified by:
deleteAllGestures
in interfaceGesturesAPI
-
deleteGesture
- Specified by:
deleteGesture
in interfaceGesturesAPI
-
doDelete
-