Merge "Stop isReady method always returning true" into topic/schema
authorMadhu Venugopal <mavenugo@gmail.com>
Thu, 22 May 2014 13:48:23 +0000 (13:48 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 22 May 2014 13:48:23 +0000 (13:48 +0000)
library/src/main/java/org/opendaylight/ovsdb/lib/OvsDBClientImpl.java

index 7230d06ea6553901464600bf8e1f3a84b2eb64b0..5bbfab4d58aae70d455d936686563c3c6998e11c 100644 (file)
@@ -178,9 +178,15 @@ public class OvsDBClientImpl implements OvsDBClient {
     }
 
 
-    public boolean isReady(long timeout) {
-        //todo implement timeout
-        return null != schema;
+    public boolean isReady(int timeout) throws InterruptedException {
+        while (timeout > 0) {
+            if (!schema.isEmpty()) {
+                return true;
+            }
+            Thread.sleep(1000);
+            timeout--;
+        }
+        return false;
     }
 
     @Override