congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
StanzaError$Condition
Code IndexAdd Tabnine to your IDE (free)

How to use
StanzaError$Condition
in
org.jivesoftware.smack.packet

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

origin: igniterealtime/Smack

@Override
public String toString() {
  StringBuilder sb = new StringBuilder("XMPPError: ");
  sb.append(condition.toString()).append(" - ").append(type.toString());
  if (errorGenerator != null) {
    sb.append(". Generated by ").append(errorGenerator);
  }
  return sb.toString();
}
origin: igniterealtime/Smack

  textElements.add(stanzaErrorTextElement);
} else {
  condition = StanzaError.Condition.fromString(name);
origin: igniterealtime/Smack

@Override
public String toString() {
  return this.name().replace('_', '-');
}
origin: igniterealtime/Spark

if ( StanzaError.Condition.conflict.equals( error.getCondition() ) )
origin: org.igniterealtime.smack/smack-core

  break;
default:
  builder.setCondition(StanzaError.Condition.fromString(name));
  if (!parser.isEmptyElementTag()) {
    builder.setConditionText(parser.nextText());
origin: igniterealtime/Spark

if (p.getError()
.getCondition()
.equals(StanzaError.Condition.conflict
.toString())) {
return;
origin: org.igniterealtime.smack/smack-core

@Override
public XmlStringBuilder toXML(String enclosingNamespace) {
  XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
  xml.attribute("type", type.toString());
  xml.optAttribute("by", errorGenerator);
  xml.rightAngleBracket();
  xml.halfOpenElement(condition.toString());
  xml.xmlnsAttribute(ERROR_CONDITION_AND_TEXT_NAMESPACE);
  if (conditionText != null) {
    xml.rightAngleBracket();
    xml.escape(conditionText);
    xml.closeElement(condition.toString());
  }
  else {
    xml.closeEmptyElement();
  }
  addDescriptiveTextsAndExtensions(xml);
  xml.closeElement(this);
  return xml;
}
origin: org.igniterealtime.smack/smack-core

  public static Condition fromString(String string) {
    // Backwards compatibility for older implementations still using RFC 3920. RFC 6120
    // changed 'xml-not-well-formed' to 'not-well-formed'.
    if ("xml-not-well-formed".equals(string)) {
      string = "not-well-formed";
    }
    string = string.replace('-', '_');
    Condition condition = null;
    try {
      condition = Condition.valueOf(string);
    } catch (Exception e) {
      throw new IllegalStateException("Could not transform string '" + string + "' to XMPPErrorCondition", e);
    }
    return condition;
  }
}
origin: org.igniterealtime.smack/smack-core

@Override
public String toString() {
  return this.name().replace('_', '-');
}
origin: org.igniterealtime.smack/smack-core

@Override
public String toString() {
  StringBuilder sb = new StringBuilder("XMPPError: ");
  sb.append(condition.toString()).append(" - ").append(type.toString());
  if (errorGenerator != null) {
    sb.append(". Generated by ").append(errorGenerator);
  }
  return sb.toString();
}
origin: igniterealtime/Smack

  break;
default:
  builder.setCondition(StanzaError.Condition.fromString(name));
  if (!parser.isEmptyElementTag()) {
    builder.setConditionText(parser.nextText());
origin: igniterealtime/Smack

assertTrue(StanzaError.Condition.internal_server_error.equals(e.getStanzaError().getCondition()));
protocol.verifyAll();
origin: igniterealtime/Smack

@Override
public XmlStringBuilder toXML(String enclosingNamespace) {
  XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
  xml.attribute("type", type.toString());
  xml.optAttribute("by", errorGenerator);
  xml.rightAngleBracket();
  xml.halfOpenElement(condition.toString());
  xml.xmlnsAttribute(ERROR_CONDITION_AND_TEXT_NAMESPACE);
  if (conditionText != null) {
    xml.rightAngleBracket();
    xml.escape(conditionText);
    xml.closeElement(condition.toString());
  }
  else {
    xml.closeEmptyElement();
  }
  addDescriptiveTextsAndExtensions(xml);
  xml.closeElement(this);
  return xml;
}
origin: igniterealtime/Smack

@Override
public CharSequence toXML(String enclosingNamespace) {
  XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
  if (condition == null && textElements.isEmpty()) {
    xml.closeEmptyElement();
  } else {
    if (condition != null) {
      xml.rightAngleBracket();
      xml.append(condition.toString());
      xml.xmlnsAttribute(StanzaError.ERROR_CONDITION_AND_TEXT_NAMESPACE);
      xml.closeEmptyElement();
    }
    xml.append(textElements);
    xml.closeElement(ELEMENT);
  }
  return xml;
}
origin: igniterealtime/Smack

  @Test
  public void testConditionHasDefaultTypeMapping() throws NoSuchFieldException, IllegalAccessException {
    Map<Condition, Type> conditionToTypeMap = StanzaError.CONDITION_TO_TYPE;
    assertEquals("CONDITION_TO_TYPE map is likely out of sync with Condition enum",
        Condition.values().length,
        conditionToTypeMap.size());
  }
}
origin: igniterealtime/Smack

  public static Condition fromString(String string) {
    string = string.replace('-', '_');
    Condition condition = null;
    try {
      condition = Condition.valueOf(string);
    } catch (Exception e) {
      throw new IllegalStateException("Could not transform string '" + string + "' to XMPPErrorCondition", e);
    }
    return condition;
  }
}
origin: igniterealtime/Smack

@Test
public void testParseFailedError() throws Exception {
  StanzaError.Condition errorCondition = StanzaError.Condition.unexpected_request;
  String failedStanza = XMLBuilder.create("failed")
      .a("xmlns", "urn:xmpp:sm:3")
      .element(errorCondition.toString(), StanzaError.ERROR_CONDITION_AND_TEXT_NAMESPACE)
      .asString(outputProperties);
  StreamManagement.Failed failedPacket = ParseStreamManagement.failed(
      PacketParserUtils.getParserFor(failedStanza));
  assertThat(failedPacket, is(notNullValue()));
  assertTrue(failedPacket.getStanzaErrorCondition() == errorCondition);
}
org.jivesoftware.smack.packetStanzaError$Condition

Most used methods

  • toString
  • fromString
  • equals
  • name
  • valueOf
  • values

Popular in Java

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Menu (java.awt)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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