|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
net.sourceforge.jxa.Jxa
public class Jxa
J2ME XMPP API Class
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Jxa(java.lang.String host,
java.lang.String port,
java.lang.String username,
java.lang.String password,
java.lang.String resource,
int priority)
If you create this object all variables will be saved and the method run() is started to log in on jabber server and
listen to parse incomming xml stanzas. |
Method Summary | |
---|---|
void |
addListener(XmppListener xl)
Add a XmppListener to listen for events. |
void |
getRoster()
Sends a roster query. |
void |
login()
Opens the connection with a stream-tag, queries authentication type and sends authentication data, which is username, password and resource. |
void |
logoff()
Closes the stream-tag and the XmlWriter . |
void |
removeListener(XmppListener xl)
Remove a XmppListener from this class. |
void |
run()
The run method is called when Jxa object is
created. |
void |
saveContact(java.lang.String jid,
java.lang.String name,
java.util.Enumeration group,
java.lang.String subscription)
Save a contact to roster. |
void |
sendMessage(java.lang.String to,
java.lang.String msg)
Sends a message text to a known jid. |
void |
sendThinkRequest(java.lang.String to,
java.lang.String from,
java.lang.String pic,
java.lang.String thinkword)
This methods sends a ThinkRequest from the initiator to the recipient |
void |
sendThinkRespond(java.lang.String to,
java.lang.String from,
java.lang.String word1,
java.lang.String word2,
java.lang.String word3)
This message is used by the recipient to send a response to the initiator of the ThinkRequest |
void |
setStatus(java.lang.String show,
java.lang.String status,
int priority)
Sets your Jabber Status. |
void |
subscribe(java.lang.String to)
Requesting a subscription. |
void |
subscribed(java.lang.String to)
Approve a subscription request. |
void |
unsubscribe(java.lang.String to)
Remove a subscription. |
void |
unsubscribed(java.lang.String to)
Refuse/Reject a subscription request. |
Methods inherited from class java.lang.Thread |
---|
activeCount, currentThread, getName, getPriority, interrupt, isAlive, join, setPriority, sleep, start, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Jxa(java.lang.String host, java.lang.String port, java.lang.String username, java.lang.String password, java.lang.String resource, int priority)
run()
is started to log in on jabber server and
listen to parse incomming xml stanzas. Use
addListener(XmppListener xl)
to listen to events of this object.
host
- the hostname/ip of the jabber serverport
- the port number of the jabber serverusername
- the username of the jabber accountpassword
- the passwort of the jabber accountresource
- a unique identifier of the used resource, for e.g. "mobile"priority
- the priority of the jabber session, defines on which
resource the messages arriveMethod Detail |
---|
public void run()
run
method is called when Jxa
object is
created. It sets up the reader and writer, calls login()
methode and listens on the reader to parse incomming xml stanzas.
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void addListener(XmppListener xl)
XmppListener
to listen for events.
xl
- a XmppListener objectpublic void removeListener(XmppListener xl)
XmppListener
from this class.
xl
- a XmppListener objectpublic void login() throws java.io.IOException
java.io.IOException
- is thrown if XmlReader
or XmlWriter
throw an IOException.public void logoff()
XmlWriter
.
public void sendMessage(java.lang.String to, java.lang.String msg)
to
- the JID of the recipientmsg
- the message itselfpublic void setStatus(java.lang.String show, java.lang.String status, int priority)
show
- is one of the following: null
, chat, away,
dnd, xa, invisiblestatus
- an extended text describing the actual statuspriority
- the priority number (5 should be default)public void subscribe(java.lang.String to)
to
- the jid you want to subscribepublic void unsubscribe(java.lang.String to)
to
- the jid you want to remove your subscriptionpublic void subscribed(java.lang.String to)
to
- the jid that sent you a subscription requestpublic void unsubscribed(java.lang.String to)
to
- the jid that sent you a subscription requestpublic void saveContact(java.lang.String jid, java.lang.String name, java.util.Enumeration group, java.lang.String subscription)
jid
- the jid of the contactname
- the nickname of the contactgroup
- the group of the contactsubscription
- the subscription of the contactpublic void getRoster() throws java.io.IOException
java.io.IOException
- is thrown if XmlReader
or XmlWriter
throw an IOException.public void sendThinkRequest(java.lang.String to, java.lang.String from, java.lang.String pic, java.lang.String thinkword) throws java.io.IOException
to
- the address of the recipientfrom
- the address of the initiatorpic
- the picture represented as a Base64 encoded stringthinkword
- TheWord
java.io.IOException
- in case of sending failurepublic void sendThinkRespond(java.lang.String to, java.lang.String from, java.lang.String word1, java.lang.String word2, java.lang.String word3) throws java.io.IOException
to
- address of initiatorfrom
- address of recipiontword1
- .word2
- .word3
- .
java.io.IOException
- on problems sending
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |