I have a method in my client that sends out a presence “alert” whenever the user changes the current presence. I have tried different ways including just iterating the roster and not creating a new Presence object each time in the iteration. The log print out of the XML seem correct but the SMACK debug shows that the presence updates are only going to two users. I am currently at a loss. Included is the current code and debug statements. Thanks in advance.
public void sendPresence(){
logger.info(“Start Send Presence!”);
//Presence myPres = ConfigFile.getDefaultPres();
//myPres.setFrom(MindIM.getUserJid());
//Iterator itr =myRoster.getEntries();
RosterEntry nextEntry = null;
RosterGroup nextGroup = null;
Iterator itr = myRoster.getGroups();
Iterator itrEntry = null;
Presence myPres = null;
while(itr.hasNext()){
myPres = new Presence(ConfigFile.getDefaultPres());
myPres.setFrom(MindIM.getUserJid());
nextGroup = (RosterGroup)itr.next();
itrEntry =nextGroup.getEntries();
while(itrEntry.hasNext()){
nextEntry= (RosterEntry)itrEntry.next();
logger.info(“Sending Presence to:”);
logger.info(nextEntry.getUser());
myPres.setTo(nextEntry.getUser());
conn.sendPacket(myPres);
logger.info(myPres.toXML());
}
}
itrEntry = null;
itrEntry =myRoster.getUnfiledEntries();
while(itrEntry.hasNext()){
nextEntry = (RosterEntry)itrEntry.next();
logger.info(“Sending Presence to:”);
logger.info(nextEntry.getUser());
myPres.setTo(nextEntry.getUser());
conn.sendPacket(myPres);
logger.info(myPres.toXML());
}
}
Log4j debug
142735 INFO mb.im.client.gui.MindIM - Start Send Presence!
142735 INFO mb.im.client.gui.MindIM - Sending Presence to:
142735 INFO mb.im.client.gui.MindIM - stesta@192.168.45.137
142735 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142735 INFO mb.im.client.gui.MindIM - Sending Presence to:
142735 INFO mb.im.client.gui.MindIM - talvarez@192.168.45.137
142735 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142735 INFO mb.im.client.gui.MindIM - Sending Presence to:
142735 INFO mb.im.client.gui.MindIM - rabbit8183@aimgateway.mindbridge.com
142735 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142735 INFO mb.im.client.gui.MindIM - Sending Presence to:
142745 INFO mb.im.client.gui.MindIM - klister@192.168.45.137
142745 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142745 INFO mb.im.client.gui.MindIM - Sending Presence to:
142745 INFO mb.im.client.gui.MindIM - jriviello@192.168.45.137
142745 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142745 INFO mb.im.client.gui.MindIM - Sending Presence to:
142745 INFO mb.im.client.gui.MindIM - richie165@aimgateway.mindbridge.com
142745 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142745 INFO mb.im.client.gui.MindIM - Sending Presence to:
142745 INFO mb.im.client.gui.MindIM - shay7@192.168.45.137
142745 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142745 INFO mb.im.client.gui.MindIM - Sending Presence to:
142745 INFO mb.im.client.gui.MindIM - jbollin@192.168.45.137
142755 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142755 INFO mb.im.client.gui.MindIM - Sending Presence to:
142755 INFO mb.im.client.gui.MindIM - bkeller@192.168.45.137
142755 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142755 INFO mb.im.client.gui.MindIM - Sending Presence to:
142755 INFO mb.im.client.gui.MindIM - dchristian@192.168.45.137
142755 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142755 INFO mb.im.client.gui.MindIM - Sending Presence to:
142755 INFO mb.im.client.gui.MindIM - richie165@192.168.45.137
142755 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142755 INFO mb.im.client.gui.MindIM - Sending Presence to:
142755 INFO mb.im.client.gui.MindIM - gordowyrm@aimgateway.mindbridge.com
142765 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142765 INFO mb.im.client.gui.MindIM - Sending Presence to:
142765 INFO mb.im.client.gui.MindIM - tkline@192.168.45.137
142765 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142765 INFO mb.im.client.gui.MindIM - Sending Presence to:
142765 INFO mb.im.client.gui.MindIM - mportner@192.168.45.137
142765 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142765 INFO mb.im.client.gui.MindIM - Sending Presence to:
142765 INFO mb.im.client.gui.MindIM - jmortland@192.168.45.137
142765 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142765 INFO mb.im.client.gui.MindIM - Sending Presence to:
142765 INFO mb.im.client.gui.MindIM - daveb@192.168.45.137
142765 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142775 INFO mb.im.client.gui.MindIM - Sending Presence to:
142775 INFO mb.im.client.gui.MindIM - twalters@192.168.45.137
142775 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142775 INFO mb.im.client.gui.MindIM - Sending Presence to:
142775 INFO mb.im.client.gui.MindIM - support@192.168.45.137
142775 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142775 INFO mb.im.client.gui.MindIM - Sending Presence to:
142775 INFO mb.im.client.gui.MindIM - gmarshal@192.168.45.137
142775 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142775 INFO mb.im.client.gui.MindIM - Sending Presence to:
142775 INFO mb.im.client.gui.MindIM - pjackson@192.168.45.137
142775 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142785 INFO mb.im.client.gui.MindIM - Sending Presence to:
142785 INFO mb.im.client.gui.MindIM - aimgateway.mindbridge.com/registered
142785 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142785 INFO mb.im.client.gui.MindIM - Sending Presence to:
142785 INFO mb.im.client.gui.MindIM - rhamburg@192.168.45.137
142785 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142785 INFO mb.im.client.gui.MindIM - Sending Presence to:
142785 INFO mb.im.client.gui.MindIM - pstalker@192.168.45.137
142785 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142785 INFO mb.im.client.gui.MindIM - Sending Presence to:
142785 INFO mb.im.client.gui.MindIM - jgavin@192.168.45.137
142785 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142785 INFO mb.im.client.gui.MindIM - Sending Presence to:
142795 INFO mb.im.client.gui.MindIM - ddunham@192.168.45.137
142795 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142795 INFO mb.im.client.gui.MindIM - Sending Presence to:
142795 INFO mb.im.client.gui.MindIM - jgibson@192.168.45.137
142795 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142795 INFO mb.im.client.gui.MindIM - Sending Presence to:
142795 INFO mb.im.client.gui.MindIM - rabbit8183%aimgateway.mindbridge.com@aimgateway.mindbridge.com
142795 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142795 INFO mb.im.client.gui.MindIM - Sending Presence to:
142795 INFO mb.im.client.gui.MindIM - dthomas@192.168.45.137
142795 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142795 INFO mb.im.client.gui.MindIM - Sending Presence to:
142805 INFO mb.im.client.gui.MindIM - ofields@192.168.45.137
142805 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
142805 INFO mb.im.client.gui.MindIM - Sending Presence to:
142805 INFO mb.im.client.gui.MindIM - jgriffith@192.168.45.137
142805 INFO mb.im.client.gui.MindIM - On a Conference Calldnd
— smack sent –
presence id=“PN8EN-16” to="jbollin@192.168.45.137" from="mclovis@192.168.45.137/work">On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd
On a Conference Calldnd