Class ExposureReservationAPI
java.lang.Object
edu.yu.marketmaker.exposurereservation.ExposureReservationAPI
REST Controller for the Exposure Reservation API.
Provides endpoints to reserve exposure capacity, managing fills, and releasing reservations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<FreedCapacityResponse> POST /reservations/{id}/apply-fill Updates an existing reservation after a partial or full fill occurs.org.springframework.http.ResponseEntity<ReservationResponse> createReservation(Quote quote) POST /reservations Requests exposure capacity for a quote.org.springframework.http.ResponseEntity<ExposureState> GET /exposure Retrieves the current global exposure state.org.springframework.http.ResponseEntity<ServiceHealth> GET /health Health check endpoint to verify the service is running and responsive.org.springframework.http.ResponseEntity<FreedCapacityResponse> POST /reservations/{id}/release Manually releases a reservation, typically used when a quote is replaced or canceled without being filled.
-
Constructor Details
-
ExposureReservationAPI
-
-
Method Details
-
createReservation
@PostMapping("/reservations") public org.springframework.http.ResponseEntity<ReservationResponse> createReservation(@RequestBody Quote quote) POST /reservations Requests exposure capacity for a quote.- Parameters:
quote- The quote containing symbol and quantity.- Returns:
- A ReservationResponse with the granted quantity and status (GRANTED, PARTIAL, DENIED).
-
applyFill
@PostMapping("/reservations/{id}/apply-fill") public org.springframework.http.ResponseEntity<FreedCapacityResponse> applyFill(@PathVariable UUID id, @RequestBody int requestedQuantity) POST /reservations/{id}/apply-fill Updates an existing reservation after a partial or full fill occurs. Reduces the reserved exposure by the filled amount.- Parameters:
id- The UUID of the reservation.requestedQuantity- The filled quantity.- Returns:
- A response indicating the capacity that was freed up by this fill.
-
release
@PostMapping("/reservations/{id}/release") public org.springframework.http.ResponseEntity<FreedCapacityResponse> release(@PathVariable UUID id) POST /reservations/{id}/release Manually releases a reservation, typically used when a quote is replaced or canceled without being filled.- Parameters:
id- The UUID of the reservation to release.- Returns:
- A response indicating the total remaining capacity that was freed.
-
getExposure
@GetMapping("/exposure") public org.springframework.http.ResponseEntity<ExposureState> getExposure()GET /exposure Retrieves the current global exposure state. Useful for debugging and monitoring usage versus capacity.- Returns:
- The current exposure state including usage, total capacity, and active reservation count.
-
getHealth
GET /health Health check endpoint to verify the service is running and responsive.- Returns:
- A ServiceHealth object indicating the health status of the service.
-