CatapultServer  v0.5.0.1 (Elephant)
catapult::plugins::PluginManager Class Reference

A manager for registering plugins. More...

Collaboration diagram for catapult::plugins::PluginManager:

Public Member Functions

 PluginManager (const model::BlockChainConfiguration &config, const StorageConfiguration &storageConfig, const config::InflationConfiguration &inflationConfig)
 Creates a new plugin manager around config, storageConfig and inflationConfig. More...
 
const model::BlockChainConfigurationconfig () const
 Gets the block chain configuration. More...
 
const StorageConfigurationstorageConfig () const
 Gets the storage configuration. More...
 
cache::CacheConfiguration cacheConfig (const std::string &name) const
 Gets the cache configuration for cache with name. More...
 
const config::InflationConfigurationinflationConfig () const
 Gets the inflation configuration. More...
 
void addTransactionSupport (std::unique_ptr< model::TransactionPlugin > &&pTransactionPlugin)
 Adds support for a transaction described by pTransactionPlugin. More...
 
const model::TransactionRegistrytransactionRegistry () const
 Gets the transaction registry. More...
 
template<typename TStorageTraits , typename TCache >
void addCacheSupport (std::unique_ptr< TCache > &&pSubCache)
 Adds support for a sub cache described by pSubCache. More...
 
void addCacheSupport (std::unique_ptr< cache::SubCachePlugin > &&pSubCachePlugin)
 Adds support for a sub cache registered by pSubCachePlugin. More...
 
cache::CatapultCache createCache ()
 Creates a catapult cache. More...
 
void addHandlerHook (const HandlerHook &hook)
 Adds a (non-diagnostic) handler hook. More...
 
void addHandlers (ionet::ServerPacketHandlers &handlers, const cache::CatapultCache &cache) const
 Adds all (non-diagnostic) handlers to handlers given cache. More...
 
void addDiagnosticHandlerHook (const HandlerHook &hook)
 Adds a diagnostic handler hook. More...
 
void addDiagnosticCounterHook (const CounterHook &hook)
 Adds a diagnostic counter hook. More...
 
void addDiagnosticHandlers (ionet::ServerPacketHandlers &handlers, const cache::CatapultCache &cache) const
 Adds all diagnostic handlers to handlers given cache. More...
 
void addDiagnosticCounters (std::vector< utils::DiagnosticCounter > &counters, const cache::CatapultCache &cache) const
 Adds all diagnostic counters to counters given cache. More...
 
void addStatelessValidatorHook (const StatelessValidatorHook &hook)
 Adds a stateless validator hook. More...
 
void addStatefulValidatorHook (const StatefulValidatorHook &hook)
 Adds a stateful validator hook. More...
 
StatelessValidatorPointer createStatelessValidator (const validators::ValidationResultPredicate &isSuppressedFailure) const
 Creates a stateless validator that ignores suppressed failures according to isSuppressedFailure. More...
 
StatelessValidatorPointer createStatelessValidator () const
 Creates a stateless validator with no suppressed failures. More...
 
StatefulValidatorPointer createStatefulValidator (const validators::ValidationResultPredicate &isSuppressedFailure) const
 Creates a stateful validator that ignores suppressed failures according to isSuppressedFailure. More...
 
StatefulValidatorPointer createStatefulValidator () const
 Creates a stateful validator with no suppressed failures. More...
 
void addObserverHook (const ObserverHook &hook)
 Adds an observer hook. More...
 
void addTransientObserverHook (const ObserverHook &hook)
 Adds a (transient) observer hook. More...
 
ObserverPointer createObserver () const
 Creates an observer. More...
 
ObserverPointer createPermanentObserver () const
 Creates an observer that only observes permanent state changes. More...
 
void addMosaicResolver (const MosaicResolver &resolver)
 Adds a mosaic resolver. More...
 
void addAddressResolver (const AddressResolver &resolver)
 Adds an address resolver. More...
 
model::ResolverContext createResolverContext (const cache::ReadOnlyCatapultCache &cache) const
 Creates a resolver context given cache. More...
 
PublisherPointer createNotificationPublisher (model::PublicationMode mode=model::PublicationMode::All) const
 Creates a notification publisher for the specified mode. More...
 

Private Types

using HandlerHook = consumer< ionet::ServerPacketHandlers &, const cache::CatapultCache & >
 
using CounterHook = consumer< std::vector< utils::DiagnosticCounter > &, const cache::CatapultCache & >
 
using StatelessValidatorHook = consumer< validators::stateless::DemuxValidatorBuilder & >
 
using StatefulValidatorHook = consumer< validators::stateful::DemuxValidatorBuilder & >
 
using ObserverHook = consumer< observers::DemuxObserverBuilder & >
 
using StatelessValidatorPointer = std::unique_ptr< const validators::stateless::AggregateNotificationValidator >
 
using StatefulValidatorPointer = std::unique_ptr< const validators::stateful::AggregateNotificationValidator >
 
using ObserverPointer = observers::AggregateNotificationObserverPointerT< model::Notification >
 
template<typename TUnresolved , typename TResolved >
using Resolver = predicate< const cache::ReadOnlyCatapultCache &, const TUnresolved &, TResolved & >
 
using MosaicResolver = Resolver< UnresolvedMosaicId, MosaicId >
 
using AddressResolver = Resolver< UnresolvedAddress, Address >
 
template<typename TUnresolved , typename TResolved >
using AggregateResolver = std::function< TResolved(const cache::ReadOnlyCatapultCache &, const TUnresolved &)>
 
using AggregateMosaicResolver = AggregateResolver< UnresolvedMosaicId, MosaicId >
 
using AggregateAddressResolver = AggregateResolver< UnresolvedAddress, Address >
 
using PublisherPointer = std::unique_ptr< model::NotificationPublisher >
 

Private Attributes

model::BlockChainConfiguration m_config
 
StorageConfiguration m_storageConfig
 
config::InflationConfiguration m_inflationConfig
 
model::TransactionRegistry m_transactionRegistry
 
cache::CatapultCacheBuilder m_cacheBuilder
 
std::vector< HandlerHookm_nonDiagnosticHandlerHooks
 
std::vector< HandlerHookm_diagnosticHandlerHooks
 
std::vector< CounterHookm_diagnosticCounterHooks
 
std::vector< StatelessValidatorHookm_statelessValidatorHooks
 
std::vector< StatefulValidatorHookm_statefulValidatorHooks
 
std::vector< ObserverHookm_observerHooks
 
std::vector< ObserverHookm_transientObserverHooks
 
std::vector< MosaicResolverm_mosaicResolvers
 
std::vector< AddressResolverm_addressResolvers
 

Detailed Description

A manager for registering plugins.

Member Typedef Documentation

◆ AddressResolver

◆ AggregateAddressResolver

◆ AggregateMosaicResolver

◆ AggregateResolver

template<typename TUnresolved , typename TResolved >
using catapult::plugins::PluginManager::AggregateResolver = std::function<TResolved (const cache::ReadOnlyCatapultCache&, const TUnresolved&)>
private

◆ CounterHook

◆ HandlerHook

◆ MosaicResolver

◆ ObserverHook

◆ ObserverPointer

◆ PublisherPointer

◆ Resolver

template<typename TUnresolved , typename TResolved >
using catapult::plugins::PluginManager::Resolver = predicate<const cache::ReadOnlyCatapultCache&, const TUnresolved&, TResolved&>
private

◆ StatefulValidatorHook

◆ StatefulValidatorPointer

◆ StatelessValidatorHook

◆ StatelessValidatorPointer

Constructor & Destructor Documentation

◆ PluginManager()

catapult::plugins::PluginManager::PluginManager ( const model::BlockChainConfiguration config,
const StorageConfiguration storageConfig,
const config::InflationConfiguration inflationConfig 
)

Creates a new plugin manager around config, storageConfig and inflationConfig.

Member Function Documentation

◆ addAddressResolver()

