code: public void sendMessage(Message message) throws NotConnectedException, InterruptedException {
          message.setTo(room);
          message.setType(Message.Type.groupchat);
          connection.sendStanza(message);
      }
docs: Sends a Message to the chat room.
  
  @param message
  the message.
  @throws NotConnectedException
  @throws InterruptedException