本文整理汇总了Java中org.jivesoftware.smackx.workgroup.packet.Transcripts类的典型用法代码示例。如果您正苦于以下问题:Java Transcripts类的具体用法?Java Transcripts怎么用?Java Transcripts使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Transcripts类属于org.jivesoftware.smackx.workgroup.packet包,在下文中一共展示了Transcripts类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTranscripts
import org.jivesoftware.smackx.workgroup.packet.Transcripts; //导入依赖的package包/类
/**
* Returns the transcripts of a given user. The answer will contain the complete history of
* conversations that a user had.
*
* @param userID the id of the user to get his conversations.
* @param workgroupJID the JID of the workgroup that will process the request.
* @return the transcripts of a given user.
* @throws XMPPException if an error occurs while getting the information.
*/
public Transcripts getTranscripts(String workgroupJID, String userID) throws XMPPException {
Transcripts request = new Transcripts(userID);
request.setTo(workgroupJID);
PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
// Send the request
connection.sendPacket(request);
Transcripts response = (Transcripts) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
// Cancel the collector.
collector.cancel();
if (response == null) {
throw new XMPPException("No response from server on status set.");
}
if (response.getError() != null) {
throw new XMPPException(response.getError());
}
return response;
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:29,代码来源:TranscriptManager.java
示例2: getTranscripts
import org.jivesoftware.smackx.workgroup.packet.Transcripts; //导入依赖的package包/类
/**
* Returns the transcripts of a given user. The answer will contain the
* complete history of conversations that a user had.
*
* @param userID
* the id of the user to get his conversations.
* @param workgroupJID
* the JID of the workgroup that will process the request.
* @return the transcripts of a given user.
* @throws XMPPException
* if an error occurs while getting the information.
*/
public Transcripts getTranscripts(String workgroupJID, String userID)
throws XMPPException {
Transcripts request = new Transcripts(userID);
request.setTo(workgroupJID);
PacketCollector collector = connection
.createPacketCollector(new PacketIDFilter(request.getPacketID()));
// Send the request
connection.sendPacket(request);
Transcripts response = (Transcripts) collector
.nextResult(SmackConfiguration.getPacketReplyTimeout());
// Cancel the collector.
collector.cancel();
if (response == null) {
throw new XMPPException("No response from server on status set.");
}
if (response.getError() != null) {
throw new XMPPException(response.getError());
}
return response;
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:35,代码来源:TranscriptManager.java
示例3: init
import org.jivesoftware.smackx.workgroup.packet.Transcripts; //导入依赖的package包/类
public void init(Collection<Transcripts.TranscriptSummary> transcriptList) {
model.removeAllElements();
Iterator<Transcripts.TranscriptSummary> iter = transcriptList.iterator();
while (iter.hasNext()) {
Transcripts.TranscriptSummary summary = iter.next();
UserHistoryItem item = new UserHistoryItem(summary.getAgentDetails(), summary.getJoinTime(), summary.getLeftTime());
item.setSessionID(summary.getSessionID());
model.addElement(item);
}
list.validate();
list.repaint();
}
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:17,代码来源:UserHistory.java
示例4: compare
import org.jivesoftware.smackx.workgroup.packet.Transcripts; //导入依赖的package包/类
public int compare(Object o1, Object o2) {
final Transcripts.TranscriptSummary item1 = (Transcripts.TranscriptSummary)o1;
final Transcripts.TranscriptSummary item2 = (Transcripts.TranscriptSummary)o2;
long int1 = item1.getJoinTime().getTime();
long int2 = item2.getJoinTime().getTime();
if (int1 == int2) {
return 0;
}
if (int1 > int2) {
return -1;
}
if (int1 < int2) {
return 1;
}
return 0;
}
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:23,代码来源:UserHistory.java
示例5: loadHistory
import org.jivesoftware.smackx.workgroup.packet.Transcripts; //导入依赖的package包/类
public void loadHistory() {
SwingWorker transcriptThread = new SwingWorker() {
final List<TranscriptSummary> transcriptList = new ArrayList<TranscriptSummary>();
public Object construct() {
try {
Transcripts transcripts = FastpathPlugin.getAgentSession().getTranscripts(userID);
Iterator<TranscriptSummary> iter = transcripts.getSummaries().iterator();
while (iter.hasNext()) {
Transcripts.TranscriptSummary summary = (Transcripts.TranscriptSummary)iter.next();
transcriptList.add(summary);
}
}
catch (XMPPException e) {
Log.error("Error getting transcripts.", e);
}
Collections.sort(transcriptList, timeComparator);
return transcriptList;
}
public void finished() {
init(transcriptList);
}
};
transcriptThread.start();
}
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:30,代码来源:UserHistory.java
示例6: UserHistoryItem
import org.jivesoftware.smackx.workgroup.packet.Transcripts; //导入依赖的package包/类
public UserHistoryItem(Collection<Transcripts.AgentDetail> agentDetails, Date joinTime, Date endTime) {
setBackground(Color.white);
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY));
setLayout(new GridBagLayout());
final JLabel conLabel = new JLabel();
conLabel.setText(FpRes.getString("duration") + ":");
conLabel.setFont(new Font("Dialog", Font.BOLD, 11));
add(conLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0));
add(durationLabel, new GridBagConstraints(1, 2, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0));
long duration = endTime.getTime() - joinTime.getTime();
durationLabel.setText(ModelUtil.getTimeFromLong(duration));
final JLabel nameLabel = new JLabel();
nameLabel.setText(FpRes.getString("agents") + ":");
nameLabel.setFont(new Font("Dialog", Font.BOLD, 11));
add(nameLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(agentsLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
agentsLabel.setBackground(Color.white);
agentsLabel.setOpaque(false);
final SimpleDateFormat simpleFormat = new SimpleDateFormat("MM/dd/yyyy h:mm a");
JLabel timeLabel = new JLabel(FpRes.getString("date") + ":");
timeLabel.setFont(new Font("Dialog", Font.BOLD, 11));
String theDate = simpleFormat.format(joinTime);
add(timeLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(startTimeLabel, new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
startTimeLabel.setText(theDate);
StringBuffer buf = new StringBuffer();
Iterator<Transcripts.AgentDetail> agents = agentDetails.iterator();
while (agents.hasNext()) {
Transcripts.AgentDetail agentDetail = agents.next();
String agentJID = agentDetail.getAgentJID();
agentJID = UserManager.unescapeJID(agentJID);
buf.append(agentJID);
if (agents.hasNext()) {
buf.append("\n");
}
}
agentsLabel.setText(buf.toString());
}
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:48,代码来源:UserHistoryItem.java
示例7: getTranscripts
import org.jivesoftware.smackx.workgroup.packet.Transcripts; //导入依赖的package包/类
/**
* Returns the transcripts of a given user. The answer will contain the complete history of
* conversations that a user had.
*
* @param userID the id of the user to get his conversations.
* @param workgroupJID the JID of the workgroup that will process the request.
* @return the transcripts of a given user.
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
*/
public Transcripts getTranscripts(String workgroupJID, String userID) throws NoResponseException, XMPPErrorException, NotConnectedException {
Transcripts request = new Transcripts(userID);
request.setTo(workgroupJID);
Transcripts response = (Transcripts) connection.createPacketCollectorAndSend(request).nextResultOrThrow();
return response;
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:18,代码来源:TranscriptManager.java
示例8: getTranscripts
import org.jivesoftware.smackx.workgroup.packet.Transcripts; //导入依赖的package包/类
/**
* Returns the transcripts of a given user. The answer will contain the complete history of
* conversations that a user had.
*
* @param userID the id of the user to get his conversations.
* @return the transcripts of a given user.
* @throws XMPPException if an error occurs while getting the information.
* @throws SmackException
*/
public Transcripts getTranscripts(String userID) throws XMPPException, SmackException {
return transcriptManager.getTranscripts(workgroupJID, userID);
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:13,代码来源:AgentSession.java
注:本文中的org.jivesoftware.smackx.workgroup.packet.Transcripts类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论