void catapult::plugins::PluginManager::addAddressResolver ( const AddressResolver resolver)

Adds an address resolver.

◆ addCacheSupport() [1/2]

void catapult::plugins::PluginManager::addCacheSupport ( std::unique_ptr< cache::SubCachePlugin > &&  pSubCachePlugin)

Adds support for a sub cache registered by pSubCachePlugin.

Here is the call graph for this function:

◆ addCacheSupport() [2/2]

template<typename TStorageTraits , typename TCache >
void catapult::plugins::PluginManager::addCacheSupport ( std::unique_ptr< TCache > &&  pSubCache)
inline

Adds support for a sub cache described by pSubCache.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addDiagnosticCounterHook()

void catapult::plugins::PluginManager::addDiagnosticCounterHook ( const CounterHook hook)

Adds a diagnostic counter hook.

Here is the caller graph for this function:

◆ addDiagnosticCounters()

void catapult::plugins::PluginManager::addDiagnosticCounters ( std::vector< utils::DiagnosticCounter > &  counters,
const cache::CatapultCache cache 
) const

Adds all diagnostic counters to counters given cache.

◆ addDiagnosticHandlerHook()

void catapult::plugins::PluginManager::addDiagnosticHandlerHook ( const HandlerHook hook)

Adds a diagnostic handler hook.

Here is the caller graph for this function:

◆ addDiagnosticHandlers()

void catapult::plugins::PluginManager::addDiagnosticHandlers ( ionet::ServerPacketHandlers handlers,
const cache::CatapultCache cache 
) const

Adds all diagnostic handlers to handlers given cache.

◆ addHandlerHook()

void catapult::plugins::PluginManager::addHandlerHook ( const HandlerHook hook)

Adds a (non-diagnostic) handler hook.

Here is the caller graph for this function:

◆ addHandlers()

void catapult::plugins::PluginManager::addHandlers ( ionet::ServerPacketHandlers handlers,
const cache::CatapultCache cache 
) const

Adds all (non-diagnostic) handlers to handlers given cache.

◆ addMosaicResolver()

void catapult::plugins::PluginManager::addMosaicResolver ( const MosaicResolver resolver)

Adds a mosaic resolver.

◆ addObserverHook()

void catapult::plugins::PluginManager::addObserverHook ( const ObserverHook hook)

Adds an observer hook.

Here is the caller graph for this function:

◆ addStatefulValidatorHook()

void catapult::plugins::PluginManager::addStatefulValidatorHook ( const StatefulValidatorHook hook)

Adds a stateful validator hook.

Here is the caller graph for this function:

◆ addStatelessValidatorHook()

void catapult::plugins::PluginManager::addStatelessValidatorHook ( const StatelessValidatorHook hook)

Adds a stateless validator hook.

Here is the caller graph for this function:

◆ addTransactionSupport()

void catapult::plugins::PluginManager::addTransactionSupport ( std::unique_ptr< model::TransactionPlugin > &&  pTransactionPlugin)

Adds support for a transaction described by pTransactionPlugin.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTransientObserverHook()

void catapult::plugins::PluginManager::addTransientObserverHook ( const ObserverHook hook)

Adds a (transient) observer hook.

Here is the caller graph for this function:

◆ cacheConfig()

cache::CacheConfiguration catapult::plugins::PluginManager::cacheConfig ( const std::string &  name) const

Gets the cache configuration for cache with name.

Here is the caller graph for this function:

◆ config()

const model::BlockChainConfiguration & catapult::plugins::PluginManager::config ( ) const

Gets the block chain configuration.

Here is the caller graph for this function:

◆ createCache()

cache::CatapultCache catapult::plugins::PluginManager::createCache ( )

Creates a catapult cache.

Here is the call graph for this function:

◆ createNotificationPublisher()

PluginManager::PublisherPointer catapult::plugins::PluginManager::createNotificationPublisher ( model::PublicationMode  mode = model::PublicationMode::All) const

Creates a notification publisher for the specified mode.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createObserver()

