Java 类org.jivesoftware.smackx.workgroup.settings.GenericSettings 实例源码

项目:EIM    文件:AgentSession.java   
/**
 * Returns the generic metadata of the workgroup the agent belongs to.
 *
 * @param con   the Connection to use.
 * @param query an optional query object used to tell the server what metadata to retrieve. This can be null.
 * @throws XMPPException if an error occurs while sending the request to the server.
 * @return the settings for the workgroup.
 */
public GenericSettings getGenericSettings(Connection con, String query) throws XMPPException {
    GenericSettings setting = new GenericSettings();
    setting.setType(IQ.Type.GET);
    setting.setTo(workgroupJID);

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

    GenericSettings response = (GenericSettings)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;
}
项目:androidPN-client.    文件:AgentSession.java   
/**
 * Returns the generic metadata of the workgroup the agent belongs to.
 *
 * @param con   the Connection to use.
 * @param query an optional query object used to tell the server what metadata to retrieve. This can be null.
 * @throws XMPPException if an error occurs while sending the request to the server.
 * @return the settings for the workgroup.
 */
public GenericSettings getGenericSettings(Connection con, String query) throws XMPPException {
    GenericSettings setting = new GenericSettings();
    setting.setType(IQ.Type.GET);
    setting.setTo(workgroupJID);

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

    GenericSettings response = (GenericSettings)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;
}
项目:xmppsupport_v2    文件:AgentSession.java   
/**
 * Returns the generic metadata of the workgroup the agent belongs to.
 * 
 * @param con
 *            the Connection to use.
 * @param query
 *            an optional query object used to tell the server what metadata
 *            to retrieve. This can be null.
 * @throws XMPPException
 *             if an error occurs while sending the request to the server.
 * @return the settings for the workgroup.
 */
public GenericSettings getGenericSettings(Connection con, String query)
        throws XMPPException {
    GenericSettings setting = new GenericSettings();
    setting.setType(IQ.Type.GET);
    setting.setTo(workgroupJID);

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

    GenericSettings response = (GenericSettings) 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;
}
项目:java-bells    文件:AgentSession.java   
/**
 * Returns the generic metadata of the workgroup the agent belongs to.
 *
 * @param con   the Connection to use.
 * @param query an optional query object used to tell the server what metadata to retrieve. This can be null.
 * @throws XMPPException if an error occurs while sending the request to the server.
 * @return the settings for the workgroup.
 */
public GenericSettings getGenericSettings(Connection con, String query) throws XMPPException {
    GenericSettings setting = new GenericSettings();
    setting.setType(IQ.Type.GET);
    setting.setTo(workgroupJID);

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

    GenericSettings response = (GenericSettings)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;
}
项目:telegraph    文件:AgentSession.java   
/**
 * Returns the generic metadata of the workgroup the agent belongs to.
 *
 * @param con   the Connection to use.
 * @param query an optional query object used to tell the server what metadata to retrieve. This can be null.
 * @throws XMPPException if an error occurs while sending the request to the server.
 * @return the settings for the workgroup.
 */
public GenericSettings getGenericSettings(Connection con, String query) throws XMPPException {
    GenericSettings setting = new GenericSettings();
    setting.setType(IQ.Type.GET);
    setting.setTo(workgroupJID);

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

    GenericSettings response = (GenericSettings)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;
}
项目:NewCommunication-Android    文件:AgentSession.java   
/**
 * Returns the generic metadata of the workgroup the agent belongs to.
 *
 * @param con   the Connection to use.
 * @param query an optional query object used to tell the server what metadata to retrieve. This can be null.
 * @throws XMPPException if an error occurs while sending the request to the server.
 * @return the settings for the workgroup.
 */
public GenericSettings getGenericSettings(Connection con, String query) throws XMPPException {
    GenericSettings setting = new GenericSettings();
    setting.setType(IQ.Type.GET);
    setting.setTo(workgroupJID);

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

    GenericSettings response = (GenericSettings)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;
}
项目:Smack    文件:AgentSession.java   
/**
 * Returns the generic metadata of the workgroup the agent belongs to.
 *
 * @param con   the XMPPConnection to use.
 * @param query an optional query object used to tell the server what metadata to retrieve. This can be null.
 * @return the settings for the workgroup.
 * @throws XMPPErrorException if an error occurs while sending the request to the server.
 * @throws NoResponseException 
 * @throws NotConnectedException 
 */
public GenericSettings getGenericSettings(XMPPConnection con, String query) throws NoResponseException, XMPPErrorException, NotConnectedException {
    GenericSettings setting = new GenericSettings();
    setting.setType(IQ.Type.get);
    setting.setTo(workgroupJID);

    GenericSettings response = (GenericSettings) connection.createPacketCollectorAndSend(
                    setting).nextResultOrThrow();
    return response;
}