diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:43:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:43:12 +0000 |
commit | cd989f9c3aff968e19a3aeabc4eb9085787a6673 (patch) | |
tree | fbff2135e7013f196b891bbde54618eb050e4aaf /library/Director/Hook/DeploymentHook.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-director-cd989f9c3aff968e19a3aeabc4eb9085787a6673.tar.xz icingaweb2-module-director-cd989f9c3aff968e19a3aeabc4eb9085787a6673.zip |
Adding upstream version 1.10.2.upstream/1.10.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Director/Hook/DeploymentHook.php')
-rw-r--r-- | library/Director/Hook/DeploymentHook.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/library/Director/Hook/DeploymentHook.php b/library/Director/Hook/DeploymentHook.php new file mode 100644 index 0000000..c8a834b --- /dev/null +++ b/library/Director/Hook/DeploymentHook.php @@ -0,0 +1,65 @@ +<?php + +namespace Icinga\Module\Director\Hook; + +use Icinga\Module\Director\Objects\DirectorDeploymentLog; + +abstract class DeploymentHook +{ + /** + * Please override this method if you want to change the behaviour + * of the deploy (stop it by throwing an exception for some reason) + * + * @param DirectorDeploymentLog $deployment + */ + public function beforeDeploy(DirectorDeploymentLog $deployment) + { + } + + /** + * Please override this method if you want to trigger custom actions + * on a successful dump of the Icinga configuration + * + * @param DirectorDeploymentLog $deployment + */ + public function onSuccessfulDump(DirectorDeploymentLog $deployment) + { + } + + /** + * There is a typo in this method name, do not use this. + * + * @deprecated Please use onSuccessfulDump + * @param DirectorDeploymentLog $deployment + */ + public function onSuccessfullDump(DirectorDeploymentLog $deployment) + { + } + + /** + * Compatibility helper + * + * The initial version of this hook had a typo in the onSuccessfulDump method + * That's why we call this hook, which then calls both the correct and the + * erroneous method to make sure that we do not break existing implementations. + * + * @param DirectorDeploymentLog $deploymentLog + */ + final public function triggerSuccessfulDump(DirectorDeploymentLog $deploymentLog) + { + $this->onSuccessfulDump($deploymentLog); + $this->onSuccessfullDump($deploymentLog); + } + + /** + * Please override this method if you want to trigger custom actions + * once success (or failure) information have been collected for a deployed + * stage. startup_succeeded will then be filled, and startup_log might be + * available + * + * @param DirectorDeploymentLog $deployment + */ + public function onCollect(DirectorDeploymentLog $deployment) + { + } +} |