Java 类org.jivesoftware.smackx.workgroup.ext.forms.WorkgroupForm 实例源码

项目:EIM    文件:Workgroup.java   
/**
 * Returns the Form to use for all clients of a workgroup. It is unlikely that the server
 * will change the form (without a restart) so it is safe to keep the returned form
 * for future submissions.
 *
 * @return the Form to use for searching transcripts.
 * @throws XMPPException if an error occurs while sending the request to the server.
 */
public Form getWorkgroupForm() throws XMPPException {
    WorkgroupForm workgroupForm = new WorkgroupForm();
    workgroupForm.setType(IQ.Type.GET);
    workgroupForm.setTo(workgroupJID);

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

    WorkgroupForm response = (WorkgroupForm)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 Form.getFormFrom(response);
}
项目:androidPN-client.    文件:Workgroup.java   
/**
 * Returns the Form to use for all clients of a workgroup. It is unlikely that the server
 * will change the form (without a restart) so it is safe to keep the returned form
 * for future submissions.
 *
 * @return the Form to use for searching transcripts.
 * @throws XMPPException if an error occurs while sending the request to the server.
 */
public Form getWorkgroupForm() throws XMPPException {
    WorkgroupForm workgroupForm = new WorkgroupForm();
    workgroupForm.setType(IQ.Type.GET);
    workgroupForm.setTo(workgroupJID);

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

    WorkgroupForm response = (WorkgroupForm)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 Form.getFormFrom(response);
}
项目:xmppsupport_v2    文件:Workgroup.java   
/**
 * Returns the Form to use for all clients of a workgroup. It is unlikely
 * that the server will change the form (without a restart) so it is safe to
 * keep the returned form for future submissions.
 * 
 * @return the Form to use for searching transcripts.
 * @throws XMPPException
 *             if an error occurs while sending the request to the server.
 */
public Form getWorkgroupForm() throws XMPPException {
    WorkgroupForm workgroupForm = new WorkgroupForm();
    workgroupForm.setType(IQ.Type.GET);
    workgroupForm.setTo(workgroupJID);

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

    WorkgroupForm response = (WorkgroupForm) 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 Form.getFormFrom(response);
}
项目:java-bells    文件:Workgroup.java   
/**
 * Returns the Form to use for all clients of a workgroup. It is unlikely that the server
 * will change the form (without a restart) so it is safe to keep the returned form
 * for future submissions.
 *
 * @return the Form to use for searching transcripts.
 * @throws XMPPException if an error occurs while sending the request to the server.
 */
public Form getWorkgroupForm() throws XMPPException {
    WorkgroupForm workgroupForm = new WorkgroupForm();
    workgroupForm.setType(IQ.Type.GET);
    workgroupForm.setTo(workgroupJID);

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

    WorkgroupForm response = (WorkgroupForm)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 Form.getFormFrom(response);
}
项目:telegraph    文件:Workgroup.java   
/**
 * Returns the Form to use for all clients of a workgroup. It is unlikely that the server
 * will change the form (without a restart) so it is safe to keep the returned form
 * for future submissions.
 *
 * @return the Form to use for searching transcripts.
 * @throws XMPPException if an error occurs while sending the request to the server.
 */
public Form getWorkgroupForm() throws XMPPException {
    WorkgroupForm workgroupForm = new WorkgroupForm();
    workgroupForm.setType(IQ.Type.GET);
    workgroupForm.setTo(workgroupJID);

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

    WorkgroupForm response = (WorkgroupForm)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 Form.getFormFrom(response);
}
项目:NewCommunication-Android    文件:Workgroup.java   
/**
 * Returns the Form to use for all clients of a workgroup. It is unlikely that the server
 * will change the form (without a restart) so it is safe to keep the returned form
 * for future submissions.
 *
 * @return the Form to use for searching transcripts.
 * @throws XMPPException if an error occurs while sending the request to the server.
 */
public Form getWorkgroupForm() throws XMPPException {
    WorkgroupForm workgroupForm = new WorkgroupForm();
    workgroupForm.setType(IQ.Type.GET);
    workgroupForm.setTo(workgroupJID);

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

    WorkgroupForm response = (WorkgroupForm)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 Form.getFormFrom(response);
}
项目:Smack    文件:Workgroup.java   
/**
 * Returns the Form to use for all clients of a workgroup. It is unlikely that the server
 * will change the form (without a restart) so it is safe to keep the returned form
 * for future submissions.
 *
 * @return the Form to use for searching transcripts.
 * @throws XMPPErrorException
 * @throws NoResponseException
 * @throws NotConnectedException 
 */
public Form getWorkgroupForm() throws NoResponseException, XMPPErrorException, NotConnectedException {
    WorkgroupForm workgroupForm = new WorkgroupForm();
    workgroupForm.setType(IQ.Type.get);
    workgroupForm.setTo(workgroupJID);

    WorkgroupForm response = (WorkgroupForm) connection.createPacketCollectorAndSend(
                    workgroupForm).nextResultOrThrow();
    return Form.getFormFrom(response);
}