Package ch.psi.wica.controllers
Class WicaStreamPutController
java.lang.Object
ch.psi.wica.controllers.WicaStreamPutController
Provides a SpringBoot REST Controller to handle DELETE and POST operations
on the {code /ca/streams} endpoint.
-
Constructor Summary
ConstructorsConstructorDescriptionWicaStreamPutController
(WicaStreamLifecycleService wicaStreamLifecycleService, StatisticsCollectionService statisticsCollectionService) Constructs a new controller for handling stream RELOAD requests. -
Method Summary
Modifier and TypeMethodDescriptionvoid
org.springframework.http.ResponseEntity
<String> put
(Optional<String> optStreamId, String action, jakarta.servlet.http.HttpServletRequest httpServletRequest) Handles an HTTP request to PUT (= reconfigure the resource) associated with the specified wica stream ID.
-
Constructor Details
-
WicaStreamPutController
public WicaStreamPutController(@Autowired WicaStreamLifecycleService wicaStreamLifecycleService, @Autowired StatisticsCollectionService statisticsCollectionService) Constructs a new controller for handling stream RELOAD requests.- Parameters:
wicaStreamLifecycleService
- reference to the service object which can be used to delete the reactive stream.statisticsCollectionService
- an object which will collect the statistics associated with this class instance.
-
-
Method Details
-
put
@PutMapping(value={"","/{optStreamId}"}, produces="text/plain") public org.springframework.http.ResponseEntity<String> put(@PathVariable Optional<String> optStreamId, @RequestParam("action") String action, jakarta.servlet.http.HttpServletRequest httpServletRequest) Handles an HTTP request to PUT (= reconfigure the resource) associated with the specified wica stream ID.- Parameters:
optStreamId
- the ID of the stream to be reloaded.action
- keyword specifying the action that is to take place. Currently the only supported action is "RELOAD"httpServletRequest
- contextual information for the request; used for statistics collection only.- Returns:
- an HTTP response whose status code will be set to 'OK' (= 200) if the operation completes successfully or 'Bad Request' (= 400) if some error occurs. When successful the the HTTP response remains open and the evolving state of the stream's channels are written to the response body as a sequence of Server Sent Events (SSE's). When unsuccessful the response header 'X-WICA-ERROR' is written with a more detailed description of the error.
-
handleException
-