Class MerlinBindings

java.lang.Object
gov.nasa.jpl.aerie.merlin.server.http.MerlinBindings
All Implemented Interfaces:
io.javalin.plugin.Plugin

public final class MerlinBindings extends Object implements io.javalin.plugin.Plugin
Lift native Java agents into an HTTP-oriented service. The role of a MerlinBindings object is to faithfully translate between the request/response protocol of HTTP and the call/return/throw protocol of a Java method. Put differently, MerlinBindings lifts an object with native Java endpoints (methods) into an HTTP service with HTTP-oriented endpoints. This entails translating HTTP request bodies into native Java domain objects, and translating native Java domain objects (including thrown exceptions) into HTTP response bodies. The objects being lifted implement the MissionModelService and GetSimulationResultsAction interfaces. Formally, these interfaces are the ones MerlinBindings class lifts into the domain of HTTP; an object implementing the interface defines the action to take for each HTTP request in an HTTP-independent way.