The OvsdbClientImpl.isReady() method will always return true as the
schema variable is initialized when the class is created and an
instance of a list can never be null.
This commit implements the timeout in the ToDo and changes the logic
to check if the schema.isEmpty
Change-Id: I1d48fa56f5a93e227fc3b623d3405d07a1751972
Signed-off-by: Dave Tucker <djt@redhat.com>
}
- 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