User Tools

Site Tools


groimp-platform:interfaces:api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
groimp-platform:interfaces:api [2025/02/10 11:37] Timgroimp-platform:interfaces:api [2025/02/10 11:54] (current) Tim
Line 1: Line 1:
 ====== API GroIMP ====== ====== API GroIMP ======
  
-The API in GroIMP is implemented as a new "GroIMP application" including a toolkit, workbenches, and a workbench manager.  +The [[user-guide:additional_interfaces:api|GroLink]] PI in GroIMP is implemented as a new "GroIMP application" including a toolkit, workbenches, and a workbench manager. 
- +
  
  
 +The design and implementation is described in more detail [[https://wkurth.grogra.de/oberlaender_msc.pdf|here]].
 ===== Key components and their integration ===== ===== Key components and their integration =====
  
Line 38: Line 37:
  
 The [[https://javadoc.grogra.de/api/de/grogra/api/APIRunner.html|APIRunner]] implements [[https://javadoc.grogra.de/platform/de/grogra/pf/ui/Command.html| Command]] which enables the class to be pushed to the job manager of the different workbenches.  The [[https://javadoc.grogra.de/api/de/grogra/api/APIRunner.html|APIRunner]] implements [[https://javadoc.grogra.de/platform/de/grogra/pf/ui/Command.html| Command]] which enables the class to be pushed to the job manager of the different workbenches. 
-The runner resolves the workbenches and commands defined in the requests and is the core component of the [[#call_lifecylce |call lifecylce]].   +The runner resolves the workbenches and commands defined in the requests and is the core component of the [[#call_lifecycle |call lifecycle]].  
  
 +Additionally each instance of a runner holds a APIReturn object to manage the information that are suppose to be send back to the user. 
  
 ====  Return ==== ====  Return ====
  
 +The [[https://javadoc.grogra.de/api/de/grogra/api/APIReturn.html |APIReturn]] class is basically a JSON wrapper. 
  
  
 ===== Call lifecycle ===== ===== Call lifecycle =====
  
 +{{:groimp-platform:interfaces:api_call_lifecycle.png?direct&600|}}
  
 +Each API call send out by a client is first handled by the API/HTTP server. The server creates for each request a new instance of API Runner with the request and the client address as a parameter. During the instantiation the API Runner instance decodes the parameters, and resolves the command based on the registry and the workbench based on the workbench manager. Afterwards the APIRunner adds it self to the queue of the job manager of the resolved workbench. 
  
 +When then executed by the job manager, it executes the resolved command with it self as the info parameter. 
 +This allows the executed command to access the provided parameters from the http request and allows to add new information to the APIResponse.
  
 +After the execution of the resolved command, the APIRunner instance collects some additional information form the workbench (the logs and the content of the xl-console) and wraps this with the data added by the command. It then sends the result back  to the client.
groimp-platform/interfaces/api.1739183871.txt.gz · Last modified: 2025/02/10 11:37 by Tim