Class GesturesController
java.lang.Object
info.ejava.examples.svc.httpapi.gestures.controllers.GesturesController
- All Implemented Interfaces:
GesturesAPI
The following is an example of using the HTTP constructs,
Resources, and Methods consistent with the HTTP-based/REST-like
category of service discussed in the lectures. To keep it
simple, we are using a simple Map object to act as our
back-end business service and storage. The WebMvc mappings
have been assigned to the interface.
-
Field Summary
FieldsFields inherited from interface info.ejava.examples.svc.httpapi.gestures.api.GesturesAPI
GESTURE_PATH, GESTURES_PATH, target
-
Constructor Summary
Constructors -
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
-
gestures
-
-
Constructor Details
-
GesturesController
public GesturesController()
-
-
Method Details
-
upsertGesture
@RequestMapping(path="api/gestures/{gestureType}", method={POST,PUT}, consumes="text/plain", produces="text/plain") public org.springframework.http.ResponseEntity<String> upsertGesture(@PathVariable(name="gestureType",required=true) String gestureType, @RequestBody String gesture) - Specified by:
upsertGesture
in interfaceGesturesAPI
-
getGesture
@RequestMapping(path="api/gestures/{gestureType}", method=GET, produces="text/plain") public org.springframework.http.ResponseEntity<String> getGesture(@PathVariable(name="gestureType") String gestureType, @RequestParam(name="target",required=false) String target) - Specified by:
getGesture
in interfaceGesturesAPI
-
deleteGesture
@RequestMapping(path="api/gestures/{gestureType}", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteGesture(@PathVariable("gestureType") String gestureType) - Specified by:
deleteGesture
in interfaceGesturesAPI
-
deleteAllGestures
@RequestMapping(path="api/gestures", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteAllGestures()- Specified by:
deleteAllGestures
in interfaceGesturesAPI
-