Tabnine Logo
StanzaError$Builder.setStanza
Code IndexAdd Tabnine to your IDE (free)

How to use
setStanza
method
in
org.jivesoftware.smack.packet.StanzaError$Builder

Best Java code snippets using org.jivesoftware.smack.packet.StanzaError$Builder.setStanza (Showing top 6 results out of 315)

origin: igniterealtime/Smack

/**
 * Convenience method to create a new {@link Type#error IQ.Type.error} IQ
 * based on a {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}
 * IQ. The new stanza will be initialized with:<ul>
 *      <li>The sender set to the recipient of the originating IQ.
 *      <li>The recipient set to the sender of the originating IQ.
 *      <li>The type set to {@link Type#error IQ.Type.error}.
 *      <li>The id set to the id of the originating IQ.
 *      <li>The child element contained in the associated originating IQ.
 *      <li>The provided {@link StanzaError XMPPError}.
 * </ul>
 *
 * @param request the {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} IQ packet.
 * @param error the error to associate with the created IQ packet.
 * @throws IllegalArgumentException if the IQ stanza does not have a type of
 *      {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}.
 * @return a new {@link Type#error IQ.Type.error} IQ based on the originating IQ.
 */
public static ErrorIQ createErrorResponse(final IQ request, final StanzaError.Builder error) {
  if (!(request.getType() == Type.get || request.getType() == Type.set)) {
    throw new IllegalArgumentException(
        "IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML(null));
  }
  final ErrorIQ result = new ErrorIQ(error);
  result.setStanzaId(request.getStanzaId());
  result.setFrom(request.getTo());
  result.setTo(request.getFrom());
  error.setStanza(result);
  return result;
}
origin: org.igniterealtime.smack/smack-core

/**
 * Convenience method to create a new {@link Type#error IQ.Type.error} IQ
 * based on a {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}
 * IQ. The new stanza will be initialized with:<ul>
 *      <li>The sender set to the recipient of the originating IQ.
 *      <li>The recipient set to the sender of the originating IQ.
 *      <li>The type set to {@link Type#error IQ.Type.error}.
 *      <li>The id set to the id of the originating IQ.
 *      <li>The child element contained in the associated originating IQ.
 *      <li>The provided {@link StanzaError XMPPError}.
 * </ul>
 *
 * @param request the {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set} IQ packet.
 * @param error the error to associate with the created IQ packet.
 * @throws IllegalArgumentException if the IQ stanza does not have a type of
 *      {@link Type#get IQ.Type.get} or {@link Type#set IQ.Type.set}.
 * @return a new {@link Type#error IQ.Type.error} IQ based on the originating IQ.
 */
public static ErrorIQ createErrorResponse(final IQ request, final StanzaError.Builder error) {
  if (!(request.getType() == Type.get || request.getType() == Type.set)) {
    throw new IllegalArgumentException(
        "IQ must be of type 'set' or 'get'. Original IQ: " + request.toXML(null));
  }
  final ErrorIQ result = new ErrorIQ(error);
  result.setStanzaId(request.getStanzaId());
  result.setFrom(request.getTo());
  result.setTo(request.getFrom());
  error.setStanza(result);
  return result;
}
origin: org.igniterealtime.smack/smack-core

public Builder copyFrom(StanzaError xmppError) {
  setCondition(xmppError.getCondition());
  setType(xmppError.getType());
  setConditionText(xmppError.getConditionText());
  setErrorGenerator(xmppError.getErrorGenerator());
  setStanza(xmppError.getStanza());
  setDescriptiveTexts(xmppError.descriptiveTexts);
  setTextNamespace(xmppError.textNamespace);
  setExtensions(xmppError.extensions);
  return this;
}
origin: org.igniterealtime.smack/smack-core

/**
 * Sets the error for this stanza.
 *
 * @param xmppErrorBuilder the error to associate with this stanza.
 */
public void setError(StanzaError.Builder xmppErrorBuilder) {
  if (xmppErrorBuilder == null) {
    return;
  }
  xmppErrorBuilder.setStanza(this);
  error = xmppErrorBuilder.build();
}
origin: igniterealtime/Smack

public Builder copyFrom(StanzaError xmppError) {
  setCondition(xmppError.getCondition());
  setType(xmppError.getType());
  setConditionText(xmppError.getConditionText());
  setErrorGenerator(xmppError.getErrorGenerator());
  setStanza(xmppError.getStanza());
  setDescriptiveTexts(xmppError.descriptiveTexts);
  setTextNamespace(xmppError.textNamespace);
  setExtensions(xmppError.extensions);
  return this;
}
origin: igniterealtime/Smack

/**
 * Sets the error for this stanza.
 *
 * @param xmppErrorBuilder the error to associate with this stanza.
 */
public void setError(StanzaError.Builder xmppErrorBuilder) {
  if (xmppErrorBuilder == null) {
    return;
  }
  xmppErrorBuilder.setStanza(this);
  error = xmppErrorBuilder.build();
}
org.jivesoftware.smack.packetStanzaError$BuildersetStanza

Popular methods of StanzaError$Builder

  • build
  • setCondition
  • setDescriptiveTexts
  • <init>
  • addExtension
  • copyFrom
  • setConditionText
  • setErrorGenerator
  • setExtensions
  • setTextNamespace
  • setType
  • setDescriptiveEnText
  • setType,
  • setDescriptiveEnText

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • getSystemService (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Notification (javax.management)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now