null
*/
public Success(String data) {
this.data = StringUtils.returnIfNotEmptyTrimmed(data);
}
/**
* Returns additional data for the SASL layer or null
.
*
* @return additional data or null
*/
public String getData() {
return data;
}
@Override
public XmlStringBuilder toXML() {
XmlStringBuilder xml = new XmlStringBuilder();
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngleBracket();
xml.optAppend(data);
xml.closeElement(ELEMENT);
return xml;
}
}
/**
* A SASL failure stream element.
*/
public static class SASLFailure extends PlainStreamElement {
public static final String ELEMENT = "failure";
private final SASLError saslError;
private final String saslErrorString;
private final Map* Returns the descriptive text of this SASLFailure in the system default language if possible. May return null. *
* * @return the descriptive text or null. */ public String getDescriptiveText() { String defaultLocale = Locale.getDefault().getLanguage(); String descriptiveText = getDescriptiveText(defaultLocale); if (descriptiveText == null) { descriptiveText = getDescriptiveText(null); } return descriptiveText; } /** * Get the descriptive test of this SASLFailure. ** Returns the descriptive text of this SASLFailure in the given language. May return null if not available. *
* * @param xmllang the language. * @return the descriptive text or null. */ public String getDescriptiveText(String xmllang) { return descriptiveTexts.get(xmllang); } @Override public XmlStringBuilder toXML() { XmlStringBuilder xml = new XmlStringBuilder(); xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngleBracket(); xml.emptyElement(saslErrorString); for (Map.Entry