public void subscribe(String topic,int qos,boolean expectRetained) throws Exception {
  logToFile("subscribe [topic:" + topic + "][qos:"+ qos+ "][expectRetained:"+ expectRetained+ "]");
  subscribedTopics.put(topic,new Integer(qos));
  client.subscribe(topic,qos);
  if (expectRetained) {
    waitForMessage(topic,retainedPublishes.get(topic),true);
  }
}

public void subscribe ( String topic , int qos , boolean expectRetained ) throws Exception { logToFile ( "subscribe [topic:" + topic + "][qos:" + qos + "][expectRetained:" + expectRetained + "]" ) ; subscribedTopics . put ( topic , new Integer ( qos ) ) ; client . subscribe ( topic , qos ) ; if ( expectRetained ) { waitForMessage ( topic , retainedPublishes . get ( topic ) , true ) ; } }
subscribes to a given topic at the given qos
