Revision 3952,
1.5 KB
checked in by alexandrecorreia, 13 years ago
(diff) |
Ticket #1710 - Adicao do codigo fonte java do componente jmessenger(jabberit_messenger)
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[3952] | 1 | package nu.fw.jeti.jabber.elements; |
---|
| 2 | |
---|
| 3 | import java.util.LinkedList; |
---|
| 4 | import nu.fw.jeti.jabber.*; |
---|
| 5 | |
---|
| 6 | /** |
---|
| 7 | * <p>Title: im</p> |
---|
| 8 | * <p>Description: </p> |
---|
| 9 | * <p>Copyright: Copyright (c) 2001</p> |
---|
| 10 | * <p>Company: </p> |
---|
| 11 | * @author E.S. de Boer |
---|
| 12 | * @version 1.0 |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | public abstract class PacketBuilder |
---|
| 16 | { |
---|
| 17 | public JID to; |
---|
| 18 | public JID from; |
---|
| 19 | public String id; |
---|
| 20 | public int errorCode; |
---|
| 21 | public String errorDescription; |
---|
| 22 | private String type; |
---|
| 23 | public XMPPError xmppError; |
---|
| 24 | private LinkedList extensions; |
---|
| 25 | |
---|
| 26 | public void reset() |
---|
| 27 | { |
---|
| 28 | to = null; |
---|
| 29 | from = null; |
---|
| 30 | id = null; |
---|
| 31 | extensions = null; |
---|
| 32 | errorCode = 0; |
---|
| 33 | xmppError=null; |
---|
| 34 | type=null; |
---|
| 35 | errorDescription = null; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | public void setTo(JID to){this.to =to;} |
---|
| 39 | public void setFrom(JID from){this.from =from;} |
---|
| 40 | public void setId(String id){this.id =id;} |
---|
| 41 | public void setErrorType(String type){this.type =type;} |
---|
| 42 | public void setErrorCode(int errorCode){this.errorCode =errorCode;} |
---|
| 43 | public void setErrorDescription(String errorDescription){this.errorDescription = errorDescription;} |
---|
| 44 | |
---|
| 45 | public void addExtension(Extension extension) |
---|
| 46 | { |
---|
| 47 | if(extension == null) return; |
---|
| 48 | if(extension instanceof XMPPErrorTag) |
---|
| 49 | { |
---|
| 50 | if(xmppError==null)xmppError=new XMPPError(type,errorCode); |
---|
| 51 | xmppError.addError((XMPPErrorTag)extension); |
---|
| 52 | } |
---|
| 53 | else |
---|
| 54 | { |
---|
| 55 | if(extensions == null) extensions = new LinkedList(); |
---|
| 56 | extensions.add(extension); |
---|
| 57 | } |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | public LinkedList getExtensions() |
---|
| 61 | { |
---|
| 62 | return extensions; |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | abstract public Packet build() throws InstantiationException; |
---|
| 66 | } |
---|
| 67 | /* |
---|
| 68 | * Overrides for emacs |
---|
| 69 | * Local variables: |
---|
| 70 | * tab-width: 4 |
---|
| 71 | * End: |
---|
| 72 | */ |
---|
Note: See
TracBrowser
for help on using the repository browser.