public class DiskSpaceMonitor extends MonitorProvider<MonitorProviderCfg> implements Runnable, AlertGenerator, ServerShutdownListener
Constructor and Description |
---|
DiskSpaceMonitor()
Constructs a new DiskSpaceMonitor that will notify registered DiskSpaceMonitorHandler objects when filesystems on
which configured directories reside, fall below the provided thresholds.
|
Modifier and Type | Method and Description |
---|---|
void |
deregisterMonitoredDirectory(File directory,
DiskSpaceMonitorHandler handler)
Removes a directory from the set of monitored directories.
|
Map<String,String> |
getAlerts()
Retrieves information about the set of alerts that this generator may produce.
|
String |
getClassName()
Retrieves the fully-qualified name of the Java class for this alert generator implementation.
|
Dn |
getComponentEntryDN()
Retrieves the DN of the configuration entry with which this alert generator is associated.
|
MonitorData |
getMonitorData()
Retrieves a set of attributes containing monitor data that should be returned to the client if the corresponding
monitor entry is requested.
|
String |
getMonitorInstanceName()
Retrieves the name of this monitor provider.
|
String |
getShutdownListenerName()
Retrieves the human-readable name for this shutdown listener.
|
void |
processServerShutdown(LocalizableMessage reason)
Indicates that the Directory Server has received a request to stop running and that this shutdown listener should
take any action necessary to prepare for it.
|
void |
registerMonitoredDirectory(String instanceName,
File directory,
long lowThresholdBytes,
long fullThresholdBytes,
DiskSpaceMonitorHandler handler)
Registers or reconfigures a directory for monitoring.
|
void |
run() |
void |
startDiskSpaceMonitor()
Starts periodic monitoring of all registered directories.
|
finalizeMonitorProvider, getMonitorInstanceDn, getMonitorObjectClass, initializeMonitorProvider, isConfigurationAcceptable, scheduleUpdate
public DiskSpaceMonitor()
public void startDiskSpaceMonitor()
public void registerMonitoredDirectory(String instanceName, File directory, long lowThresholdBytes, long fullThresholdBytes, DiskSpaceMonitorHandler handler)
handler
, simply change its configuration.instanceName
- A name for the handler, as used by cn=monitordirectory
- The directory to monitorlowThresholdBytes
- Disk slow threshold expressed in bytesfullThresholdBytes
- Disk full threshold expressed in byteshandler
- The class requesting to be called when a transition in disk space occurspublic void deregisterMonitoredDirectory(File directory, DiskSpaceMonitorHandler handler)
directory
- The directory to stop monitoring onhandler
- The class that requested monitoringpublic String getMonitorInstanceName()
MonitorProvider
UnsupportedOperationException
indicating that neither this method nor MonitorProvider.getMonitorInstanceDn()
have been
overridden.getMonitorInstanceName
in class MonitorProvider<MonitorProviderCfg>
public MonitorData getMonitorData()
MonitorProvider
getMonitorData
in class MonitorProvider<MonitorProviderCfg>
public Dn getComponentEntryDN()
AlertGenerator
getComponentEntryDN
in interface AlertGenerator
public String getClassName()
AlertGenerator
getClassName
in interface AlertGenerator
public Map<String,String> getAlerts()
AlertGenerator
getAlerts
in interface AlertGenerator
public String getShutdownListenerName()
ServerShutdownListener
getShutdownListenerName
in interface ServerShutdownListener
public void processServerShutdown(LocalizableMessage reason)
ServerShutdownListener
processServerShutdown
in interface ServerShutdownListener
reason
- The human-readable reason for the shutdown.Copyright 2010-2020 ForgeRock AS.