#include <RemoteViz/Rendering/ServiceSettings.h>
Public Member Functions | |
ServiceSettings () | |
ServiceSettings (const ServiceSettings &obj) | |
ServiceSettings & | operator= (const ServiceSettings &obj) |
~ServiceSettings () | |
const std::string & | getPublicCertificateFile () const |
const std::string & | getPrivateKeyFile () const |
| |
enum | RunMode { INVENTOR_SERVICE, INVENTOR_APPLICATION, INDEPENDENT_SERVICE } |
enum | Extensions { VOLUMEVIZ = 0x1, VOLUMEVIZLDM = 0x2, MESHVIZ = 0x4, MESHVIZXLM = 0x8, IMAGEVIZ = 0x10, HARDCOPY = 0x20, CATIA5READER = 0x40, CATIA6READER = 0x80, DWGREADER = 0x100, IGESREADER = 0x200, JTREADER = 0x400, PROEREADER = 0x800, SOLIDEDGEREADER = 0x1000, STEPREADER = 0x2000, SOLIDWORKSREADER = 0x4000, UGREADER = 0x8000, VDAREADER = 0x10000, XMTREADER = 0x20000 } |
enum | SecurityProtocols { SSLv2 = 0x1, SSLv3 = 0x2, TLSv1 = 0x4, TLSv1_1 = 0x8, TLSv1_2 = 0x10, TLSv1_3 = 0x20 } |
void | setIP (const std::string &ip) |
const std::string & | getIP () const |
void | setPort (unsigned short port) |
unsigned short | getPort () const |
void | setRunMode (ServiceSettings::RunMode runmode) |
ServiceSettings::RunMode | getRunMode () const |
std::string | getHostname () const |
void | setUsedExtensions (unsigned int extensions) |
unsigned int | getUsedExtensions () const |
std::shared_ptr< Monitoring > | getMonitoring () const |
void | enableSecureConnection (const std::string &publicCertificateFilePath, const std::string &privateKeyFilePath, unsigned int enabledSecurityProtocols=TLSv1_1|TLSv1_2|TLSv1_3) |
bool | isSecureConnection () const |
unsigned int | getEnabledSecurityProtocols () const |
Settings that define the rendering Service. A ServiceSettings object must be passed to the Service::open() method.
Each enumeration represents an Open Inventor extension.
Use setUsedExtensions to activate them.
The run mode is used to change the behaviour of the RemoteViz execution in three environments.
INVENTOR_SERVICE mode is used to run a RemoteViz application based on the Open Inventor render engine. This is the default mode. This mode requires a main loop.
INVENTOR_APPLICATION is used to share the rendering of a scene graph between an OIV application and a RemoteViz application. This mode uses the main loop of an Open Inventor component (SoWinExaminerViewer, SoXtRenderArea, ...).
INDEPENDENT_SERVICE mode is used to run a RemoteViz application based on its own render engine. In this mode, the Open Inventor render engine is disabled. This mode requires a main loop.
RemoteViz::Rendering::ServiceSettings::ServiceSettings | ( | ) |
Constructor.
RemoteViz::Rendering::ServiceSettings::ServiceSettings | ( | const ServiceSettings & | obj | ) |
Copy constructor.
RemoteViz::Rendering::ServiceSettings::~ServiceSettings | ( | ) |
Destructor.
void RemoteViz::Rendering::ServiceSettings::enableSecureConnection | ( | const std::string & | publicCertificateFilePath, | |
const std::string & | privateKeyFilePath, | |||
unsigned int | enabledSecurityProtocols = TLSv1_1|TLSv1_2|TLSv1_3 | |||
) |
Secures the connection between the server and the clients.
RemoteViz uses the WebSocket protocol to enable communication between the client and the service. In a production environment, it is highly recommended to use secure WebSocket. Using a secure WebSocket connection improves confidentiality and reliability because the connection is encrypted with Transport Layer Security (TLS), which reduces the risk of a variety of attacks such as man-in-the-middle tampering with your data.
The URL scheme used by the clients to connect to the service must be wss://
publicCertificateFilePath | : Path to a file containing the public certificate used to authenticate the server to the clients. The certificate has to be a PEM ("Privacy Enhanced Mail") encoded certificate. | |
privateKeyFilePath | : Path to a file containing the private key used to sign the server key exchange between the client and the server. If the private key is protected by a passphrase, set the passphrase into the ServiceListener::onRequestedPrivateKeyPassphrase callback. | |
enabledSecurityProtocols | : Defines the security protocols used to secure the exchange between the client and the server. By default, TLSv1.1, TLSv1.2 and TLSv1.3 protocols are enabled. A bitmask of the security protocols is used. Many security protocols can be enabled by using the logical OR operator. |
unsigned int RemoteViz::Rendering::ServiceSettings::getEnabledSecurityProtocols | ( | ) | const |
std::string RemoteViz::Rendering::ServiceSettings::getHostname | ( | ) | const |
Gets the current host name.
const std::string& RemoteViz::Rendering::ServiceSettings::getIP | ( | ) | const |
Gets the IP address.
Default value is "127.0.0.1".
std::shared_ptr<Monitoring> RemoteViz::Rendering::ServiceSettings::getMonitoring | ( | ) | const |
Gets the monitoring object which allows to manage metrics listeners that monitor states and performances of the service.
unsigned short RemoteViz::Rendering::ServiceSettings::getPort | ( | ) | const |
Gets the port of the service.
Default value is 8080.
const std::string& RemoteViz::Rendering::ServiceSettings::getPrivateKeyFile | ( | ) | const |
Gets the private key used to sign the server key exchange between the client and the server.
const std::string& RemoteViz::Rendering::ServiceSettings::getPublicCertificateFile | ( | ) | const |
Gets the public certificate authenticating the server to the clients.
ServiceSettings::RunMode RemoteViz::Rendering::ServiceSettings::getRunMode | ( | ) | const |
Gets the run mode of the service.
Default value is INVENTOR_SERVICE.
unsigned int RemoteViz::Rendering::ServiceSettings::getUsedExtensions | ( | ) | const |
Gets the used Open Inventor extensions.
bool RemoteViz::Rendering::ServiceSettings::isSecureConnection | ( | ) | const |
Gets the SSL engine activation.
ServiceSettings& RemoteViz::Rendering::ServiceSettings::operator= | ( | const ServiceSettings & | obj | ) |
Copy assignment operator.
void RemoteViz::Rendering::ServiceSettings::setIP | ( | const std::string & | ip | ) |
Sets the IP address.
IP version 4 (IPv4: X.X.X.X) and IP version 6 (IPv6: X::X::X::X::X::X::X::X) are supported. Default value is "127.0.0.1"
To make the service accept connections on all interfaces, use "0.0.0.0".
ip | : the IP address used by the instance |
void RemoteViz::Rendering::ServiceSettings::setPort | ( | unsigned short | port | ) |
Sets the port of the service.
Default value is 8080.
In case you are behind a firewall, please ensure your IT department configured the firewall to accommodate the selected port.
port | : the port used by the instance |
void RemoteViz::Rendering::ServiceSettings::setRunMode | ( | ServiceSettings::RunMode | runmode | ) |
Sets the run mode of the service.
Default value is INVENTOR_SERVICE.
runmode | : the type of run mode used by the instance |
void RemoteViz::Rendering::ServiceSettings::setUsedExtensions | ( | unsigned int | extensions | ) |
Sets the Open Inventor extensions used by a RemoteViz application.
Convenient method that will be used by Service::open() to check if all the licenses necessary to start the Service are available (necessary licenses are explained below) and to call necessary Open Inventor init() methods .
RemoteViz and Open Inventor (if used) are protected by a license key mechanism that limits its use to specified computers or network environments based on a commercial agreement. Depending on the license agreement, license keys are floating licenses managed by a license server or an encrypted "master password" string (see SoLockManager).
One RemoteViz license is required to start the service. (An SDK license for development/debugging or a Runtime license for deployment.)
If the Service uses Open Inventor for rendering (runMode is not INDEPENDENT_SERVICE), then one Open Inventor license plus one license of each used extension is required to start the service. (An SDK license for development/debugging or a Runtime license for deployment.) If this method is called and licenses are missing, Service::open() will return false. If this method is not called, the licenses will not be checked until the first call to create an Open Inventor node. Alternatively the application can do explicit license checks by calling SoLicensesInfo::check() before opening the Service or creating any of the Open Inventor nodes. Note: Enabling the VolumeVizLDM extension automatically enables the VolumeViz extension.
In C++, this method also calls the init() methods for Open Inventor and all specified extensions (e.g. SoDB::init()). The corresponding finish() methods will be automatically called when the Service is stopped. Alternatively, the application can explicitly call init methods before creating any Open Inventor nodes. In that case, the application should also call the corresponding finish() methods when the Service is stopped.
When using the run mode INDEPENDENT_SERVICE, this method has no effect, i.e., only one RemoteViz license will be required to start the service.
extensions | : the bitmask of the Open Inventor extensions used in RemoteViz. Many extensions can be activated by using the logical OR operator. For example : setUsedExtensions(VOLUMEVIZ | MESHVIZ) |