44 lines
1008 B
TypeScript
44 lines
1008 B
TypeScript
|
import { NupstSnmp } from './snmp.js';
|
||
|
import { NupstDaemon } from './daemon.js';
|
||
|
import { NupstSystemd } from './systemd.js';
|
||
|
|
||
|
/**
|
||
|
* Main Nupst class that coordinates all components
|
||
|
* Acts as a facade to access SNMP, Daemon, and Systemd functionality
|
||
|
*/
|
||
|
export class Nupst {
|
||
|
private readonly snmp: NupstSnmp;
|
||
|
private readonly daemon: NupstDaemon;
|
||
|
private readonly systemd: NupstSystemd;
|
||
|
|
||
|
/**
|
||
|
* Create a new Nupst instance with all necessary components
|
||
|
*/
|
||
|
constructor() {
|
||
|
this.snmp = new NupstSnmp();
|
||
|
this.daemon = new NupstDaemon(this.snmp);
|
||
|
this.systemd = new NupstSystemd(this.daemon);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get the SNMP manager for UPS communication
|
||
|
*/
|
||
|
public getSnmp(): NupstSnmp {
|
||
|
return this.snmp;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get the daemon manager for background monitoring
|
||
|
*/
|
||
|
public getDaemon(): NupstDaemon {
|
||
|
return this.daemon;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get the systemd manager for service operations
|
||
|
*/
|
||
|
public getSystemd(): NupstSystemd {
|
||
|
return this.systemd;
|
||
|
}
|
||
|
}
|