/** * Create a decorator from an existing {@link Form} for node configuration. * Typically, this can be used to create a decorator for an answer form * by using the result of {@link #createAnswerForm()} as the input parameter. * * @param nodeConfigForm */ public ConfigureForm(Form nodeConfigForm) { super(nodeConfigForm.getDataFormToSend()); }
/** * Create a decorator from an existing {@link Form} for node configuration. * Typically, this can be used to create a decorator for an answer form * by using the result of {@link #createAnswerForm()} as the input parameter. * * @param nodeConfigForm */ public ConfigureForm(Form nodeConfigForm) { super(nodeConfigForm.getDataFormToSend()); }
/** * Create a decorator from an existing {@link Form} for node configuration. * Typically, this can be used to create a decorator for an answer form * by using the result of {@link #createAnswerForm()} as the input parameter. * * @param nodeConfigForm */ public ConfigureForm(Form nodeConfigForm) { super(nodeConfigForm.getDataFormToSend()); }
public SubscribeForm(Form subscribeOptionsForm) { super(subscribeOptionsForm.getDataFormToSend()); }
public SubscribeForm(Form subscribeOptionsForm) { super(subscribeOptionsForm.getDataFormToSend()); }
public SubscribeForm(Form subscribeOptionsForm) { super(subscribeOptionsForm.getDataFormToSend()); }
/** * Sets the form of the current stage. This should be used when setting a * response. It could be a form to fill out the information needed to go to * the next stage or the result of an execution. * * @param form the form of the current stage to fill out or the result of the * execution. */ protected void setForm(Form form) { data.setForm(form.getDataFormToSend()); }
/** * Sets the form of the current stage. This should be used when setting a * response. It could be a form to fill out the information needed to go to * the next stage or the result of an execution. * * @param form the form of the current stage to fill out or the result of the * execution. */ protected void setForm(Form form) { data.setForm(form.getDataFormToSend()); }
/** * Sets the form of the current stage. This should be used when setting a * response. It could be a form to fill out the information needed to go to * the next stage or the result of an execution. * * @param form the form of the current stage to fill out or the result of the * execution. */ protected void setForm(Form form) { data.setForm(form.getDataFormToSend()); }
@Override public String toXML() { if (configForm == null) { return super.toXML(); } else { StringBuilder builder = new StringBuilder("<"); builder.append(getElementName()); if (getNode() != null) { builder.append(" node='"); builder.append(getNode()); builder.append("'>"); } else builder.append('>'); builder.append(configForm.getDataFormToSend().toXML()); builder.append("</"); builder.append(getElementName() + '>'); return builder.toString(); } }
public JoinQueuePacket(String workgroup, Form answerForm, String userID) { this.userID = userID; setTo(workgroup); setType(Type.SET); form = answerForm.getDataFormToSend(); addExtension(form); }
@Override public String toXML() { if (configForm == null) { return super.toXML(); } else { StringBuilder builder = new StringBuilder("<"); builder.append(getElementName()); if (getNode() != null) { builder.append(" node='"); builder.append(getNode()); builder.append("'>"); } else builder.append('>'); builder.append(configForm.getDataFormToSend().toXML()); builder.append("</"); builder.append(getElementName() + '>'); return builder.toString(); } }
@Override public String toXML() { if (configForm == null) { return super.toXML(); } else { StringBuilder builder = new StringBuilder("<"); builder.append(getElementName()); if (getNode() != null) { builder.append(" node='"); builder.append(getNode()); builder.append("'>"); } else builder.append('>'); builder.append(configForm.getDataFormToSend().toXML()); builder.append("</"); builder.append(getElementName() + '>'); return builder.toString(); } }
public JoinQueuePacket(String workgroup, Form answerForm, String userID) { this.userID = userID; setTo(workgroup); setType(IQ.Type.SET); form = answerForm.getDataFormToSend(); addExtension(form); }
public JoinQueuePacket(String workgroup, Form answerForm, String userID) { this.userID = userID; setTo(workgroup); setType(IQ.Type.SET); form = answerForm.getDataFormToSend(); addExtension(form); }
/** * Sends the completed configuration form to the server. The room will be configured * with the new settings defined in the form. If the form is empty then the server * will create an instant room (will use default configuration). * * @param form the form with the new settings. * @throws XMPPException if an error occurs setting the new rooms' configuration. */ public void sendConfigurationForm(Form form) throws XMPPException { MUCOwner iq = new MUCOwner(); iq.setTo(room); iq.setType(IQ.Type.SET); iq.addExtension(form.getDataFormToSend()); // Filter packets looking for an answer from the server. PacketFilter responseFilter = new PacketIDFilter(iq.getPacketID()); PacketCollector response = connection.createPacketCollector(responseFilter); // Send the completed configuration form to the server. connection.sendPacket(iq); // Wait up to a certain number of seconds for a reply. IQ answer = (IQ) response.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Stop queuing results response.cancel(); if (answer == null) { throw new XMPPException("No response from server."); } else if (answer.getError() != null) { throw new XMPPException(answer.getError()); } }
/** * Sends the filled out answer form to be sent and queried by the search service. * * @param con the current Connection. * @param searchForm the <code>Form</code> to send for querying. * @param searchService the search service to use. (ex. search.jivesoftware.com) * @return ReportedData the data found from the query. * @throws XMPPException * thrown if a server error has occurred. */ public ReportedData sendSearchForm(Connection con, Form searchForm, String searchService) throws XMPPException { UserSearch search = new UserSearch(); search.setType(Type.SET); search.setTo(searchService); search.addExtension(searchForm.getDataFormToSend()); PacketCollector collector = con.createPacketCollector(new PacketIDFilter(search.getPacketID())); con.sendPacket(search); IQ response = (IQ) 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) { return sendSimpleSearchForm(con, searchForm, searchService); } return ReportedData.getReportedDataFrom(response); }
search.setType(IQ.Type.GET); search.setTo(serviceJID); search.addExtension(completedForm.getDataFormToSend());
search.setType(IQ.Type.GET); search.setTo(serviceJID); search.addExtension(completedForm.getDataFormToSend());
reg.setType(IQ.Type.SET); reg.setTo(room); reg.addExtension(form.getDataFormToSend());