|
SVCS - English Documentation
|
Abstract base class for all server administration commands. More...
#include <ServerBaseCommand.hxx>
Public Member Functions | |
| ServerBaseCommand (std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repo_manager) | |
| Constructs a ServerBaseCommand with necessary dependencies. | |
| virtual | ~ServerBaseCommand ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| virtual std::string | getName () const override=0 |
| Pure virtual method to get the command name. | |
| virtual std::string | getDescription () const override=0 |
| Pure virtual method to get the command description. | |
| virtual std::string | getUsage () const override=0 |
| Pure virtual method to get the command usage syntax. | |
| virtual bool | execute (const std::vector< std::string > &args) override=0 |
| Pure virtual method to execute the command logic. | |
| virtual void | showHelp () const override=0 |
| Pure virtual method to display detailed help information. | |
| Public Member Functions inherited from svcs::cli::ICommand | |
| virtual | ~ICommand ()=default |
| Virtual destructor. | |
Protected Member Functions | |
| void | notifyInfo (const std::string &message) const |
| Sends an informational notification via the event bus. | |
| void | notifyError (const std::string &message) const |
| Sends an error notification via the event bus. | |
Protected Attributes | |
| std::shared_ptr< ISubject > | event_bus_ |
| Shared pointer to the event bus for system notifications. | |
| std::shared_ptr< RepositoryManager > | repo_manager_ |
| Shared pointer to the repository manager for repository operations. | |
Abstract base class for all server administration commands.
Inherits from ICommand and provides common infrastructure for server management operations including event notification and repository management. All server-specific commands should derive from this class.
| svcs::server::cli::ServerBaseCommand::ServerBaseCommand | ( | std::shared_ptr< ISubject > | event_bus, |
| std::shared_ptr< RepositoryManager > | repo_manager ) |
Constructs a ServerBaseCommand with necessary dependencies.
| event_bus | Shared pointer to the event bus for system notifications. |
| repo_manager | Shared pointer to the repository manager for repository operations. |
|
overridepure virtual |
Pure virtual method to execute the command logic.
| args | Vector of string arguments passed to the command. |
Must be implemented by derived classes to provide command-specific logic.
Implements svcs::cli::ICommand.
Implemented in svcs::server::cli::HubCommand, and svcs::server::cli::RepoCommand.
|
nodiscardoverridepure virtual |
Pure virtual method to get the command description.
Must be implemented by derived classes to describe command functionality.
Implements svcs::cli::ICommand.
Implemented in svcs::server::cli::HubCommand, and svcs::server::cli::RepoCommand.
|
nodiscardoverridepure virtual |
Pure virtual method to get the command name.
Must be implemented by derived classes to provide unique command identifier.
Implements svcs::cli::ICommand.
Implemented in svcs::server::cli::HubCommand, and svcs::server::cli::RepoCommand.
|
nodiscardoverridepure virtual |
Pure virtual method to get the command usage syntax.
Must be implemented by derived classes to show proper command usage.
Implements svcs::cli::ICommand.
Implemented in svcs::server::cli::HubCommand, and svcs::server::cli::RepoCommand.
|
protected |
Sends an error notification via the event bus.
| message | The error message to send. |
Utility method for derived classes to send error notifications.
|
protected |
Sends an informational notification via the event bus.
| message | The informational message to send. |
Utility method for derived classes to send info notifications.
|
overridepure virtual |
Pure virtual method to display detailed help information.
Must be implemented by derived classes to show command-specific help.
Implements svcs::cli::ICommand.
Implemented in svcs::server::cli::HubCommand, and svcs::server::cli::RepoCommand.