Manages a JSON status file for instance discovery. More...
#include <activity_file.h>
Public Member Functions | |
| ActivityFile (const std::string &path) | |
| Construct an activity file at the specified path. | |
| ~ActivityFile () | |
| Destructor removes the status file. | |
| ActivityFile (const ActivityFile &)=delete | |
| ActivityFile & | operator= (const ActivityFile &)=delete |
| ActivityFile (ActivityFile &&other) noexcept | |
| ActivityFile & | operator= (ActivityFile &&other) noexcept |
| void | Update (const ActivityStatus &status) |
| Update the status file with new information. | |
| bool | Exists () const |
| Check if the status file exists on disk. | |
| const std::string & | GetPath () const |
| Get the path to the status file. | |
Private Attributes | |
| std::string | path_ |
Manages a JSON status file for instance discovery.
Creates a file at /tmp/yaze-<pid>.status on construction and removes it on destruction. Updates can be pushed via Update().
This enables the Oracle Agent Manager to discover running YAZE instances and route commands to the appropriate gRPC endpoint.
Definition at line 33 of file activity_file.h.
|
explicit |
Construct an activity file at the specified path.
| path | Full path to the status file (e.g., /tmp/yaze-12345.status) |
Definition at line 17 of file activity_file.cc.
References path_.
| yaze::app::ActivityFile::~ActivityFile | ( | ) |
Destructor removes the status file.
Definition at line 26 of file activity_file.cc.
References path_.
|
delete |
|
noexcept |
Definition at line 32 of file activity_file.cc.
|
delete |
|
noexcept |
Definition at line 37 of file activity_file.cc.
| void yaze::app::ActivityFile::Update | ( | const ActivityStatus & | status | ) |
Update the status file with new information.
| status | The current activity status to write |
Definition at line 49 of file activity_file.cc.
References yaze::app::ActivityStatus::active_rom, path_, yaze::app::ActivityStatus::pid, yaze::app::ActivityStatus::socket_path, yaze::app::ActivityStatus::start_timestamp, and yaze::app::ActivityStatus::version.
| bool yaze::app::ActivityFile::Exists | ( | ) | const |
Check if the status file exists on disk.
Definition at line 82 of file activity_file.cc.
References path_.
|
inline |
|
private |
Definition at line 71 of file activity_file.h.
Referenced by ActivityFile(), Exists(), GetPath(), Update(), and ~ActivityFile().