|
ImagingTools Core SDK
|
Interface for describing server connection configuration with multi-protocol support. More...
#include <IServerConnectionInterface.h>
Public Types | |
| enum | ProtocolType { PT_UNKNOWN , PT_HTTP , PT_WEBSOCKET , PT_FILE , PT_GRPC } |
| Communication protocols supported by server connections. More... | |
| enum | ConnectionFlags { CF_DEFAULT = 0x1 , CF_SECURE = 0x2 } |
| Flags controlling connection security and behavior. More... | |
| typedef QList< ProtocolType > | ProtocolTypes |
| List of protocol types for querying supported protocols. | |
Public Member Functions | |
| virtual int | GetConnectionFlags () const =0 |
| Get the connection flags determining secure/insecure mode. | |
| virtual void | SetConnectionFlags (int connectionFlags)=0 |
| Set the connection flags to control secure/insecure mode. | |
| virtual QString | GetHost () const =0 |
| Get the server host name or address. | |
| virtual void | SetHost (const QString &host)=0 |
| Set the server host name or address. | |
| virtual int | GetPort (ProtocolType protocol) const =0 |
| Get the port number for a specific protocol. | |
| virtual void | SetPort (ProtocolType protocol, int port)=0 |
| Set the port number for a specific protocol. | |
| virtual ProtocolTypes | GetSupportedProtocols () const =0 |
| Get the list of protocols supported by this connection. | |
| virtual bool | GetUrl (ProtocolType protocol, QUrl &url) const =0 |
| Generate a complete URL for the specified protocol. | |
Interface for describing server connection configuration with multi-protocol support.
The IServerConnectionInterface defines the contract for configuring server connections across multiple communication protocols. A single server instance can support multiple protocols (HTTP, WebSocket, gRPC, File) on the same host, each on a separate port.
This interface supports both secure (HTTPS/WSS) and insecure (HTTP/WS) connection modes, making it suitable for development, testing, and production deployments.
Multi-Protocol Support:
Connection Modes:
URL Generation:
Server Components (imtrest):
Client Components:
Server Management:
Definition at line 96 of file IServerConnectionInterface.h.
List of protocol types for querying supported protocols.
Definition at line 140 of file IServerConnectionInterface.h.
Flags controlling connection security and behavior.
Bitflags that control aspects of the connection configuration, particularly whether secure (encrypted) connections are used.
| Enumerator | |
|---|---|
| CF_DEFAULT | Default insecure connection (HTTP, WS) |
| CF_SECURE | Secure connection with SSL/TLS encryption (HTTPS, WSS) |
Definition at line 128 of file IServerConnectionInterface.h.
Communication protocols supported by server connections.
Defines the types of communication protocols that can be configured for a server connection. Each protocol operates on an independent port and may have protocol-specific behavior.
Definition at line 109 of file IServerConnectionInterface.h.
|
pure virtual |
Get the connection flags determining secure/insecure mode.
Returns the current connection flags, which control whether connections use secure (HTTPS/WSS) or insecure (HTTP/WS) protocols.
|
pure virtual |
Get the server host name or address.
Returns the host name, which can be:
|
pure virtual |
Get the port number for a specific protocol.
Returns the configured port number for the specified communication protocol. Each protocol has an independent port configuration on the same host.
| protocol | The protocol type (PT_HTTP, PT_WEBSOCKET, etc.). |
|
pure virtual |
Get the list of protocols supported by this connection.
Returns all protocol types that have been configured (registered) for this connection. Only protocols in this list can be used with GetPort() and GetUrl().
|
pure virtual |
Generate a complete URL for the specified protocol.
Constructs a fully-qualified URL for the given protocol, incorporating:
This is the recommended way to obtain connection URLs for clients, as it handles all protocol-specific URL construction logic.
| protocol | The protocol type for URL generation. | |
| [out] | url | Output URL object to populate. |
true if URL was successfully generated; false if protocol is not supported or configuration is incomplete.
|
pure virtual |
Set the connection flags to control secure/insecure mode.
Configures whether the connection should use secure (encrypted) or insecure protocols. This flag affects URL generation via GetUrl().
| connectionFlags | Connection flags to set (CF_DEFAULT or CF_SECURE). |
|
pure virtual |
Set the server host name or address.
Configures the server host, which can be a DNS name, IP address, or file path depending on the protocol being used.
| host | Server host name, IP address, or file path. |
|
pure virtual |
Set the port number for a specific protocol.
Configures the port number on which the specified protocol will listen. Different protocols can use different ports on the same host, allowing a single server to expose multiple communication methods.
| protocol | The protocol type (PT_HTTP, PT_WEBSOCKET, etc.). |
| port | Port number (typically 1-65535, 0 to clear configuration). |