Hermod
A cross-platform, modular and fully GDPR-compliant email archival solution!
|
Allows delegating topics and command execution requests from plugins through Hermod to other plugins. More...
Public Member Functions | |||||||
PluginDelegator (IPlugin plugin, ILogger? logger=null) | |||||||
Instantiates a new instance of this class. | |||||||
void | SubscribeTopic (string topicName) | ||||||
Allows a plugin to subscribe to an individual topic.
| |||||||
void | SubscribeTopics (params string[] topics) | ||||||
Allows a plugin to subscribe to multiple individual topics.This method will fail silently and ignore any non-conforming topics. | |||||||
void | UnsubscribeTopic (string topicName) | ||||||
Allows a plugin to unsubscribe from a single topic.
| |||||||
void | PublishMessage (string topic, object? message) | ||||||
Allows a plugin to publish a message on a given topic.
| |||||||
ICommandResult | ExecuteCommand (params string[] command) | ||||||
Executes a single command.If command execution has been disabled for this plugin, then a Exceptions.CommandExecutionException will be raised. | |||||||
void | Information (string? msg) | ||||||
Logs an information message to the logger.This will prefix the message with [name of plugin]. | |||||||
void | Debug (string? msg) | ||||||
Logs a debug message to the logger.This will prefix the message with [name of plugin]. | |||||||
void | Error (string? msg) | ||||||
Logs an error message to the logger.This will prefix the message with [name of plugin]. | |||||||
void | Warning (string? msg) | ||||||
Logs a warning message to the logger.This will prefix the message with [name of plugin]. | |||||||
void | Trace (string? msg) | ||||||
Logs a trace message to the logger.This will prefix the message with [name of plugin]. | |||||||
T | GetApplicationConfig< T > (string config) | ||||||
Retrieves an application configuration value.
| |||||||
bool | TryGetApplicationConfig< T > (string config, out T? value) | ||||||
Tries to retrieve an application configuration value.
| |||||||
void | SubscribeTopic (string topicName) | ||||||
Allows a plugin to subscribe to an individual topic. | |||||||
void | SubscribeTopics (params string[] topics) | ||||||
Allows a plugin to subscribe to multiple individual topics. | |||||||
void | UnsubscribeTopic (string topicName) | ||||||
Allows a plugin to unsubscribe from a single topic. | |||||||
void | PublishMessage (string topic, object? message) | ||||||
Allows a plugin to publish a message on a given topic. | |||||||
ICommandResult | ExecuteCommand (params string[] command) | ||||||
Executes a single command. | |||||||
T | GetApplicationConfig< T > (string config) | ||||||
Retrieves an application configuration value. | |||||||
bool | TryGetApplicationConfig< T > (string config, out T? value) | ||||||
Tries to retrieve an application configuration value. | |||||||
void | Information (string? msg) | ||||||
Logs an information message to the logger. | |||||||
void | Debug (string? msg) | ||||||
Logs a debug message to the logger. | |||||||
void | Error (string? msg) | ||||||
Logs an error message to the logger. | |||||||
void | Warning (string? msg) | ||||||
Logs a warning message to the logger. | |||||||
void | Trace (string? msg) | ||||||
Logs a trace message to the logger. | |||||||
Package Functions | |
void | OnMessageReceived (MessageReceivedEventArgs e) |
Properties | |
IPlugin | Plugin [get] |
ILogger? | Logger [get] |
Events | |
MessageReceivedEventHandler? | MessageReceived |
Allows delegating topics and command execution requests from plugins through Hermod to other plugins.
Definition at line 13 of file PluginDelegator.cs.
|
inline |
Instantiates a new instance of this class.
plugin | The plugin this delegator handles. |
Definition at line 22 of file PluginDelegator.cs.
void Hermod.PluginFramework.PluginDelegator.Debug | ( | string? | msg | ) |
Logs a debug message to the logger.This will prefix the message with [name of plugin].
Implements Hermod.Core.Delegation.IPluginDelegator.
Referenced by Hermod.PluginFramework.PluginDelegator.SubscribeTopics().
void Hermod.PluginFramework.PluginDelegator.Error | ( | string? | msg | ) |
Logs an error message to the logger.This will prefix the message with [name of plugin].
Implements Hermod.Core.Delegation.IPluginDelegator.
Referenced by Hermod.PluginFramework.PluginDelegator.SubscribeTopics().
ICommandResult Hermod.PluginFramework.PluginDelegator.ExecuteCommand | ( | params string[] | command | ) |
Executes a single command.If command execution has been disabled for this plugin, then a Exceptions.CommandExecutionException will be raised.
Implements Hermod.Core.Delegation.IPluginDelegator.
T Hermod.PluginFramework.PluginDelegator.GetApplicationConfig< T > | ( | string | config | ) |
Retrieves an application configuration value.
T | The type of the config. |
config | The config name. |
Exception | If an error occurs. |
Implements Hermod.Core.Delegation.IPluginDelegator.
Referenced by Hermod.PluginFramework.PluginDelegator.TryGetApplicationConfig< T >().
void Hermod.PluginFramework.PluginDelegator.Information | ( | string? | msg | ) |
Logs an information message to the logger.This will prefix the message with [name of plugin].
Implements Hermod.Core.Delegation.IPluginDelegator.
|
package |
void Hermod.PluginFramework.PluginDelegator.PublishMessage | ( | string | topic, |
object? | message | ||
) |
Allows a plugin to publish a message on a given topic.
topic | The topic to publish to. |
message | The message to publish to any subscribed plugins. |
Implements Hermod.Core.Delegation.IPluginDelegator.
void Hermod.PluginFramework.PluginDelegator.SubscribeTopic | ( | string | topicName | ) |
Allows a plugin to subscribe to an individual topic.
topicName | The topic to subscribe to |
Exceptions.MalformedTopicException | If the topic does not meet the topic string requirements. |
Implements Hermod.Core.Delegation.IPluginDelegator.
|
inline |
Allows a plugin to subscribe to multiple individual topics.This method will fail silently and ignore any non-conforming topics.
Implements Hermod.Core.Delegation.IPluginDelegator.
Definition at line 38 of file PluginDelegator.cs.
References Hermod.PluginFramework.PluginRegistry.AddSubscription(), Hermod.PluginFramework.PluginDelegator.Debug(), Hermod.PluginFramework.PluginDelegator.Error(), and Hermod.PluginFramework.PluginRegistry.Instance.
void Hermod.PluginFramework.PluginDelegator.Trace | ( | string? | msg | ) |
Logs a trace message to the logger.This will prefix the message with [name of plugin].
Implements Hermod.Core.Delegation.IPluginDelegator.
|
inline |
Tries to retrieve an application configuration value.
T | The type of the config. |
config | The config name. |
value | The config value. |
Implements Hermod.Core.Delegation.IPluginDelegator.
Definition at line 75 of file PluginDelegator.cs.
References Hermod.PluginFramework.PluginDelegator.GetApplicationConfig< T >().
void Hermod.PluginFramework.PluginDelegator.UnsubscribeTopic | ( | string | topicName | ) |
Allows a plugin to unsubscribe from a single topic.
topicName |
Implements Hermod.Core.Delegation.IPluginDelegator.
void Hermod.PluginFramework.PluginDelegator.Warning | ( | string? | msg | ) |
Logs a warning message to the logger.This will prefix the message with [name of plugin].
Implements Hermod.Core.Delegation.IPluginDelegator.
|
getpackage |
Definition at line 16 of file PluginDelegator.cs.
|
getpackage |
Definition at line 15 of file PluginDelegator.cs.
MessageReceivedEventHandler? Hermod.PluginFramework.PluginDelegator.MessageReceived |
Definition at line 29 of file PluginDelegator.cs.