Hi all,
can any one provide the sequence of steps to follow, to develop a *pubsub *service based sample application using su-smack API
Thank you,
Regards,
vidya
Hi all,
can any one provide the sequence of steps to follow, to develop a *pubsub *service based sample application using su-smack API
Thank you,
Regards,
vidya
Hi Vidhya,
me again
This is the sample test app for creating a node on wildfire.
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.packet.Packet; import se.su.it.smack.pubsub.PubSub;
import se.su.it.smack.pubsub.elements.CreateElement;
/** * * @author Jitendra Chittoda * */
public class CreateTest {
public static void main(String[] args) throws Exception { XMPPConnection con = new XMPPConnection("mymachine");
con.login("admin","admin");
con.addPacketListener(new PacketListener(){ public void processPacket(Packet pack) {
System.err.println("Recv : "+pack.toXML()); }
},null);
PubSub pubsub = new PubSub(); pubsub.setTo("pubsub.mymachine");
CreateElement ce =new CreateElement("node");
pubsub.addChild(ce);
con.sendPacket(pubsub);
System.out.println("Send : " + pubsub.toXML());
Thread.sleep(5000); }
}
You can use PSI to check node is created or not.
Regards,
Jitendra
Thanks a lot jithendra,