Java 类org.jivesoftware.smackx.workgroup.ext.history.ChatMetadata 实例源码

项目:EIM    文件:AgentSession.java   
/**
 * Query for metadata associated with a session id.
 *
 * @param sessionID the sessionID to query for.
 * @return Map a map of all metadata associated with the sessionID.
 * @throws XMPPException if an error occurs while getting information from the server.
 */
public Map getChatMetadata(String sessionID) throws XMPPException {
    ChatMetadata request = new ChatMetadata();
    request.setType(IQ.Type.GET);
    request.setTo(workgroupJID);
    request.setSessionID(sessionID);

    PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
    connection.sendPacket(request);


    ChatMetadata response = (ChatMetadata)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
    return response.getMetadata();
}
项目:androidPN-client.    文件:AgentSession.java   
/**
 * Query for metadata associated with a session id.
 *
 * @param sessionID the sessionID to query for.
 * @return Map a map of all metadata associated with the sessionID.
 * @throws XMPPException if an error occurs while getting information from the server.
 */
public Map<String, List<String>> getChatMetadata(String sessionID) throws XMPPException {
    ChatMetadata request = new ChatMetadata();
    request.setType(IQ.Type.GET);
    request.setTo(workgroupJID);
    request.setSessionID(sessionID);

    PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
    connection.sendPacket(request);


    ChatMetadata response = (ChatMetadata)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
    return response.getMetadata();
}
项目:xmppsupport_v2    文件:AgentSession.java   
/**
 * Query for metadata associated with a session id.
 * 
 * @param sessionID
 *            the sessionID to query for.
 * @return Map a map of all metadata associated with the sessionID.
 * @throws XMPPException
 *             if an error occurs while getting information from the server.
 */
public Map getChatMetadata(String sessionID) throws XMPPException {
    ChatMetadata request = new ChatMetadata();
    request.setType(IQ.Type.GET);
    request.setTo(workgroupJID);
    request.setSessionID(sessionID);

    PacketCollector collector = connection
            .createPacketCollector(new PacketIDFilter(request.getPacketID()));
    connection.sendPacket(request);

    ChatMetadata response = (ChatMetadata) collector
            .nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
    return response.getMetadata();
}
项目:java-bells    文件:AgentSession.java   
/**
 * Query for metadata associated with a session id.
 *
 * @param sessionID the sessionID to query for.
 * @return Map a map of all metadata associated with the sessionID.
 * @throws XMPPException if an error occurs while getting information from the server.
 */
public Map<String, List<String>> getChatMetadata(String sessionID) throws XMPPException {
    ChatMetadata request = new ChatMetadata();
    request.setType(IQ.Type.GET);
    request.setTo(workgroupJID);
    request.setSessionID(sessionID);

    PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
    connection.sendPacket(request);


    ChatMetadata response = (ChatMetadata)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
    return response.getMetadata();
}
项目:telegraph    文件:AgentSession.java   
/**
 * Query for metadata associated with a session id.
 *
 * @param sessionID the sessionID to query for.
 * @return Map a map of all metadata associated with the sessionID.
 * @throws XMPPException if an error occurs while getting information from the server.
 */
public Map getChatMetadata(String sessionID) throws XMPPException {
    ChatMetadata request = new ChatMetadata();
    request.setType(IQ.Type.GET);
    request.setTo(workgroupJID);
    request.setSessionID(sessionID);

    PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
    connection.sendPacket(request);


    ChatMetadata response = (ChatMetadata)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
    return response.getMetadata();
}
项目:NewCommunication-Android    文件:AgentSession.java   
/**
 * Query for metadata associated with a session id.
 *
 * @param sessionID the sessionID to query for.
 * @return Map a map of all metadata associated with the sessionID.
 * @throws XMPPException if an error occurs while getting information from the server.
 */
public Map getChatMetadata(String sessionID) throws XMPPException {
    ChatMetadata request = new ChatMetadata();
    request.setType(IQ.Type.GET);
    request.setTo(workgroupJID);
    request.setSessionID(sessionID);

    PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
    connection.sendPacket(request);


    ChatMetadata response = (ChatMetadata)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Cancel the collector.
    collector.cancel();
    if (response == null) {
        throw new XMPPException("No response from server.");
    }
    if (response.getError() != null) {
        throw new XMPPException(response.getError());
    }
    return response.getMetadata();
}
项目:Smack    文件:AgentSession.java   
/**
 * Query for metadata associated with a session id.
 *
 * @param sessionID the sessionID to query for.
 * @return Map a map of all metadata associated with the sessionID.
 * @throws XMPPException if an error occurs while getting information from the server.
 * @throws NotConnectedException 
 */
public Map<String, List<String>> getChatMetadata(String sessionID) throws XMPPException, NotConnectedException {
    ChatMetadata request = new ChatMetadata();
    request.setType(IQ.Type.get);
    request.setTo(workgroupJID);
    request.setSessionID(sessionID);

    ChatMetadata response = connection.createPacketCollectorAndSend(request).nextResult();

    return response.getMetadata();
}