Class DaprController


  • @RestController
    public class DaprController
    extends Object
    SpringBoot Controller to handle callback APIs for Dapr.
    • Constructor Detail

      • DaprController

        public DaprController()
    • Method Detail

      • healthz

        @GetMapping(path="/healthz")
        public void healthz()
        Callback API for health checks from Dapr's sidecar.
      • daprConfig

        @GetMapping(path="/dapr/config",
                    produces="application/json")
        public byte[] daprConfig()
                          throws IOException
        Returns Dapr's configuration for Actors.
        Returns:
        Actor's configuration.
        Throws:
        IOException - If cannot generate configuration.
      • daprSubscribe

        @GetMapping(path="/dapr/subscribe",
                    produces="application/json")
        public byte[] daprSubscribe()
                             throws IOException
        Returns the list of subscribed topics.
        Returns:
        List of subscribed topics.
        Throws:
        IOException - If cannot generate list of topics.
      • deactivateActor

        @DeleteMapping(path="/actors/{type}/{id}")
        public reactor.core.publisher.Mono<Void> deactivateActor​(@PathVariable("type")
                                                                 String type,
                                                                 @PathVariable("id")
                                                                 String id)
        Handles API to deactivate an actor.
        Parameters:
        type - Actor type.
        id - Actor Id.
        Returns:
        Void.
      • invokeActorMethod

        @PutMapping(path="/actors/{type}/{id}/method/{method}")
        public reactor.core.publisher.Mono<byte[]> invokeActorMethod​(@PathVariable("type")
                                                                     String type,
                                                                     @PathVariable("id")
                                                                     String id,
                                                                     @PathVariable("method")
                                                                     String method,
                                                                     @RequestBody(required=false)
                                                                     byte[] body)
        Handles API to invoke an actor's method.
        Parameters:
        type - Actor type.
        id - Actor Id.
        method - Actor method.
        body - Raw request body.
        Returns:
        Raw response body.
      • invokeActorTimer

        @PutMapping(path="/actors/{type}/{id}/method/timer/{timer}")
        public reactor.core.publisher.Mono<Void> invokeActorTimer​(@PathVariable("type")
                                                                  String type,
                                                                  @PathVariable("id")
                                                                  String id,
                                                                  @PathVariable("timer")
                                                                  String timer,
                                                                  @RequestBody
                                                                  byte[] body)
        Handles API to trigger an actor's timer.
        Parameters:
        type - Actor type.
        id - Actor Id.
        timer - Actor timer's name.
        body - Raw request's body.
        Returns:
        Void.
      • invokeActorReminder

        @PutMapping(path="/actors/{type}/{id}/method/remind/{reminder}")
        public reactor.core.publisher.Mono<Void> invokeActorReminder​(@PathVariable("type")
                                                                     String type,
                                                                     @PathVariable("id")
                                                                     String id,
                                                                     @PathVariable("reminder")
                                                                     String reminder,
                                                                     @RequestBody(required=false)
                                                                     byte[] body)
        Handles API to trigger an actor's reminder.
        Parameters:
        type - Actor type.
        id - Actor Id.
        reminder - Actor reminder's name.
        body - Raw request's body.
        Returns:
        Void.