Package tbdex.sdk.httpserver
Class TbdexHttpServer
-
- All Implemented Interfaces:
public final class TbdexHttpServerTBDex HTTP server responsible for handling RFQs, orders, and other interactions.
-
-
Constructor Summary
Constructors Constructor Description TbdexHttpServer(TbdexHttpServerConfig config)
-
Method Summary
Modifier and Type Method Description final CallbacksgetCallbacks()final Unitconfigure(Application app)Configures the Ktor application with necessary settings, including content negotiation. final UnitonGetOfferings(SuspendFunction1<ApplicationCall, Object> callback)Adds a GetOfferingsCallback for handling requests for offerings. final UnitonGetExchanges(SuspendFunction2<ApplicationCall, GetExchangesFilter, Object> callback)Adds a GetExchangesCallback for handling requests for exchanges. final UnitonGetExchange(SuspendFunction1<ApplicationCall, Object> callback)Adds a GetExchangeCallback for handling requests for an exchange with a specific exchangeId. final UnitonCreateExchange(SuspendFunction4<ApplicationCall, Rfq, Offering, String, Unit> callback)Adds a CreateExchangeCallback for handling requests to create an exchange. final UnitonSubmitOrder(SuspendFunction2<ApplicationCall, Order, Unit> callback)Adds a SubmitOrderCallback for handling requests to submit an order. final UnitonSubmitClose(SuspendFunction2<ApplicationCall, Close, Unit> callback)Adds a SubmitOrderCallback for handling requests to submit an order. final Unitstart()Starts the embedded Netty server. final Unitstop()Stops the embedded Netty server. -
-
Constructor Detail
-
TbdexHttpServer
TbdexHttpServer(TbdexHttpServerConfig config)
-
-
Method Detail
-
getCallbacks
final Callbacks getCallbacks()
-
configure
final Unit configure(Application app)
Configures the Ktor application with necessary settings, including content negotiation.
- Parameters:
app- The Ktor application to be configured.
-
onGetOfferings
final Unit onGetOfferings(SuspendFunction1<ApplicationCall, Object> callback)
Adds a GetOfferingsCallback for handling requests for offerings.
- Parameters:
callback- GetOfferingsCallback function to be registered
-
onGetExchanges
final Unit onGetExchanges(SuspendFunction2<ApplicationCall, GetExchangesFilter, Object> callback)
Adds a GetExchangesCallback for handling requests for exchanges.
- Parameters:
callback- GetExchangesCallback function to be registered
-
onGetExchange
final Unit onGetExchange(SuspendFunction1<ApplicationCall, Object> callback)
Adds a GetExchangeCallback for handling requests for an exchange with a specific exchangeId.
- Parameters:
callback- GetExchangeCallback function to be registered
-
onCreateExchange
final Unit onCreateExchange(SuspendFunction4<ApplicationCall, Rfq, Offering, String, Unit> callback)
Adds a CreateExchangeCallback for handling requests to create an exchange.
- Parameters:
callback- CreateExchangeCallback function to be registered
-
onSubmitOrder
final Unit onSubmitOrder(SuspendFunction2<ApplicationCall, Order, Unit> callback)
Adds a SubmitOrderCallback for handling requests to submit an order.
- Parameters:
callback- SubmitOrderCallback function to be registered
-
onSubmitClose
final Unit onSubmitClose(SuspendFunction2<ApplicationCall, Close, Unit> callback)
Adds a SubmitOrderCallback for handling requests to submit an order.
- Parameters:
callback- SubmitOrderCallback function to be registered
-
-
-
-