PluginManager::ObserverPointer catapult::plugins::PluginManager::createObserver ( ) const

Creates an observer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createPermanentObserver()

PluginManager::ObserverPointer catapult::plugins::PluginManager::createPermanentObserver ( ) const

Creates an observer that only observes permanent state changes.

◆ createResolverContext()

model::ResolverContext catapult::plugins::PluginManager::createResolverContext ( const cache::ReadOnlyCatapultCache cache) const

Creates a resolver context given cache.

Here is the caller graph for this function:

◆ createStatefulValidator() [1/2]

PluginManager::StatefulValidatorPointer catapult::plugins::PluginManager::createStatefulValidator ( ) const

Creates a stateful validator with no suppressed failures.

◆ createStatefulValidator() [2/2]

PluginManager::StatefulValidatorPointer catapult::plugins::PluginManager::createStatefulValidator ( const validators::ValidationResultPredicate isSuppressedFailure) const

Creates a stateful validator that ignores suppressed failures according to isSuppressedFailure.

Here is the caller graph for this function:

◆ createStatelessValidator() [1/2]

PluginManager::StatelessValidatorPointer catapult::plugins::PluginManager::createStatelessValidator ( ) const

Creates a stateless validator with no suppressed failures.

◆ createStatelessValidator() [2/2]

PluginManager::StatelessValidatorPointer catapult::plugins::PluginManager::createStatelessValidator ( const validators::ValidationResultPredicate isSuppressedFailure) const

Creates a stateless validator that ignores suppressed failures according to isSuppressedFailure.

Here is the caller graph for this function:

◆ inflationConfig()

const config::InflationConfiguration & catapult::plugins::PluginManager::inflationConfig ( ) const

Gets the inflation configuration.

Here is the caller graph for this function:

◆ storageConfig()

const StorageConfiguration & catapult::plugins::PluginManager::storageConfig ( ) const

Gets the storage configuration.

◆ transactionRegistry()

const model::TransactionRegistry & catapult::plugins::PluginManager::transactionRegistry ( ) const

Gets the transaction registry.

Here is the caller graph for this function:

Member Data Documentation

◆ m_addressResolvers

std::vector<AddressResolver> catapult::plugins::PluginManager::m_addressResolvers
private

◆ m_cacheBuilder

cache::CatapultCacheBuilder catapult::plugins::PluginManager::m_cacheBuilder
private

◆ m_config

model::BlockChainConfiguration catapult::plugins::PluginManager::m_config
private

◆ m_diagnosticCounterHooks

std::vector<CounterHook> catapult::plugins::PluginManager::m_diagnosticCounterHooks
private

◆ m_diagnosticHandlerHooks

std::vector<HandlerHook> catapult::plugins::PluginManager::m_diagnosticHandlerHooks
private

◆ m_inflationConfig

config::InflationConfiguration catapult::plugins::PluginManager::m_inflationConfig
private

◆ m_mosaicResolvers

std::vector<MosaicResolver> catapult::plugins::PluginManager::m_mosaicResolvers
private

◆ m_nonDiagnosticHandlerHooks

std::vector<HandlerHook> catapult::plugins::PluginManager::m_nonDiagnosticHandlerHooks
private

◆ m_observerHooks

std::vector<ObserverHook> catapult::plugins::PluginManager::m_observerHooks
private

◆ m_statefulValidatorHooks

std::vector<StatefulValidatorHook> catapult::plugins::PluginManager::m_statefulValidatorHooks
private

◆ m_statelessValidatorHooks

std::vector<StatelessValidatorHook> catapult::plugins::PluginManager::m_statelessValidatorHooks
private

◆ m_storageConfig

StorageConfiguration catapult::plugins::PluginManager::m_storageConfig
private

◆ m_transactionRegistry

model::TransactionRegistry catapult::plugins::PluginManager::m_transactionRegistry
private

◆ m_transientObserverHooks

std::vector<ObserverHook> catapult::plugins::PluginManager::m_transientObserverHooks
private

The documentation for this class was generated from the following files: