public static boolean poll(ConnectionParams serverParams, String clusterName, int requestId) throws Exception {
        RequestStatusPoller poller = new RequestStatusPoller(serverParams, clusterName, requestId);
        Thread pollerThread = new Thread(poller);
        pollerThread.start();
        pollerThread.join();
        if (poller.getHostRoleStatus() == HostRoleStatus.COMPLETED)
            return true;

        return false;
    }
Polls the status of a service component host request.
ambari-funtest/src/test/java/org/apache/ambari/funtest/server/utils/RequestStatusPoller.java