Class: Sequent::Configuration
- Inherits:
-
Object
- Object
- Sequent::Configuration
- Defined in:
- lib/sequent/configuration.rb
Constant Summary collapse
- DEFAULT_VERSIONS_TABLE_NAME =
'sequent_versions'
- DEFAULT_REPLAYED_IDS_TABLE_NAME =
'sequent_replayed_ids'
- DEFAULT_MIGRATION_SQL_FILES_DIRECTORY =
'db/tables'
- DEFAULT_DATABASE_CONFIG_DIRECTORY =
'db'
- DEFAULT_VIEW_SCHEMA_NAME =
'view_schema'
- DEFAULT_EVENT_STORE_SCHEMA_NAME =
'sequent_schema'
- MIGRATIONS_CLASS_NAME =
'Sequent::Migrations::Projectors'
- DEFAULT_NUMBER_OF_REPLAY_PROCESSES =
4
- DEFAULT_OFFLINE_REPLAY_PERSISTOR_CLASS =
Sequent::Core::Persistors::ActiveRecordPersistor
- DEFAULT_ONLINE_REPLAY_PERSISTOR_CLASS =
Sequent::Core::Persistors::ActiveRecordPersistor
Instance Attribute Summary collapse
-
#aggregate_repository ⇒ Object
Returns the value of attribute aggregate_repository.
-
#command_filters ⇒ Object
Returns the value of attribute command_filters.
-
#command_handlers ⇒ Object
Returns the value of attribute command_handlers.
-
#command_service ⇒ Object
Returns the value of attribute command_service.
-
#database_config_directory ⇒ Object
Returns the value of attribute database_config_directory.
-
#disable_event_handlers ⇒ Object
Returns the value of attribute disable_event_handlers.
-
#event_handlers ⇒ Object
Returns the value of attribute event_handlers.
-
#event_publisher ⇒ Object
Returns the value of attribute event_publisher.
-
#event_record_class ⇒ Object
Returns the value of attribute event_record_class.
-
#event_store ⇒ Object
Returns the value of attribute event_store.
-
#event_store_schema_name ⇒ Object
Returns the value of attribute event_store_schema_name.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#migration_sql_files_directory ⇒ Object
Returns the value of attribute migration_sql_files_directory.
-
#migrations_class_name ⇒ Object
Returns the value of attribute migrations_class_name.
-
#number_of_replay_processes ⇒ Object
Returns the value of attribute number_of_replay_processes.
-
#offline_replay_persistor_class ⇒ Object
Returns the value of attribute offline_replay_persistor_class.
-
#online_replay_persistor_class ⇒ Object
Returns the value of attribute online_replay_persistor_class.
-
#replayed_ids_table_name ⇒ Object
Returns the value of attribute replayed_ids_table_name.
-
#snapshot_event_class ⇒ Object
Returns the value of attribute snapshot_event_class.
-
#stream_record_class ⇒ Object
Returns the value of attribute stream_record_class.
-
#transaction_provider ⇒ Object
Returns the value of attribute transaction_provider.
-
#uuid_generator ⇒ Object
Returns the value of attribute uuid_generator.
-
#versions_table_name ⇒ Object
Returns the value of attribute versions_table_name.
-
#view_schema_name ⇒ Object
Returns the value of attribute view_schema_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/sequent/configuration.rb', line 72 def initialize self.command_handlers = [] self.command_filters = [] self.event_handlers = [] self.aggregate_repository = Sequent::Core::AggregateRepository.new self.event_store = Sequent::Core::EventStore.new self.command_service = Sequent::Core::CommandService.new self.event_record_class = Sequent::Core::EventRecord self.stream_record_class = Sequent::Core::StreamRecord self.snapshot_event_class = Sequent::Core::SnapshotEvent self.transaction_provider = Sequent::Core::Transactions::NoTransactions.new self.uuid_generator = Sequent::Core::RandomUuidGenerator self.event_publisher = Sequent::Core::EventPublisher.new self.disable_event_handlers = false self.versions_table_name = DEFAULT_VERSIONS_TABLE_NAME self.replayed_ids_table_name = DEFAULT_REPLAYED_IDS_TABLE_NAME self.migration_sql_files_directory = DEFAULT_MIGRATION_SQL_FILES_DIRECTORY self.view_schema_name = DEFAULT_VIEW_SCHEMA_NAME self.event_store_schema_name = DEFAULT_EVENT_STORE_SCHEMA_NAME self.migrations_class_name = MIGRATIONS_CLASS_NAME self.number_of_replay_processes = DEFAULT_NUMBER_OF_REPLAY_PROCESSES self.offline_replay_persistor_class = DEFAULT_OFFLINE_REPLAY_PERSISTOR_CLASS self.online_replay_persistor_class = DEFAULT_ONLINE_REPLAY_PERSISTOR_CLASS self.database_config_directory = DEFAULT_DATABASE_CONFIG_DIRECTORY self.logger = Logger.new(STDOUT).tap {|l| l.level = Logger::INFO } end |
Instance Attribute Details
#aggregate_repository ⇒ Object
Returns the value of attribute aggregate_repository.
27 28 29 |
# File 'lib/sequent/configuration.rb', line 27 def aggregate_repository @aggregate_repository end |
#command_filters ⇒ Object
Returns the value of attribute command_filters.
37 38 39 |
# File 'lib/sequent/configuration.rb', line 37 def command_filters @command_filters end |
#command_handlers ⇒ Object
Returns the value of attribute command_handlers.
37 38 39 |
# File 'lib/sequent/configuration.rb', line 37 def command_handlers @command_handlers end |
#command_service ⇒ Object
Returns the value of attribute command_service.
29 30 31 |
# File 'lib/sequent/configuration.rb', line 29 def command_service @command_service end |
#database_config_directory ⇒ Object
Returns the value of attribute database_config_directory.
48 49 50 |
# File 'lib/sequent/configuration.rb', line 48 def database_config_directory @database_config_directory end |
#disable_event_handlers ⇒ Object
Returns the value of attribute disable_event_handlers.
44 45 46 |
# File 'lib/sequent/configuration.rb', line 44 def disable_event_handlers @disable_event_handlers end |
#event_handlers ⇒ Object
Returns the value of attribute event_handlers.
40 41 42 |
# File 'lib/sequent/configuration.rb', line 40 def event_handlers @event_handlers end |
#event_publisher ⇒ Object
Returns the value of attribute event_publisher.
29 30 31 |
# File 'lib/sequent/configuration.rb', line 29 def event_publisher @event_publisher end |
#event_record_class ⇒ Object
Returns the value of attribute event_record_class.
29 30 31 |
# File 'lib/sequent/configuration.rb', line 29 def event_record_class @event_record_class end |
#event_store ⇒ Object
Returns the value of attribute event_store.
29 30 31 |
# File 'lib/sequent/configuration.rb', line 29 def event_store @event_store end |
#event_store_schema_name ⇒ Object
Returns the value of attribute event_store_schema_name.
48 49 50 |
# File 'lib/sequent/configuration.rb', line 48 def event_store_schema_name @event_store_schema_name end |
#logger ⇒ Object
Returns the value of attribute logger.
46 47 48 |
# File 'lib/sequent/configuration.rb', line 46 def logger @logger end |
#migration_sql_files_directory ⇒ Object
Returns the value of attribute migration_sql_files_directory.
48 49 50 |
# File 'lib/sequent/configuration.rb', line 48 def migration_sql_files_directory @migration_sql_files_directory end |
#migrations_class_name ⇒ Object
Returns the value of attribute migrations_class_name.
56 57 58 |
# File 'lib/sequent/configuration.rb', line 56 def migrations_class_name @migrations_class_name end |
#number_of_replay_processes ⇒ Object
Returns the value of attribute number_of_replay_processes.
48 49 50 |
# File 'lib/sequent/configuration.rb', line 48 def number_of_replay_processes @number_of_replay_processes end |
#offline_replay_persistor_class ⇒ Object
Returns the value of attribute offline_replay_persistor_class.
48 49 50 |
# File 'lib/sequent/configuration.rb', line 48 def offline_replay_persistor_class @offline_replay_persistor_class end |
#online_replay_persistor_class ⇒ Object
Returns the value of attribute online_replay_persistor_class.
48 49 50 |
# File 'lib/sequent/configuration.rb', line 48 def online_replay_persistor_class @online_replay_persistor_class end |
#replayed_ids_table_name ⇒ Object
Returns the value of attribute replayed_ids_table_name.
56 57 58 |
# File 'lib/sequent/configuration.rb', line 56 def replayed_ids_table_name @replayed_ids_table_name end |
#snapshot_event_class ⇒ Object
Returns the value of attribute snapshot_event_class.
29 30 31 |
# File 'lib/sequent/configuration.rb', line 29 def snapshot_event_class @snapshot_event_class end |
#stream_record_class ⇒ Object
Returns the value of attribute stream_record_class.
29 30 31 |
# File 'lib/sequent/configuration.rb', line 29 def stream_record_class @stream_record_class end |
#transaction_provider ⇒ Object
Returns the value of attribute transaction_provider.
29 30 31 |
# File 'lib/sequent/configuration.rb', line 29 def transaction_provider @transaction_provider end |
#uuid_generator ⇒ Object
Returns the value of attribute uuid_generator.
42 43 44 |
# File 'lib/sequent/configuration.rb', line 42 def uuid_generator @uuid_generator end |
#versions_table_name ⇒ Object
Returns the value of attribute versions_table_name.
56 57 58 |
# File 'lib/sequent/configuration.rb', line 56 def versions_table_name @versions_table_name end |
#view_schema_name ⇒ Object
Returns the value of attribute view_schema_name.
48 49 50 |
# File 'lib/sequent/configuration.rb', line 48 def view_schema_name @view_schema_name end |
Class Method Details
.instance ⇒ Object
60 61 62 |
# File 'lib/sequent/configuration.rb', line 60 def self.instance @instance ||= new end |
.reset ⇒ Object
64 65 66 |
# File 'lib/sequent/configuration.rb', line 64 def self.reset @instance = new end |
.restore(configuration) ⇒ Object
68 69 70 |
# File 'lib/sequent/configuration.rb', line 68 def self.restore(configuration) @instance = configuration end |