本文整理汇总了Java中com.lotus.sametime.im.Im类的典型用法代码示例。如果您正苦于以下问题:Java Im类的具体用法?Java Im怎么用?Java Im使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Im类属于com.lotus.sametime.im包,在下文中一共展示了Im类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: imReceived
import com.lotus.sametime.im.Im; //导入依赖的package包/类
public void imReceived(ImEvent imEvent) {
Log.debug("SameTime: Received IM: "+imEvent);
Im im = imEvent.getIm();
boolean imExists = false;
Im currentIm = null;
for (int i = 0; i < imOpened.size(); i++) {
currentIm = imOpened.elementAt(i);
if(currentIm.equals(im)) {
imExists = true;
im = currentIm;
break;
}
}
if (!imExists) {
imOpened.addElement(im);
im.addImListener(this);
}
}
示例2: getIMSession
import com.lotus.sametime.im.Im; //导入依赖的package包/类
public Im getIMSession(JID jid) {
Im currentIm = null;
for (int i = 0; i < imOpened.size(); i++) {
currentIm = imOpened.elementAt(i);
if (getSession().getTransport().convertIDToJID(currentIm.getPartner().getName()).equals(jid)) {
return currentIm;
}
}
return null;
}
示例3: imClosed
import com.lotus.sametime.im.Im; //导入依赖的package包/类
public void imClosed(ImEvent imEvent) {
Log.debug("SameTime: Closed IM session: "+imEvent);
Im im = imEvent.getIm();
Im currentIm = null;
for (int i = 0; i < imOpened.size(); i++) {
currentIm = imOpened.elementAt(i);
if (currentIm.equals(im)) {
imOpened.removeElement(im);
im.close(0);
im.removeImListener(this);
break;
}
}
}
示例4: sendMessage
import com.lotus.sametime.im.Im; //导入依赖的package包/类
/**
* @see net.sf.kraken.session.TransportSession#sendMessage(org.xmpp.packet.JID, String)
*/
@Override
public void sendMessage(JID jid, String message) {
Im im = listener.getIMSession(jid);
if (im != null) {
im.sendText(false, message);
}
}
示例5: entriesQueried
import com.lotus.sametime.im.Im; //导入依赖的package包/类
public void entriesQueried(DirectoryEvent event) {
STObject[] objects = event.getEntries();
for (int i = 0; i < objects.length; i++) {
BrokerFactory.getLoggingBroker().logDebug("objects["+i+"]="+objects[i]);
if (objects[i] instanceof STUser) {
STUser user = (STUser)objects[i];
BrokerFactory.getLoggingBroker().logDebug("user="+user.getName());
if (user.getName().equals (recipient)) {
Im im = imService.createIm(user,
EncLevel.ENC_LEVEL_NONE,
ImTypes.IM_TYPE_CHAT);
im.addImListener(this);
im.addImListener(parent);
im.open();
return;
}
}
}
if (!event.isAtEnd()) {
directory.queryEntries(false);
} else {
directory.removeDirectoryListener(this);
notification.addMessage("Could not find account in SameTime directory", null);
if (notification != null)
parent.setStatusOfSend(notification, "failed");
}
}