1package eu.siacs.conversations.xmpp.stanzas;
2
3import eu.siacs.conversations.xml.Element;
4
5abstract public class AbstractAcknowledgeableStanza extends AbstractStanza {
6
7 protected AbstractAcknowledgeableStanza(String name) {
8 super(name);
9 }
10
11
12 public String getId() {
13 return this.getAttribute("id");
14 }
15
16 public void setId(final String id) {
17 setAttribute("id", id);
18 }
19
20 public Element getError() {
21 Element error = findChild("error");
22 if (error != null) {
23 for(Element element : error.getChildren()) {
24 if (!element.getName().equals("text")) {
25 return element;
26 }
27 }
28 }
29 return null;
30 }
31}