| | |
| | | this.handler = handler; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorInstanceName() { |
| | | return instanceName + "," + "cn=" + baseName; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException { |
| | |
| | | private class HandlerNotifier { |
| | | private File directory; |
| | | private int state; |
| | | /** printable list of handlers names, for reporting backend names in alert messages */ |
| | | /** Printable list of handlers names, for reporting backend names in alert messages. */ |
| | | private final StringBuilder diskNames = new StringBuilder(); |
| | | private final List<MonitoredDirectory> allHandlers = new ArrayList<>(); |
| | | |
| | |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * Starts periodic monitoring of all registered directories. |
| | | */ |
| | | /** Starts periodic monitoring of all registered directories. */ |
| | | public void startDiskSpaceMonitor() |
| | | { |
| | | DirectoryServer.registerMonitorProvider(this); |
| | |
| | | { |
| | | synchronized (monitoredDirs) |
| | | { |
| | | |
| | | List<MonitoredDirectory> directories = monitoredDirs.get(directory); |
| | | if (directories != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException { |
| | |
| | | return DiskSpaceMonitor.class.getName(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Map<String, String> getAlerts() |
| | | { |
| | |
| | | return alerts; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getShutdownListenerName() |
| | | { |
| | | return INSTANCENAME; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processServerShutdown(LocalizableMessage reason) |
| | | { |