|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Service interface for the REST API server. More...
#include <mitkIRestServerService.h>

Public Member Functions | |
| virtual | ~IRestServerService () |
| virtual bool | Start ()=0 |
| Start the REST server with the pending configuration. More... | |
| virtual void | Stop ()=0 |
| Stop the REST server. More... | |
| virtual bool | IsRunning () const =0 |
| Check if the server is currently running. More... | |
| virtual void | SetConfig (const RestServerConfig &config)=0 |
| Set the pending server configuration. More... | |
| virtual RestServerConfig | GetPendingConfig () const =0 |
| Get the pending server configuration. More... | |
| virtual std::optional< RestServerConfig > | GetRunningConfig () const =0 |
| Get the configuration the server is currently running with. More... | |
| virtual RenderWindowBridge * | GetRenderWindowBridge ()=0 |
| Return the server-owned RenderWindowBridge. More... | |
| virtual void | SetDataStorage (DataStorage *dataStorage)=0 |
| Set the DataStorage for REST API operations. More... | |
| virtual DataStorage::Pointer | GetDataStorage () const =0 |
| Get the currently connected DataStorage. More... | |
| virtual std::optional< std::string > | GetServerUrl () const =0 |
| Get the full URL where the server is listening. More... | |
| virtual std::optional< std::string > | GetLastError () const =0 |
| Get the last error message. More... | |
| virtual std::vector< std::string > | GetClientIPs () const =0 |
| Get the list of client IP addresses that have sent requests. More... | |
| virtual std::optional< RequestInfo > | GetLastRequestInfo () const =0 |
| Get information about the last request processed. More... | |
| virtual void | SetLogLimit (std::optional< unsigned int > limit)=0 |
| Set the request log limit. More... | |
| virtual std::optional< unsigned int > | GetLogLimit () const =0 |
| Get the current request log limit. More... | |
| virtual std::vector< RequestInfo > | GetRequestLog () const =0 |
| Get all logged requests. More... | |
| virtual void | ClearRequestLog ()=0 |
| Clear all logged requests. More... | |
| virtual uint64_t | GetRequestLogVersion () const =0 |
| Get the request log version counter. More... | |
| virtual std::optional< int64_t > | GetUptimeSeconds () const =0 |
| Get the server uptime in seconds. More... | |
Service interface for the REST API server.
Allows other modules and plugins to:
The server maintains two configuration states:
GetPendingConfig() returns the configuration that will be used on next Start(). GetRunningConfig() returns the configuration the server is currently running with, or std::nullopt if the server is not running.
Definition at line 63 of file mitkIRestServerService.h.
|
virtual |
|
pure virtual |
Clear all logged requests.
Implemented in mitk::RestServer.
|
pure virtual |
Get the list of client IP addresses that have sent requests.
Returns a list of unique IP addresses from clients that have made requests to the server since it was started.
Implemented in mitk::RestServer.
|
pure virtual |
Get the currently connected DataStorage.
Implemented in mitk::RestServer.
|
pure virtual |
Get the last error message.
Implemented in mitk::RestServer.
|
pure virtual |
Get information about the last request processed.
Implemented in mitk::RestServer.
|
pure virtual |
Get the current request log limit.
Implemented in mitk::RestServer.
|
pure virtual |
Get the pending server configuration.
This is the configuration that will be used on the next Start() call.
Implemented in mitk::RestServer.
|
pure virtual |
Return the server-owned RenderWindowBridge.
The bridge is owned by the server. UI-layer plugins (e.g. the Qt workbench plugin) configure it by setting callbacks for screenshot capture and crosshair position access. Callbacks must be cleared before the objects they reference are destroyed.
Implemented in mitk::RestServer.
|
pure virtual |
Get all logged requests.
Returns the request log in chronological order (oldest first).
Implemented in mitk::RestServer.
|
pure virtual |
Get the request log version counter.
Incremented on every log mutation (new entry, clear, trim). Allows consumers to detect changes without copying the full log.
Implemented in mitk::RestServer.
|
pure virtual |
Get the configuration the server is currently running with.
Implemented in mitk::RestServer.
|
pure virtual |
Get the full URL where the server is listening.
Implemented in mitk::RestServer.
|
pure virtual |
Get the server uptime in seconds.
Implemented in mitk::RestServer.
|
pure virtual |
Check if the server is currently running.
Implemented in mitk::RestServer.
|
pure virtual |
Set the pending server configuration.
The configuration will take effect on the next Start() call. If the server is currently running, this only changes the pending config; the running config remains unchanged until Restart().
| config | The new configuration to use on next start. |
Implemented in mitk::RestServer.
|
pure virtual |
Set the DataStorage for REST API operations.
The server can operate without a DataStorage (graceful degradation), but data storage operations will return appropriate error responses. Can be called while the server is running.
| dataStorage | The DataStorage to use, or nullptr to disconnect. |
Implemented in mitk::RestServer.
|
pure virtual |
Set the request log limit.
Controls how many request entries are kept in the log. The log is cleared when the server starts.
| limit | Maximum number of entries to keep, or std::nullopt for unlimited. |
Implemented in mitk::RestServer.
|
pure virtual |
Start the REST server with the pending configuration.
If the server is already running, this is a no-op and returns true. The pending configuration becomes the running configuration upon successful start.
Implemented in mitk::RestServer.
|
pure virtual |
Stop the REST server.
Blocks until the server is fully stopped. If the server is not running, this is a no-op.
Implemented in mitk::RestServer.