| | |
| | | import org.opends.admin.ads.util.ConnectionUtils; |
| | | import org.opends.guitools.controlpanel.browser.IconPool; |
| | | import org.opends.guitools.controlpanel.browser.LDAPConnectionPool; |
| | | import org.opends.guitools.controlpanel.event.BackendPopulatedEvent; |
| | | import org.opends.guitools.controlpanel.event.BackendPopulatedListener; |
| | | import org.opends.guitools.controlpanel.event.BackupCreatedEvent; |
| | | import org.opends.guitools.controlpanel.event.BackupCreatedListener; |
| | | import org.opends.guitools.controlpanel.event.ConfigChangeListener; |
| | |
| | | private LinkedHashSet<BackupCreatedListener> backupListeners = |
| | | new LinkedHashSet<BackupCreatedListener>(); |
| | | |
| | | private LinkedHashSet<BackendPopulatedListener> backendPopulatedListeners = |
| | | new LinkedHashSet<BackendPopulatedListener>(); |
| | | |
| | | private LinkedHashSet<IndexModifiedListener> indexListeners = |
| | | new LinkedHashSet<IndexModifiedListener>(); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Informs that a set of backends have been populated. The method will notify |
| | | * to all the backend populated listeners. |
| | | * @param backends the populated backends. |
| | | */ |
| | | public void backendPopulated(Set<BackendDescriptor> backends) |
| | | { |
| | | BackendPopulatedEvent ev = new BackendPopulatedEvent(backends); |
| | | for (BackendPopulatedListener listener : backendPopulatedListeners) |
| | | { |
| | | listener.backendPopulated(ev); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Informs that an index has been modified. The method will notify to all |
| | | * the index listeners that an index has been modified. |
| | | * @param modifiedIndex the modified index. |
| | |
| | | } |
| | | |
| | | /** |
| | | * Adds a backend populated listener. |
| | | * @param listener the listener. |
| | | */ |
| | | public void addBackendPopulatedListener(BackendPopulatedListener listener) |
| | | { |
| | | backendPopulatedListeners.add(listener); |
| | | } |
| | | |
| | | /** |
| | | * Removes a backend populated listener. |
| | | * @param listener the listener. |
| | | * @return <CODE>true</CODE> if the listener is found and <CODE>false</CODE> |
| | | * otherwise. |
| | | */ |
| | | public boolean removeBackendPopulatedListener( |
| | | BackendPopulatedListener listener) |
| | | { |
| | | return backendPopulatedListeners.remove(listener); |
| | | } |
| | | |
| | | /** |
| | | * Adds an index modification listener. |
| | | * @param listener the listener. |
| | | */ |