Class ExposureReservationAPI

java.lang.Object
edu.yu.marketmaker.exposurereservation.ExposureReservationAPI

@RestController @Profile("exposure-reservation") public class ExposureReservationAPI extends Object
REST Controller for the Exposure Reservation API. Provides endpoints to reserve exposure capacity, managing fills, and releasing reservations.
  • Constructor Details

  • 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

      @GetMapping("/health") public org.springframework.http.ResponseEntity<ServiceHealth> 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.