Class GesturesController

java.lang.Object
info.ejava.examples.svc.httpapi.gestures.controllers.GesturesController
All Implemented Interfaces:
GesturesAPI

@RestController public class GesturesController extends Object implements 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 Details

  • 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 interface GesturesAPI
    • 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 interface GesturesAPI
    • deleteGesture

      @RequestMapping(path="api/gestures/{gestureType}", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteGesture(@PathVariable("gestureType") String gestureType)
      Specified by:
      deleteGesture in interface GesturesAPI
    • deleteAllGestures

      @RequestMapping(path="api/gestures", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteAllGestures()
      Specified by:
      deleteAllGestures in interface GesturesAPI