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.
|
List<Attribute> |
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 |
initializeMonitorProvider(MonitorProviderCfg configuration)
Initializes this monitor provider based on the information in the
provided configuration entry.
|
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, getMonitorObjectClass, isConfigurationAcceptable, scheduleUpdatepublic 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 void initializeMonitorProvider(MonitorProviderCfg configuration) throws ConfigException, InitializationException
initializeMonitorProvider in class MonitorProvider<MonitorProviderCfg>configuration - The configuration to use to initialize
this monitor provider.ConfigException - If an unrecoverable problem arises in
the process of performing the
initialization.InitializationException - If a problem occurs during
initialization that is not
related to the server
configuration.public String getMonitorInstanceName()
getMonitorInstanceName in class MonitorProvider<MonitorProviderCfg>public List<Attribute> getMonitorData()
getMonitorData in class MonitorProvider<MonitorProviderCfg>public DN getComponentEntryDN()
getComponentEntryDN in interface AlertGeneratorpublic String getClassName()
getClassName in interface AlertGeneratorpublic Map<String,String> getAlerts()
getAlerts in interface AlertGeneratorpublic String getShutdownListenerName()
getShutdownListenerName in interface ServerShutdownListenerpublic void processServerShutdown(LocalizableMessage reason)
processServerShutdown in interface ServerShutdownListenerreason - The human-readable reason for the shutdown.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.