RTI Recording Service Version 7.2.0
ServiceProperty.hpp
1/*
2 * $Id$
3 *
4 * (c) Copyright, Real-Time Innovations, 2016-.
5 * All rights reserved.
6 * No duplications, whole or partial, manual or electronic, may be made
7 * without express written permission. Any such copies, or
8 * revisions thereof, must display this notice unaltered.
9 * This code contains trade secrets of Real-Time Innovations, Inc.
10 */
11
12#ifndef HPP_SERVICE_SERVICEPROPERTY_HPP_
13#define HPP_SERVICE_SERVICEPROPERTY_HPP_
14
15#include "stdio.h"
16#include "stdlib.h"
17#include <string>
18#include <stdint.h>
19#include <map>
20
21#include "osapi/osapi_type.h"
22
23#include "routingservice/routingservice_infrastructure.h"
24#include "routingservice/routingservice_service.h"
25
26#include <dds/core/SafeEnumeration.hpp>
27#include <rti/recording/PropertySet.hpp>
28
29namespace rti { namespace recording {
30
41 enum type {
54 /*i
55 * @brief Internal use only
56 */
57 XML_CONVERTER_APPLICATION,
58 /*i
59 * @brief Indexer mode. To be used internally by our command-line tool.
60 */
61 INDEX_APPLICATION,
62 /*i
63 */
64 count_
65 };
66};
67
68typedef dds::core::safe_enum<ApplicationRoleKind_def> ApplicationRoleKind;
69
70/*i
71 * @brief Internal use only
72 */
73struct XmlConverterRoleKind_def {
74
75 enum type {
76 RECORD_CONVERT,
77 REPLAY_CONVERT,
78 count_
79 };
80};
81
82typedef dds::core::safe_enum<XmlConverterRoleKind_def> XmlConverterRoleKind;
83
84/*i
85 * @brief Indexer mode enumeration, used by the index application (offline
86 * indexing)
87 */
88struct IndexerModeKind_def {
89
90 enum type {
91 INSTANCE_INDEXING,
92 SQLITE_INDEXING,
93 count_
94 };
95};
96typedef dds::core::safe_enum<IndexerModeKind_def> IndexerModeKind;
97
98typedef rti::routing::PropertySet PropertySet;
99
106public:
111 cfg_file_(""),
112 service_name_(""),
113 application_name_(""),
114 domain_id_base_(0),
115 enable_administration_(false),
116 administration_domain_id_(0),
117 enable_monitoring_(false),
118 monitoring_domain_id_(0),
119 application_role_(ApplicationRoleKind::RECORD_APPLICATION),
120 enforce_xsd_validation_(true),
121 ignore_default_files_(false),
122 output_cfg_file_(""),
123 debug_mode_(false),
124 reverse_mode_(false),
125 xml_converter_role_(XmlConverterRoleKind::RECORD_CONVERT),
126 indexer_mode_(IndexerModeKind::INSTANCE_INDEXING),
127 user_env_()
128
129 {
130
131 }
132
136 const std::string& cfg_file() const
137 {
138 return cfg_file_;
139 }
140
146 ServiceProperty& cfg_file(const std::string & cfg_file)
147 {
148 cfg_file_ = cfg_file;
149
150 return *this;
151 }
152
156 const std::string & service_name() const
157 {
158 return service_name_;
159 }
160
172 {
173 service_name_ = service_name;
174
175 return *this;
176 }
177
181 const std::string & application_name() const
182 {
183 return application_name_;
184 }
185
201 {
202 application_name_ = application_name;
203
204 return *this;
205 }
206
207
211 int32_t domain_id_base() const
212 {
213 return domain_id_base_;
214 }
215
220 {
221 return enforce_xsd_validation_;
222 }
223
231 {
232 enforce_xsd_validation_ = enforce;
233
234 return *this;
235 }
236
245 ServiceProperty& domain_id_base(int32_t domain_id)
246 {
247 domain_id_base_ = domain_id;
248
249 return *this;
250 }
251
256 {
257 return enable_administration_;
258 }
259
267 {
268 enable_administration_ = enable_administration;
269
270 return *this;
271 }
272
277 {
278 return administration_domain_id_;
279 }
280
292 {
293 administration_domain_id_ = domain_id;
294
295 return *this;
296 }
297
301 bool enable_monitoring() const
302 {
303 return enable_monitoring_;
304 }
305
313 {
314 enable_monitoring_ = enable_monitoring;
315 return *this;
316 }
317
321 int32_t monitoring_domain_id() const
322 {
323 return monitoring_domain_id_;
324 }
325
337 {
338 monitoring_domain_id_ = domain_id;
339 return *this;
340 }
341
345 const ApplicationRoleKind& application_role() const
346 {
347 return application_role_;
348 }
349
356 {
357 application_role_ = application_role;
358 return *this;
359 }
360
365 {
366 return ignore_default_files_;
367 }
368
379 {
380 ignore_default_files_ = ignore;
381 return *this;
382 }
383
387 const std::string& license_file() const
388 {
389 return license_file_;
390 }
391
399 {
400 license_file_ = license_file;
401 return *this;
402 }
403
404 /*i
405 * @brief Internal use only
406 */
407 const std::string output_cfg_file() const
408 {
409 return output_cfg_file_;
410 }
411
412 /*i
413 * @brief Internal use only
414 */
415 ServiceProperty& output_cfg_file(
416 const std::string & output_cfg_file)
417 {
418 output_cfg_file_ = output_cfg_file;
419 return *this;
420 }
421
425 bool debug_mode() const
426 {
427 return debug_mode_;
428 }
429
437 {
438 debug_mode_ = debug_mode;
439
440 return *this;
441 }
442
446 bool reverse_mode() const
447 {
448 return reverse_mode_;
449 }
450
458 {
459 reverse_mode_ = reverse_mode;
460
461 return *this;
462 }
463
464 /*i
465 * @brief Internal use only
466 */
467 XmlConverterRoleKind xml_converter_role() const
468 {
469 return xml_converter_role_;
470 }
471
472 /*i
473 * @brief Internal use only
474 */
475 ServiceProperty& xml_converter_role(
476 const XmlConverterRoleKind & xml_converter_role)
477 {
478 xml_converter_role_ = xml_converter_role;
479 return *this;
480 }
481
482 /*i
483 * @brief The indexer application mode. Defined by the IndexerModeKind.
484 * Internal use only
485 */
486 IndexerModeKind indexer_mode() const
487 {
488 return indexer_mode_;
489 }
490
491 /*i
492 * @brief Set the indexer application mode. Defined by the IndexerModeKind.
493 * Internal use only
494 */
495 ServiceProperty& indexer_mode(const IndexerModeKind& indexer_mode)
496 {
497 indexer_mode_ = indexer_mode;
498 return *this;
499 }
500
501 /*i
502 * @brief The indexer database directory.
503 * Internal use only
504 */
505 const std::string& db_directory() const
506 {
507 return db_directory_;
508 }
509
510 /*i
511 * @brief Set the indexer database directory.
512 * Internal use only
513 */
514 ServiceProperty& db_directory(const std::string& db_directory)
515 {
516 db_directory_ = db_directory;
517 return *this;
518 }
519
523 const PropertySet& user_environment() const
524 {
525 return user_env_;
526 }
527
532 PropertySet& user_environment()
533 {
534 return user_env_;
535 }
536
546 {
547 user_env_ = user_environment;
548
549 return *this;
550 }
551
552private:
553 std::string cfg_file_;
554 //std::string cfg_strings[] ?
555 std::string service_name_;
556 std::string application_name_;
557 int32_t domain_id_base_;
558 bool enable_administration_;
559 int32_t administration_domain_id_;
560 bool enable_monitoring_;
561 int32_t monitoring_domain_id_;
562 ApplicationRoleKind application_role_;
563 bool enforce_xsd_validation_;
564 bool ignore_default_files_;
565 std::string license_file_;
566 // Specific to XML conversion
567 std::string output_cfg_file_;
568 bool debug_mode_;
569 bool reverse_mode_;
570 XmlConverterRoleKind xml_converter_role_;
571 IndexerModeKind indexer_mode_;
572 std::string db_directory_;
573 PropertySet user_env_;
574};
575
576
577} } /* namespace rti::recording */
578
579#endif /* HPP_SERVICE_SERVICEPROPERTY_HPP_ */
Configuration for a RTI Recording Service object.
Definition: ServiceProperty.hpp:105
ServiceProperty & enable_administration(bool enable_administration)
Set this to true to enable remote administration or false to disable it.
Definition: ServiceProperty.hpp:266
const std::string & cfg_file() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:136
ServiceProperty & cfg_file(const std::string &cfg_file)
Path to an RTI Recording Service configuration file.
Definition: ServiceProperty.hpp:146
int32_t administration_domain_id() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:276
int32_t domain_id_base() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:211
int32_t monitoring_domain_id() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:321
bool enable_monitoring() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:301
bool ignore_default_files() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:364
bool debug_mode() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:425
ServiceProperty & application_role(ApplicationRoleKind application_role)
Selects the operation mode of the service.
Definition: ServiceProperty.hpp:355
ServiceProperty & license_file(const std::string &license_file)
Path to an RTI Connext license file. This parameter is only used if your installation requires a lice...
Definition: ServiceProperty.hpp:398
ServiceProperty & service_name(const std::string &service_name)
The name of the RTI Recording Service configuration to run.
Definition: ServiceProperty.hpp:171
ServiceProperty & administration_domain_id(int32_t domain_id)
If ServiceProperty::enable_administration is true, this is the domain ID to use for remote administra...
Definition: ServiceProperty.hpp:291
ServiceProperty & reverse_mode(bool reverse_mode)
Set this to true to enable reverse mode or false to disable it.
Definition: ServiceProperty.hpp:457
ServiceProperty & enforce_xsd_validation(bool enforce)
Controls whether the service applies XSD validation to the loaded configuration.
Definition: ServiceProperty.hpp:230
bool reverse_mode() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:446
const std::string & service_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:156
ServiceProperty & enable_monitoring(bool enable_monitoring)
Set it to true to enable remote monitoring or false to disable it.
Definition: ServiceProperty.hpp:312
const std::string & license_file() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:387
ServiceProperty()
Creates a property object with default settings.
Definition: ServiceProperty.hpp:110
const ApplicationRoleKind & application_role() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:345
ServiceProperty & debug_mode(bool debug_mode)
Set this to true to enable debug mode or false to disable it.
Definition: ServiceProperty.hpp:436
bool enforce_xsd_validation() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:219
bool enable_administration() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:255
ServiceProperty & monitoring_domain_id(int32_t domain_id)
If ServiceProperty::enable_monitoring is true, this is the domain ID to use for remote monitoring.
Definition: ServiceProperty.hpp:336
ServiceProperty & ignore_default_files(bool ignore)
Set it to true to avoid loading the standard files usually loaded by RTI Recording Service.
Definition: ServiceProperty.hpp:378
PropertySet & user_environment()
Non-const getter for modification that can be used to add elements individually. (see setter with the...
Definition: ServiceProperty.hpp:532
const PropertySet & user_environment() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:523
const std::string & application_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:181
ServiceProperty & application_name(const std::string &application_name)
Assigns a name to the execution of the RTI Recording Service.
Definition: ServiceProperty.hpp:200
ServiceProperty & domain_id_base(int32_t domain_id)
Value that is added to the domain IDs of the domain routes in the XML configuration.
Definition: ServiceProperty.hpp:245
ServiceProperty & user_environment(const PropertySet &user_environment)
Dictionary of user variables. The dictionary provides a parallel way to expand XML configuration vari...
Definition: ServiceProperty.hpp:545
The RTI namespace.
Definition: RecordingServiceImpl.hpp:22
Definition: ServiceProperty.hpp:37
type
The underlying enum type.
Definition: ServiceProperty.hpp:41
@ RECORD_APPLICATION
Record mode.
Definition: ServiceProperty.hpp:45
@ CONVERTER_APPLICATION
Converter mode.
Definition: ServiceProperty.hpp:53
@ REPLAY_APPLICATION
Replay mode.
Definition: ServiceProperty.hpp:49