WebIM Java SDK for NexTalk.IM
Java 1.6+
lib/org.json-20120521.jar
dist/webim.client-5.4-$date.jar
WebimEndpoint ep = new WebimEndpoint("uid1", "user1");
WebimClient client = new WebimClient(ep, "domain", "apikey", "localhost", 8000);
List<String> buddyIds = new ArrayList<String>();
buddyIds.add("uid1");
buddyIds.add("uid2");
List<String> roomIds = new ArrayList<String>();
roomIds.add("room1");
roomIds.add("room2");
Map<String,Object> rt = client.online(buddyIds, roomIds);
client.offline()
client.publish(new WebimMessage("uid2", "User3", "hahaha", "", 1292832.183);
client.publish(new WebimStatus("uid2", "typing", "User2 is typing"));
client.publish(new WebimPresence("away", "Away"));
client.push("uid3", new WebimMessage("uid2", "User3", "hahaha", "", 1292832.183));
client.presences(buddyIds);
JSONObject members = client.members("room1");
详见javadoc