Adds immediate migration results
This commit is contained in:
2395 files changed
+357322
-2524
No files matched your search
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* (c) Copyright, Real-Time Innovations, 2021.
|
||||
* All rights reserved.
|
||||
* No duplications, whole or partial, manual or electronic, may be made
|
||||
* without express written permission. Any such copies, or
|
||||
* revisions thereof, must display this notice unaltered.
|
||||
* This code contains trade secrets of Real-Time Innovations, Inc.
|
||||
*
|
||||
* Description
|
||||
* -----------
|
||||
* Strictly for Windows DLL linkage resolution
|
||||
*/
|
||||
|
||||
|
||||
#ifndef wsdds_dll_h
|
||||
#define wsdds_dll_h
|
||||
|
||||
#if defined(RTI_WIN32) || defined(RTI_WINCE)
|
||||
#if defined(RTI_wsdds_DLL_EXPORT)
|
||||
#define WSDDSDllExport __declspec(dllexport)
|
||||
#else
|
||||
#define WSDDSDllExport
|
||||
#endif /* RTI_wsdds_DLL_EXPORT */
|
||||
|
||||
#if defined(RTI_wsdds_DLL_VARIABLE)
|
||||
#if defined(RTI_wsdds_DLL_EXPORT)
|
||||
#define WSDDSDllVariable __declspec(dllexport)
|
||||
#else
|
||||
#define WSDDSDllVariable __declspec(dllimport)
|
||||
#endif /* RTI_wsdds_DLL_EXPORT */
|
||||
#else
|
||||
#define WSDDSDllVariable
|
||||
#endif /* RTI_wsdds_DLL_VARIABLE */
|
||||
#elif defined(RTI_VISIBILITY_HIDDEN)
|
||||
#define WSDDSDllExport __attribute__((visibility("default")))
|
||||
#define WSDDSDllVariable __attribute__((visibility("default")))
|
||||
#else
|
||||
#define WSDDSDllExport
|
||||
#define WSDDSDllVariable
|
||||
#endif /* RTI_WIN32 || RTI_WINCE */
|
||||
|
||||
|
||||
#endif /* webintegrationservice_dll_h */
|
||||
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* (c) Copyright, Real-Time Innovations, 2021.
|
||||
* All rights reserved.
|
||||
*
|
||||
* No duplications, whole or partial, manual or electronic, may be made
|
||||
* without express written permission. Any such copies, or
|
||||
* revisions thereof, must display this notice unaltered.
|
||||
* This code contains trade secrets of Real-Time Innovations, Inc.
|
||||
*/
|
||||
|
||||
#ifndef WEBINTEGRATIONSERVICE_H
|
||||
#define WEBINTEGRATIONSERVICE_H
|
||||
|
||||
#include <dds/core/Reference.hpp>
|
||||
#include <rti/config/Logger.hpp>
|
||||
|
||||
#include <rti/webdds/ServiceProperty.hpp>
|
||||
#include <rti/webdds/Dll.hpp>
|
||||
#include <rti/webdds/detail/WebIntegrationServiceImpl.hpp>
|
||||
|
||||
namespace rti { namespace webdds {
|
||||
|
||||
/*e \defgroup RTI_WebIntegrationServiceLibModule RTI Web Integration Library API
|
||||
*
|
||||
* @brief @product can be deployed as a native library linked into your
|
||||
* application in select architectures.
|
||||
*
|
||||
* This API allows you to create, configure and start @product instances from
|
||||
* your application.
|
||||
*
|
||||
* The following code shows the typical use of the API:
|
||||
*
|
||||
* \code
|
||||
*
|
||||
* int main ()
|
||||
* {
|
||||
* rti::webdds::Service service(
|
||||
* rti::webdds::ServiceProperty()
|
||||
* .cfg_file("MyWebint.xml")
|
||||
* .cfg_name("MyWebint"));
|
||||
* ...
|
||||
*
|
||||
* service.start();
|
||||
*
|
||||
* while(keep_running) {
|
||||
* sleep();
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* return 0;
|
||||
* }
|
||||
*
|
||||
* \endcode
|
||||
*
|
||||
* Instead of a file, you can use XML strings to configure @product.
|
||||
* See ServiceProperty for more information.
|
||||
* <p>
|
||||
* To build your application you need to link with the @product native library
|
||||
* in <b> <@ndds home>/bin/<architecture>/ </b>.
|
||||
*
|
||||
* ### Development Requirements
|
||||
*
|
||||
* | | Unix-based Systems | Windows Systems |
|
||||
* | --------------: | :----------------: | :-------------: |
|
||||
* | Shared Libraries| librtiwebintegrationservice.so | rtiwebintegrationservice.dll|
|
||||
* | ^ | libnddscpp.so | nddscpp.dll |
|
||||
* | ^ | libnddsc.so | nddsc.dll |
|
||||
* | ^ | libnddscore.so | nddscore.dll |
|
||||
* | ^ | librtiapputilsc.so | rtiapputilsc.dll |
|
||||
* | ^ | librtisqlite.so | rtisqlite.dll |
|
||||
* | ^ | libcivetweb-cpp.so.1.15.0 | civetweb-cpp.dll |
|
||||
* | ^ | libcivetweb.so.1.15.0 | civetweb.dll |
|
||||
* | Headers | rti/webdds/Service.hpp | rti/webdds/Service.hpp |
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/** \ingroup RTI_WebIntegrationServiceLibModule
|
||||
*
|
||||
* @brief The @product.
|
||||
*
|
||||
*/
|
||||
class Service : public dds::core::Reference<WebIntegrationServiceImpl> {
|
||||
public:
|
||||
typedef dds::core::Reference<WebIntegrationServiceImpl> Base;
|
||||
OMG_DDS_REF_TYPE_NOTYPENAME(
|
||||
Service,
|
||||
dds::core::Reference,
|
||||
WebIntegrationServiceImpl);
|
||||
|
||||
/**
|
||||
* @brief Creates a @product instance
|
||||
*
|
||||
* @param[in] property
|
||||
* The property to configure @product instance.
|
||||
*
|
||||
*/
|
||||
Service(ServiceProperty&& property)
|
||||
: Base(new WebIntegrationServiceImpl(std::move(property)))
|
||||
{
|
||||
this->delegate()->remember_reference(this->delegate());
|
||||
}
|
||||
|
||||
explicit Service(Base::DELEGATE_REF_T reference) : Base(reference)
|
||||
{
|
||||
if (this->delegate()) {
|
||||
this->delegate()->remember_reference(this->delegate());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Starts @product.
|
||||
*
|
||||
* This is a non-blocking operation. @product will create its own set of
|
||||
* threads to perform its tasks.
|
||||
*/
|
||||
void start()
|
||||
{
|
||||
this->delegate()->start();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Stops @product.
|
||||
*
|
||||
* This operation will bloc the instance is fully stopped.
|
||||
*/
|
||||
void stop()
|
||||
{
|
||||
this->delegate()->stop();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // WEBINTEGRATIONSERVICE_H
|
||||
@@ -0,0 +1,341 @@
|
||||
/*
|
||||
* (c) Copyright, Real-Time Innovations, 2022.
|
||||
* All rights reserved.
|
||||
*
|
||||
* No duplications, whole or partial, manual or electronic, may be made
|
||||
* without express written permission. Any such copies, or
|
||||
* revisions thereof, must display this notice unaltered.
|
||||
* This code contains trade secrets of Real-Time Innovations, Inc.
|
||||
*/
|
||||
|
||||
#ifndef SERVICE_PROPERTY_H
|
||||
#define SERVICE_PROPERTY_H
|
||||
|
||||
#define SERVICE_DEFAULT_VERBOSITY 1
|
||||
#define WEBSERVER_DEFAULT_PORT_STR "8080"
|
||||
|
||||
#include <dds/core/macros.hpp>
|
||||
#include <rti/core/NativeValueType.hpp>
|
||||
|
||||
#include <rti/webdds/Dll.hpp>
|
||||
|
||||
namespace rti { namespace webdds {
|
||||
|
||||
// Forward declaration
|
||||
class AccessController;
|
||||
class LoggerDevice;
|
||||
|
||||
/**
|
||||
* \ingroup RTI_WebIntegrationServiceLibModule
|
||||
*
|
||||
* @brief Configuration properties for a @product object.
|
||||
*/
|
||||
class WSDDSDllExport ServiceProperty {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Service Property object
|
||||
*
|
||||
*/
|
||||
ServiceProperty();
|
||||
|
||||
ServiceProperty(const ServiceProperty&) = delete;
|
||||
ServiceProperty& operator=(const ServiceProperty&) = delete;
|
||||
ServiceProperty(ServiceProperty&&) = default;
|
||||
ServiceProperty& operator=(ServiceProperty&&) = default;
|
||||
|
||||
/**
|
||||
* @brief Destroy the Service Property object
|
||||
*
|
||||
*/
|
||||
~ServiceProperty();
|
||||
|
||||
/**
|
||||
* @brief Set it to true to enable the Builtin Topics REST API.
|
||||
*
|
||||
* Allows clients to read discovery information through the Builtin Topics.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
ServiceProperty& enable_builtin_topics(bool value);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
bool enable_builtin_topics() const;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Set it to true to enable the WebSockets REST API.
|
||||
*
|
||||
* Allows clients to read/write data through WebSockets.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
ServiceProperty& enable_websockets(bool value);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
bool enable_websockets() const;
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
bool list_api_keys() const;
|
||||
|
||||
/**
|
||||
* @brief Caches entities thread-specific storage.
|
||||
*
|
||||
* Caches WaitSet, Sample Buffer, and DynamicData objects in the
|
||||
* thread-specific storage of the worker threads that handle HTTP requests.
|
||||
*
|
||||
* You can limit the allocated resources by reducing the number of worker
|
||||
* threads via the set_webserver_option() method and setting the option
|
||||
* "num_threads"
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
ServiceProperty& enable_resource_caching(bool value);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
bool enable_resource_caching() const;
|
||||
|
||||
/**
|
||||
* @brief Enables the use of a custom logger.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
ServiceProperty& use_custom_logger(bool value);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
bool use_custom_logger() const;
|
||||
|
||||
/*i
|
||||
* @brief Set the Access Control List.
|
||||
*
|
||||
* @default nullptr
|
||||
*/
|
||||
ServiceProperty& acl(std::unique_ptr<AccessController> acl);
|
||||
|
||||
/*i
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
AccessController *acl() const;
|
||||
|
||||
/*i
|
||||
* This method enters a key-value pair into the webserver_options_ array.
|
||||
*
|
||||
* @param key Name of the option to be set.
|
||||
* @param value Value of the option.
|
||||
*/
|
||||
ServiceProperty& webserver_option(
|
||||
const std::string& option,
|
||||
const std::string& value);
|
||||
|
||||
/**
|
||||
* @brief Get the value of the webserver option.
|
||||
*
|
||||
* @param option Option name of the value to get.
|
||||
* @return Pointer to the value if it exists. nullptr otherwise.
|
||||
*/
|
||||
const std::string *webserver_option(const std::string& option) const;
|
||||
|
||||
/**
|
||||
* @brief This method return the webserver_options_ array.
|
||||
* the values are used as pairs of key-value each 2 values.
|
||||
*
|
||||
* @return const std::vector<std::string>&
|
||||
*/
|
||||
const std::vector<std::string>& webserver_options() const;
|
||||
|
||||
/**
|
||||
* @brief Specifies a configuration file to be loaded.
|
||||
*
|
||||
* @default Empty string
|
||||
*/
|
||||
ServiceProperty& cfgfile(const std::string& cfgfile);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
const std::string& cfgfile() const;
|
||||
|
||||
/**
|
||||
* @brief The name of the RTI Web Integration Service configuration to run.
|
||||
*
|
||||
* Web Integration Service will look for a matching
|
||||
* \<web_integration_service\> tag in the configuration file specified via
|
||||
* the cfg_file() method and in the default configuration files.
|
||||
*
|
||||
* @default Empty string
|
||||
*/
|
||||
ServiceProperty& cfgname(const std::string& cfgname);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
const std::string& cfgname() const;
|
||||
|
||||
/**
|
||||
* @brief The name of the Access Control List file.
|
||||
*
|
||||
* This parameter loads an Access Control List file, which enables access
|
||||
* control in all the HTTP requests and WebSocket (WS) connections. It is
|
||||
* recommended to use this parameter with a secured connection; i.e., it is
|
||||
* important to enable HTTPS and Secure WebSocket (WSS) in every single
|
||||
* listening_ports and provide an -sslCertificate.
|
||||
*
|
||||
* @default Empty string
|
||||
*/
|
||||
ServiceProperty& acl_file(const std::string& acl_file);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
const std::string& acl_file() const;
|
||||
|
||||
/**
|
||||
* @brief Add a new api key to the list of api keys.
|
||||
*
|
||||
* @default Empty string
|
||||
*/
|
||||
ServiceProperty& create_api_key(const std::string& api_key);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
const std::string& create_api_key() const;
|
||||
|
||||
/**
|
||||
* @brief Set it to true to list all the API keys available in an Access
|
||||
* Control List file.
|
||||
*
|
||||
* This method must be used in combination with the acl_file method to
|
||||
* specify the file from which API keys should be listed.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
ServiceProperty& list_api_keys(bool value);
|
||||
|
||||
/**
|
||||
* @brief Delete an api key from the list of api keys.
|
||||
*
|
||||
* @default Empty string
|
||||
*/
|
||||
ServiceProperty& delete_api_key(const std::string& api_key);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
const std::string& delete_api_key() const;
|
||||
|
||||
/*i
|
||||
* @brief Set the verbosity level param, must be used with
|
||||
* setup_verbosity_level() to apply the passed value.
|
||||
*/
|
||||
ServiceProperty& param_verbosity(int verbosity);
|
||||
|
||||
/*i
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
int param_verbosity();
|
||||
|
||||
/*i
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
int dds_verbosity();
|
||||
|
||||
/*i
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
int wsdds_verbosity();
|
||||
|
||||
/**
|
||||
* @brief Use this attribute to increase the maximum number of objects per
|
||||
* thread of RTI Data Distribution Service.
|
||||
*
|
||||
* @default 1024
|
||||
*/
|
||||
|
||||
ServiceProperty& max_objects_per_thread(int max_objects_per_thread);
|
||||
|
||||
/**
|
||||
* @brief Getter (see setter with the same name).
|
||||
*/
|
||||
int max_objects_per_thread();
|
||||
|
||||
/**
|
||||
* @brief Controls what type of messages are logged.
|
||||
*
|
||||
* The available levels are:
|
||||
*
|
||||
* 0. Silent
|
||||
* 1. Exceptions (Connext DDS and Web Integration Service)
|
||||
* 2. Warnings (Web Integration Service)
|
||||
* 3. Information (Web Integration Service)
|
||||
* 4. Warnings (Connext DDS and Web Integration Service)
|
||||
* 5. Tracing (Web Integration Service)
|
||||
* 6. Tracing (Connext DDS and Web Integration Service)
|
||||
*
|
||||
* Each verbosity level includes all the previous levels.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
ServiceProperty& setup_verbosity_level(int verbosity_level);
|
||||
|
||||
/**
|
||||
* @brief Set the up verbosity level that is in verbosity_ atributte.
|
||||
*/
|
||||
|
||||
ServiceProperty& setup_verbosity_level();
|
||||
|
||||
|
||||
/**
|
||||
* This method installs the custom logger, which enables the user to
|
||||
* store logging messages in the thread-specific storage to be able to
|
||||
* send them in HTTP responses.
|
||||
*/
|
||||
void install_logger();
|
||||
|
||||
/**
|
||||
* This method uninstalls the custom logger.
|
||||
*/
|
||||
void uninstall_logger();
|
||||
|
||||
private:
|
||||
// Arguments flags
|
||||
bool list_api_keys_;
|
||||
bool enable_resource_caching_;
|
||||
bool enable_builtin_topics_;
|
||||
bool enable_websockets_;
|
||||
|
||||
// DDS Options
|
||||
std::string cfgfile_;
|
||||
std::string cfgname_;
|
||||
std::string acl_file_;
|
||||
std::string create_api_key_;
|
||||
std::string delete_api_key_;
|
||||
std::string heap_snapshot_dir_;
|
||||
int verbosity_;
|
||||
int dds_verbosity_;
|
||||
int wsdds_verbosity_;
|
||||
int max_objects_per_thread_;
|
||||
|
||||
// WebServer options
|
||||
std::vector<std::string> webserver_options_;
|
||||
|
||||
// Logger device
|
||||
bool use_custom_logger_;
|
||||
std::unique_ptr<LoggerDevice> logger_device_;
|
||||
|
||||
// Access Controller
|
||||
std::unique_ptr<AccessController> acl_;
|
||||
};
|
||||
|
||||
}} // namespace rti::webdds
|
||||
|
||||
#endif // SERVICE_PROPERTY_H
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* (c) Copyright, Real-Time Innovations, 2021. All rights reserved.
|
||||
*
|
||||
* No duplications, whole or partial, manual or electronic, may be made
|
||||
* without express written permission. Any such copies, or
|
||||
* revisions thereof, must display this notice unaltered.
|
||||
* This code contains trade secrets of Real-Time Innovations, Inc.
|
||||
*/
|
||||
|
||||
#ifndef RTI_WSDDS_WEB_INTEGRATION_SERVICE_IMPL_HPP_
|
||||
#define RTI_WSDDS_WEB_INTEGRATION_SERVICE_IMPL_HPP_
|
||||
|
||||
#include <dds/core/refmacros.hpp>
|
||||
#include <rti/core/detail/SelfReference.hpp>
|
||||
#include <rti/webdds/Dll.hpp>
|
||||
|
||||
#include <rti/webdds/ServiceProperty.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace rti { namespace webdds {
|
||||
|
||||
namespace service {
|
||||
class Service;
|
||||
}
|
||||
|
||||
class WSDDSDllExport WebIntegrationServiceImpl
|
||||
: public rti::core::detail::RetainableType<WebIntegrationServiceImpl>
|
||||
{
|
||||
public:
|
||||
explicit WebIntegrationServiceImpl(ServiceProperty&& property);
|
||||
|
||||
~WebIntegrationServiceImpl();
|
||||
|
||||
void start();
|
||||
|
||||
void stop();
|
||||
|
||||
private:
|
||||
std::unique_ptr<rti::webdds::service::Service> impl_;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // RTI_WSDDS_WEB_INTEGRATION_SERVICE_IMPL_HPP_
|
||||
Reference in new issue
Block a user