/** * Whenever a message is received by the message listener, this method is called. The child * classes extended from Client can overwrite this method to implement their own functionalities. * * @param msg The new message received from the communication interface (from Broker.) */ public void processMessage(Message msg) { receivedPubMsg = (PublicationMessage) msg; if (clientConfig.detailState) { // TODO: the below line works because we now assume the clients connects to only one // broker. Modify this so that the received publication is added to the correct // broker state. BrokerState bState = brokerStates.get(defaultBrokerAddress); if (bState != null) bState.addReceivedPub(receivedPubMsg); } messageLogger.info("Message received at Client " + clientID + ": " + msg); }