RTI Recording Service  Version 6.1.1
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 
29 namespace 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 
68 typedef dds::core::safe_enum<ApplicationRoleKind_def> ApplicationRoleKind;
69 
70 /*i
71  * @brief Internal use only
72  */
73 struct XmlConverterRoleKind_def {
74 
75  enum type {
76  RECORD_CONVERT,
77  REPLAY_CONVERT,
78  count_
79  };
80 };
81 
82 typedef dds::core::safe_enum<XmlConverterRoleKind_def> XmlConverterRoleKind;
83 
84 /*i
85  * @brief Indexer mode enumeration, used by the index application (offline
86  * indexing)
87  */
88 struct IndexerModeKind_def {
89 
90  enum type {
91  INSTANCE_INDEXING,
92  SQLITE_INDEXING,
93  count_
94  };
95 };
96 typedef dds::core::safe_enum<IndexerModeKind_def> IndexerModeKind;
97 
98 typedef rti::routing::PropertySet PropertySet;
99 
106 public:
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  xml_converter_role_(XmlConverterRoleKind::RECORD_CONVERT),
125  indexer_mode_(IndexerModeKind::INSTANCE_INDEXING)
126 
127  {
128 
129  }
130 
134  const std::string& cfg_file() const
135  {
136  return cfg_file_;
137  }
138 
144  ServiceProperty& cfg_file(const std::string & cfg_file)
145  {
146  cfg_file_ = cfg_file;
147 
148  return *this;
149  }
150 
154  const std::string & service_name() const
155  {
156  return service_name_;
157  }
158 
169  ServiceProperty& service_name(const std::string & service_name)
170  {
171  service_name_ = service_name;
172 
173  return *this;
174  }
175 
179  const std::string & application_name() const
180  {
181  return application_name_;
182  }
183 
198  ServiceProperty& application_name(const std::string & application_name)
199  {
200  application_name_ = application_name;
201 
202  return *this;
203  }
204 
205 
209  int32_t domain_id_base() const
210  {
211  return domain_id_base_;
212  }
213 
218  {
219  return enforce_xsd_validation_;
220  }
221 
229  {
230  enforce_xsd_validation_ = enforce;
231 
232  return *this;
233  }
234 
243  ServiceProperty& domain_id_base(int32_t domain_id)
244  {
245  domain_id_base_ = domain_id;
246 
247  return *this;
248  }
249 
254  {
255  return enable_administration_;
256  }
257 
264  ServiceProperty& enable_administration(bool enable_administration)
265  {
266  enable_administration_ = enable_administration;
267 
268  return *this;
269  }
270 
274  int32_t administration_domain_id() const
275  {
276  return administration_domain_id_;
277  }
278 
290  {
291  administration_domain_id_ = domain_id;
292 
293  return *this;
294  }
295 
299  bool enable_monitoring() const
300  {
301  return enable_monitoring_;
302  }
303 
310  ServiceProperty& enable_monitoring(bool enable_monitoring)
311  {
312  enable_monitoring_ = enable_monitoring;
313  return *this;
314  }
315 
319  int32_t monitoring_domain_id() const
320  {
321  return monitoring_domain_id_;
322  }
323 
335  {
336  monitoring_domain_id_ = domain_id;
337  return *this;
338  }
339 
343  const ApplicationRoleKind& application_role() const
344  {
345  return application_role_;
346  }
347 
353  ServiceProperty& application_role(ApplicationRoleKind application_role)
354  {
355  application_role_ = application_role;
356  return *this;
357  }
358 
362  bool ignore_default_files() const
363  {
364  return ignore_default_files_;
365  }
366 
377  {
378  ignore_default_files_ = ignore;
379  return *this;
380  }
381 
385  const std::string& license_file() const
386  {
387  return license_file_;
388  }
389 
396  ServiceProperty& license_file(const std::string& license_file)
397  {
398  license_file_ = license_file;
399  return *this;
400  }
401 
402  /*i
403  * @brief Internal use only
404  */
405  const std::string output_cfg_file() const
406  {
407  return output_cfg_file_;
408  }
409 
410  /*i
411  * @brief Internal use only
412  */
413  ServiceProperty& output_cfg_file(
414  const std::string & output_cfg_file)
415  {
416  output_cfg_file_ = output_cfg_file;
417  return *this;
418  }
419 
423  bool debug_mode() const
424  {
425  return debug_mode_;
426  }
427 
434  ServiceProperty& debug_mode(bool debug_mode)
435  {
436  debug_mode_ = debug_mode;
437 
438  return *this;
439  }
440 
441  /*i
442  * @brief Internal use only
443  */
444  XmlConverterRoleKind xml_converter_role() const
445  {
446  return xml_converter_role_;
447  }
448 
449  /*i
450  * @brief Internal use only
451  */
452  ServiceProperty& xml_converter_role(
453  const XmlConverterRoleKind & xml_converter_role)
454  {
455  xml_converter_role_ = xml_converter_role;
456  return *this;
457  }
458 
459  /*i
460  * @brief The indexer application mode. Defined by the IndexerModeKind.
461  * Internal use only
462  */
463  IndexerModeKind indexer_mode() const
464  {
465  return indexer_mode_;
466  }
467 
468  /*i
469  * @brief Set the indexer application mode. Defined by the IndexerModeKind.
470  * Internal use only
471  */
472  ServiceProperty& indexer_mode(const IndexerModeKind& indexer_mode)
473  {
474  indexer_mode_ = indexer_mode;
475  return *this;
476  }
477 
478  /*i
479  * @brief The indexer database directory.
480  * Internal use only
481  */
482  const std::string& db_directory() const
483  {
484  return db_directory_;
485  }
486 
487  /*i
488  * @brief Set the indexer database directory.
489  * Internal use only
490  */
491  ServiceProperty& db_directory(const std::string& db_directory)
492  {
493  db_directory_ = db_directory;
494  return *this;
495  }
496 
500  const PropertySet& user_environment() const
501  {
502  return user_env_;
503  }
504 
509  PropertySet& user_environment()
510  {
511  return user_env_;
512  }
513 
522  ServiceProperty& user_environment(const PropertySet& user_environment)
523  {
524  user_env_ = user_environment;
525 
526  return *this;
527  }
528 
529 private:
530  std::string cfg_file_;
531  //std::string cfg_strings[] ?
532  std::string service_name_;
533  std::string application_name_;
534  int32_t domain_id_base_;
535  bool enable_administration_;
536  int32_t administration_domain_id_;
537  bool enable_monitoring_;
538  int32_t monitoring_domain_id_;
539  ApplicationRoleKind application_role_;
540  bool enforce_xsd_validation_;
541  bool ignore_default_files_;
542  std::string license_file_;
543  // Specific to XML conversion
544  std::string output_cfg_file_;
545  bool debug_mode_;
546  XmlConverterRoleKind xml_converter_role_;
547  IndexerModeKind indexer_mode_;
548  std::string db_directory_;
549  PropertySet user_env_;
550 };
551 
552 
553 } } /* namespace rti::recording */
554 
555 #endif /* HPP_SERVICE_SERVICEPROPERTY_HPP_ */
const ApplicationRoleKind & application_role() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:343
int32_t administration_domain_id() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:274
PropertySet & user_environment()
Non-const getter for modification that can be used to add elements individually. (see setter with the...
Definition: ServiceProperty.hpp:509
ServiceProperty & enforce_xsd_validation(bool enforce)
Controls whether the service applies XSD validation to the loaded configuration.
Definition: ServiceProperty.hpp:228
int32_t monitoring_domain_id() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:319
ServiceProperty & enable_administration(bool enable_administration)
Set this to true to enable remote administration or false to disable it.
Definition: ServiceProperty.hpp:264
const PropertySet & user_environment() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:500
ServiceProperty & debug_mode(bool debug_mode)
Set this to true to enable debug mode or false to disable it.
Definition: ServiceProperty.hpp:434
Converter mode.
Definition: ServiceProperty.hpp:53
int32_t domain_id_base() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:209
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:376
ServiceProperty & application_name(const std::string &application_name)
Assigns a name to the execution of the RTI Recording Service.
Definition: ServiceProperty.hpp:198
type
The underlying enum type.
Definition: ServiceProperty.hpp:41
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:334
Configuration for a RTI Recording Service object.
Definition: ServiceProperty.hpp:105
const std::string & application_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:179
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:522
bool ignore_default_files() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:362
const std::string & service_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:154
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:289
Record mode.
Definition: ServiceProperty.hpp:45
Replay mode.
Definition: ServiceProperty.hpp:49
Definition: ServiceProperty.hpp:37
ServiceProperty & license_file(const std::string &license_file)
Path to an RTI Connext license file. This field is only used by license-managed versions of the tool...
Definition: ServiceProperty.hpp:396
const std::string & license_file() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:385
bool enable_monitoring() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:299
The RTI namespace.
Definition: RecordingServiceImpl.hpp:22
ServiceProperty & enable_monitoring(bool enable_monitoring)
Set it to true to enable remote monitoring or false to disable it.
Definition: ServiceProperty.hpp:310
const std::string & cfg_file() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:134
ServiceProperty & cfg_file(const std::string &cfg_file)
Path to an RTI Recording Service configuration file.
Definition: ServiceProperty.hpp:144
ServiceProperty()
Creates a property object with default settings.
Definition: ServiceProperty.hpp:110
bool enforce_xsd_validation() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:217
bool enable_administration() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:253
ServiceProperty & service_name(const std::string &service_name)
The name of the RTI Recording Service configuration to run.
Definition: ServiceProperty.hpp:169
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:243
ServiceProperty & application_role(ApplicationRoleKind application_role)
Selects the operation mode of the service.
Definition: ServiceProperty.hpp:353
bool debug_mode() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:423