orc.lib.net
Class XMPPConnection

java.lang.Object
  extended by orc.runtime.values.Value
      extended by orc.runtime.sites.Site
          extended by orc.runtime.sites.EvalSite
              extended by orc.lib.net.XMPPConnection
All Implemented Interfaces:
Callable, Future

public class XMPPConnection
extends EvalSite

Orc support for the XMPP (Jabber, Google Talk) messaging protocol.

For the most part, the API follows that of Smack. This example program should get you started:

 var (user, pass) = ("USER", "PASS")
 var talkto = "USER@gmail.com"
 site XMPPConnection = orc.lib.net.XMPPConnection
 val conn = XMPPConnection("talk.google.com", 5222, "gmail.com") >conn>
   conn.connect() >>
   conn.login(user, pass) >>
   conn
 conn.chat(talkto) >chat>
 chat.send("Are you there?") >>
 chat.receive()
 

WARNING: to talk to someone you must appear in their buddy list. Currently you will have to handle this manually before trying to talk to them using Orc.

I wish I could just use our Java sites to generate this automatically, but there are a few methods in the API which require asynchronous behavior and so must be implemented as Orc sites.

Author:
quark

Constructor Summary
XMPPConnection()
           
 
Method Summary
 Value evaluate(Args args)
           
 
Methods inherited from class orc.runtime.sites.EvalSite
callSite
 
Methods inherited from class orc.runtime.sites.Site
accept, createCall
 
Methods inherited from class orc.runtime.values.Value
forceArg, forceCall, head, isCons, isNil, isNone, isSome, signal, tail, untag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMPPConnection

public XMPPConnection()
Method Detail

evaluate

public Value evaluate(Args args)
               throws TokenException
Specified by:
evaluate in class EvalSite
Throws:
TokenException