XMPPError.Condition errCondition = err.getCondition(); if((XMPPError.Type.CANCEL.equals(errType) && (XMPPError.Condition.conflict.equals(errCondition) || XMPPError.Condition.forbidden.equals( errCondition))) || (XMPPError.Type.AUTH.equals(errType) && XMPPError.Condition.forbidden.equals(errCondition)))
/** * Returns the error as XML. * * @return the error as XML. */ public String toXML() { StringBuilder buf = new StringBuilder(); buf.append("<error code=\"").append(code).append("\""); if (type != null) { buf.append(" type=\""); buf.append(type.name()); buf.append("\""); } buf.append(">"); if (condition != null) { buf.append("<").append(condition); buf.append(" xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>"); } if (message != null) { buf.append("<text xml:lang=\"en\" xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">"); buf.append(message); buf.append("</text>"); } for (PacketExtension element : this.getExtensions()) { buf.append(element.toXML()); } buf.append("</error>"); return buf.toString(); }
try { if (type != null) { errorType = XMPPError.Type.valueOf(type.toUpperCase());
try { if (type != null) { errorType = XMPPError.Type.valueOf(type.toUpperCase());
try { if (type != null) { errorType = XMPPError.Type.valueOf(type.toUpperCase());
/** * Returns the error as XML. * * @return the error as XML. */ public String toXML() { StringBuilder buf = new StringBuilder(); buf.append("<error code=\"").append(code).append("\""); if (type != null) { buf.append(" type=\""); buf.append(type.name()); buf.append("\""); } buf.append(">"); if (condition != null) { buf.append("<").append(condition); buf.append(" xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>"); } if (message != null) { buf.append("<text xml:lang=\"en\" xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">"); buf.append(message); buf.append("</text>"); } for (PacketExtension element : this.getExtensions()) { buf.append(element.toXML()); } buf.append("</error>"); return buf.toString(); }
/** * Returns the error as XML. * * @return the error as XML. */ public String toXML() { StringBuilder buf = new StringBuilder(); buf.append("<error code=\"").append(code).append("\""); if (type != null) { buf.append(" type=\""); buf.append(type.name()); buf.append("\""); } buf.append(">"); if (condition != null) { buf.append("<").append(condition); buf.append(" xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>"); } if (message != null) { buf.append("<text xml:lang=\"en\" xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\">"); buf.append(message); buf.append("</text>"); } for (PacketExtension element : this.getExtensions()) { buf.append(element.toXML()); } buf.append("</error>"); return buf.toString(); }
&& XMPPError.Type.CANCEL.equals(err.getType()) && XMPPError.Condition.item_not_found.equals( err.getCondition()))