I’'m developing an external component for managing x10 devices. This component contains a few entites. for example, if the jid for the component is x10.some.jabber.server, then jids of contained entities are:
lamp@x10.some.jabber.server
sensor@x10.some.jabber.server, etc.
when these individual entity wants to update its presence, it sends out a presence stanza with no ‘‘to’’ address, which, according to the jabber protocol and if I understood correctly, will make the jabber server to broadcast the presence update to all subscribers.
However, this did not work for me. The warning I got is:
presence requested from server someserver by unknown user lamp@x10.someserver.
I looked at the wildfire source code that I just downloaded and found that codes right after this warning is commented out. Can someone please tell me how to broadcast presence from an external component?
BTW, I’'m copying the source code snippet for the reference.
=================================================
org.jivesoftware.wildfire.handler.PresenceUpdateHandler.java
=================================================
// Foreign updates will do a reverse lookup of entries in rosters
// on the server
Log.warn("Presence requested from server "
-
localServer.getServerInfo().getName()
-
" by unknown user: " + update.getFrom());
/*
Connection con = null;
PreparedStatement pstmt = null;
try {
pstmt = con.prepareStatement(GET_ROSTER_SUBS);
pstmt.setString(1, update.getSender().toBareString().toLowerCase());
ResultSet rs = pstmt.executeQuery();
while (rs.next()){
long userID = rs.getLong(1);
try {
User user = server.getUserManager().getUser(userID);
update.setRecipient(user.getAddress());
server.getSessionManager().userBroadcast(user.getUsername(),
update.getPacket());
} catch (UserNotFoundException e) {
Log.error(LocaleUtils.getLocalizedString(“admin.error”),e);
} catch (UnauthorizedException e) {
Log.error(LocaleUtils.getLocalizedString(“admin.error”),e);
}
}
}
catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString(“admin.error”),e);
}
*/