Class GesturesAPITemplateClient
java.lang.Object
info.ejava.examples.svc.httpapi.gestures.client.GesturesAPITemplateClient
- All Implemented Interfaces:
GesturesAPI
This class demonstrates a synchronous/blocking client using RestTemplate
-- which is the only mode RestTemplate can operate in. Both the client and
server-side are implemented synchronously -- so we are able to naively
leverage a common interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final URI
private final org.springframework.web.client.RestTemplate
Fields inherited from interface info.ejava.examples.svc.httpapi.gestures.api.GesturesAPI
GESTURE_PATH, GESTURES_PATH, target
-
Constructor Summary
ConstructorsConstructorDescriptionGesturesAPITemplateClient
(org.springframework.web.client.RestTemplate restTemplate, ServerConfig serverConfig) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<Void> org.springframework.http.ResponseEntity
<Void> deleteGesture
(String gestureType) org.springframework.http.ResponseEntity
<String> getGesture
(String gestureType, String target) org.springframework.http.ResponseEntity
<String> upsertGesture
(String gestureType, String gesture)
-
Field Details
-
baseUrl
-
restTemplate
private final org.springframework.web.client.RestTemplate restTemplate
-
-
Constructor Details
-
GesturesAPITemplateClient
public GesturesAPITemplateClient(org.springframework.web.client.RestTemplate restTemplate, ServerConfig serverConfig)
-
-
Method Details
-
deleteAllGestures
- Specified by:
deleteAllGestures
in interfaceGesturesAPI
-
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
-
deleteGesture
- Specified by:
deleteGesture
in interfaceGesturesAPI
-