Package ch.psi.wica.controllers
Class WicaStreamDeleteController
java.lang.Object
ch.psi.wica.controllers.WicaStreamDeleteController
Provides a SpringBoot REST Controller to handle DELETE and POST operations
on the {code /ca/streams} endpoint.
-
Constructor Summary
ConstructorsConstructorDescriptionWicaStreamDeleteController
(WicaStreamLifecycleService wicaStreamLifecycleService, StatisticsCollectionService statisticsCollectionService) Constructs a new controller for handling stream DELETE requests. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<String> deleteStream
(String streamId, Optional<String> optConfirm, jakarta.servlet.http.HttpServletRequest httpServletRequest) Handles HTTP POST or DELETE requests to delete the wica stream with the specified ID.void
-
Constructor Details
-
WicaStreamDeleteController
public WicaStreamDeleteController(@Autowired WicaStreamLifecycleService wicaStreamLifecycleService, @Autowired StatisticsCollectionService statisticsCollectionService) Constructs a new controller for handling stream DELETE 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
-
deleteStream
@RequestMapping(method={POST,DELETE}, value="/{streamId}", produces="text/plain") public org.springframework.http.ResponseEntity<String> deleteStream(@PathVariable String streamId, @RequestBody(required=false) Optional<String> optConfirm, jakarta.servlet.http.HttpServletRequest httpServletRequest) Handles HTTP POST or DELETE requests to delete the wica stream with the specified ID.- Parameters:
streamId
- the ID of the stream to be deleted.optConfirm
- parameter that must be set to 'DELETE' to confirm deletion when this method is triggered an HTTP POST request.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 delete operation completes successfully or 'Bad Request' (= 400) if some error occurs. When successful the body of the HTTP response contains the ID of the resource which was deleted. When unsuccessful an additional response header 'X-WICA-ERROR' is written with a more detailed description of the error.
-
handleException
-