From ad42fe808889ebd10ac8787ae5a36247d69ebe66 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Fri, 06 Feb 2009 13:48:08 +0000
Subject: [PATCH] Add UI to allow the user the refreshing period using by the control panel to update its contents.

---
 opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java b/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
index f280d3b..6ae99d8 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008 Sun Microsystems, Inc.
+ *      Copyright 2008-2009 Sun Microsystems, Inc.
  */
 
 package org.opends.guitools.controlpanel.datamodel;
@@ -67,10 +67,7 @@
  */
 public class ControlPanelInfo
 {
-  /**
-   * The default pooling time in miliseconds.
-   */
-  public static final long DEFAULT_POOLING = 20000;
+  private long poolingPeriod = 20000;
 
   private ServerDescriptor serverDesc;
   private Set<Task> tasks = new HashSet<Task>();
@@ -699,9 +696,8 @@
    * Starts pooling the server configuration.  The period of the pooling is
    * specified as a parameter.  This method is asynchronous and it will start
    * the pooling in another thread.
-   * @param period the pooling in miliseconds of the pooling.
    */
-  public synchronized void startPooling(final long period)
+  public synchronized void startPooling()
   {
     if (poolingThread != null)
     {
@@ -719,7 +715,7 @@
           while (!stopPooling)
           {
             regenerateDescriptor();
-            Thread.sleep(period);
+            Thread.sleep(poolingPeriod);
           }
         }
         catch (Throwable t)
@@ -1056,4 +1052,22 @@
   {
     return iconPool;
   }
+
+  /**
+   * Returns the pooling period in miliseconds.
+   * @return the pooling period in miliseconds.
+   */
+  public long getPoolingPeriod()
+  {
+    return poolingPeriod;
+  }
+
+  /**
+   * Sets the pooling period in miliseconds.
+   * @param poolingPeriod the pooling time in miliseconds.
+   */
+  public void setPoolingPeriod(long poolingPeriod)
+  {
+    this.poolingPeriod = poolingPeriod;
+  }
 }

--
Gitblit v1.10.0