congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.jivesoftware.smack.packet
Code IndexAdd Tabnine to your IDE (free)

How to use org.jivesoftware.smack.packet

Best Java code snippets using org.jivesoftware.smack.packet (Showing top 20 results out of 549)

origin: igniterealtime/Smack

public IQ createErrorUnsupportedInfo(Jingle request) {
  StanzaError.Builder error = StanzaError.getBuilder();
  error.setCondition(StanzaError.Condition.feature_not_implemented)
      .addExtension(JingleError.UNSUPPORTED_INFO);
  return IQ.createErrorResponse(request, error);
}
origin: igniterealtime/Smack

  public static FileTooLargeError from(IQ iq) {
    StanzaError error = iq.getError();
    if (error == null) {
      return null;
    }
    return error.getExtension(ELEMENT, NAMESPACE);
  }
}
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

/**
 * Creates and returns a copy of this message stanza.
 * <p>
 * This does not perform a deep clone, as extension elements are shared between the new and old
 * instance.
 * </p>
 * @return a clone of this message.
 */
@Override
public Message clone() {
  return new Message(this);
}
origin: igniterealtime/Smack

/**
 * Returns a response IQ for a activation request to the proxy.
 *
 * @param from JID of the proxy
 * @param to JID of the client who wants to activate the SOCKS5 Bytestream
 * @return response IQ for a activation request to the proxy
 */
public static IQ createActivationConfirmation(Jid from, Jid to) {
  IQ response = new EmptyResultIQ();
  response.setFrom(from);
  response.setTo(to);
  return response;
}
origin: igniterealtime/Smack

@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
  xml.attribute("jid", jid);
  xml.optAttribute("node", node);
  xml.rightAngleBracket();
  return xml;
}
origin: igniterealtime/Smack

  @Override
  public void processStanza(Stanza packet)
      throws
      NotConnectedException,
      InterruptedException,
      SmackException.NotLoggedInException {
    Message message = (Message) packet;
    // add a markable extension
    message.addExtension(ChatMarkersElements.MarkableExtension.INSTANCE);
  }
}, OUTGOING_MESSAGE_FILTER);
origin: igniterealtime/Smack

@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
  xml.rightAngleBracket();
  xml.append(setData);
  return xml;
}
origin: igniterealtime/Smack

@Override
protected boolean acceptSpecific(Message message) {
  // Accept only messages which have a subject set
  return message.getSubject() != null;
}
origin: igniterealtime/Smack

@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
  xml.attribute("jid", jid);
  xml.setEmptyElement();
  return xml;
}
origin: igniterealtime/Smack

public Builder addElement(String name, String textValue) {
  StandardExtensionElement element = StandardExtensionElement.builder(name, this.namespace).setText(
          textValue).build();
  return addElement(element);
}
origin: igniterealtime/Smack

/**
 * Creates a new XMPPException with the stream error that was the root case of the
 * exception. When a stream error is received from the server then the underlying connection
 * will be closed by the server.
 *
 * @param streamError the root cause of the exception.
 */
public StreamErrorException(StreamError streamError) {
  super(streamError.getCondition().toString()
     + " You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions\n"
     + streamError.toString());
  this.streamError = streamError;
}
origin: igniterealtime/Smack

public static Bind newSet(Resourcepart resource) {
  Bind bind = new Bind(resource, null);
  bind.setType(IQ.Type.set);
  return bind;
}
origin: igniterealtime/Smack

public static BlockedErrorExtension from(Message message) {
  StanzaError error = message.getError();
  if (error == null) {
    return null;
  }
  return error.getExtension(ELEMENT, NAMESPACE);
}
origin: igniterealtime/Smack

public static Builder getBuilder(StanzaError xmppError) {
  return getBuilder().copyFrom(xmppError);
}
origin: igniterealtime/Smack

/**
 * Returns the subject corresponding to the language. If the language is null, the method result
 * will be the same as {@link #getSubject()}. Null will be returned if the language does not have
 * a corresponding subject.
 *
 * @param language the language of the subject to return.
 * @return the subject related to the passed in language.
 */
public String getSubject(String language) {
  Subject subject = getMessageSubject(language);
  return subject == null ? null : subject.subject;
}
origin: igniterealtime/Smack

  @Override
  protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
    if (getChildElementName() == null)
      return null;
    return super.getIQChildElementBuilder(xml);
  }
}
origin: igniterealtime/Smack

public IQ createErrorOutOfOrder(Jingle request) {
  StanzaError.Builder error = StanzaError.getBuilder();
  error.setCondition(StanzaError.Condition.unexpected_request)
      .addExtension(JingleError.OUT_OF_ORDER);
  return IQ.createErrorResponse(request, error);
}
origin: igniterealtime/Smack

public IQ createErrorUnknownSession(Jingle request) {
  StanzaError.Builder error = StanzaError.getBuilder();
  error.setCondition(StanzaError.Condition.item_not_found)
      .addExtension(JingleError.UNKNOWN_SESSION);
  return IQ.createErrorResponse(request, error);
}
origin: igniterealtime/Smack

public IQ createErrorTieBreak(Jingle request) {
  StanzaError.Builder error = StanzaError.getBuilder();
  error.setCondition(StanzaError.Condition.conflict)
      .addExtension(JingleError.TIE_BREAK);
  return IQ.createErrorResponse(request, error);
}
org.jivesoftware.smack.packet

Most used classes

  • Message
    Represents XMPP message packets. A message can be one of several types: * Message.Type.NORMAL --
  • Presence
    Represents XMPP presence packets. Every presence stanza has a type, which is one of the following va
  • IQ
    The base IQ (Info/Query) packet. IQ packets are used to get and set information on the server, inclu
  • Packet
    Base class for XMPP packets. Every packet has a unique ID (which is automatically generated, but can
  • Stanza
    Base class for XMPP Stanzas, which are called Stanza in older versions of Smack (i.e. < 4.1). Every
  • IQ$IQChildElementXmlStringBuilder,
  • IQ$Type,
  • Message$Type,
  • StanzaError,
  • Presence$Type,
  • Presence$Mode,
  • ExtensionElement,
  • Bind,
  • Message$Body,
  • StreamError,
  • DefaultPacketExtension,
  • StanzaError$Builder,
  • StanzaError$Condition,
  • PacketExtension
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