org.littleshoot.commom.xmpp
Class ControlXmppP2PClient

java.lang.Object
  extended by org.littleshoot.commom.xmpp.ControlXmppP2PClient
All Implemented Interfaces:
org.lastbamboo.common.offer.answer.Offerer, org.lastbamboo.common.p2p.P2PClient<Socket>, org.lastbamboo.common.p2p.SocketFactory<Socket>, XmppP2PClient<Socket>

public class ControlXmppP2PClient
extends Object
implements XmppP2PClient<Socket>

Default implementation of an XMPP P2P client connection.


Method Summary
 void addConnectionListener(org.lastbamboo.common.p2p.P2PConnectionListener listener)
           
 void addMessageListener(org.jivesoftware.smack.MessageListener ml)
           
 org.jivesoftware.smack.XMPPConnection getXmppConnection()
           
 void handleClose()
           
 boolean isLoggedOut()
           
 String login(String user, String pass)
           
 String login(String user, String pass, String id)
           
 String login(String user, String pass, String serverHost, int serverPort, String serviceName)
           
 String login(String user, String pass, String serverHost, int serverPort, String serviceName, String id)
           
 String login(XmppCredentials creds)
           
 String login(XmppCredentials creds, String serverHost, int serverPort, String serviceName)
           
 void logout()
           
static ControlXmppP2PClient newClient(org.lastbamboo.common.offer.answer.OfferAnswerFactory<Socket> factory, InetSocketAddress plainTextRelayAddress, org.littleshoot.util.SessionSocketListener callSocketListener, int relayWait, org.littleshoot.util.PublicIp publicIp, SocketFactory socketFactory, String host, int port, String serviceName)
           
protected  org.jivesoftware.smack.packet.Message newError(org.jivesoftware.smack.packet.Message msg)
           
protected  org.jivesoftware.smack.packet.Message newError(String from, Long tid)
           
static ControlXmppP2PClient newGoogleTalkDirectClient(org.lastbamboo.common.offer.answer.OfferAnswerFactory<Socket> factory, InetSocketAddress plainTextRelayAddress, org.littleshoot.util.SessionSocketListener callSocketListener, int relayWait, org.littleshoot.util.PublicIp publicIp, SocketFactory socketFactory)
           
 Socket newRawSocket(URI uri)
           
 Socket newRawUnreliableSocket(URI uri)
           
 Socket newSocket(URI uri)
           
 Socket newUnreliableSocket(URI uri)
           
 void offer(URI uri, byte[] offer, org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener transactionListener, org.littleshoot.util.KeyStorage keyStorage)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newGoogleTalkDirectClient

public static ControlXmppP2PClient newGoogleTalkDirectClient(org.lastbamboo.common.offer.answer.OfferAnswerFactory<Socket> factory,
                                                             InetSocketAddress plainTextRelayAddress,
                                                             org.littleshoot.util.SessionSocketListener callSocketListener,
                                                             int relayWait,
                                                             org.littleshoot.util.PublicIp publicIp,
                                                             SocketFactory socketFactory)

newClient

public static ControlXmppP2PClient newClient(org.lastbamboo.common.offer.answer.OfferAnswerFactory<Socket> factory,
                                             InetSocketAddress plainTextRelayAddress,
                                             org.littleshoot.util.SessionSocketListener callSocketListener,
                                             int relayWait,
                                             org.littleshoot.util.PublicIp publicIp,
                                             SocketFactory socketFactory,
                                             String host,
                                             int port,
                                             String serviceName)

newSocket

public Socket newSocket(URI uri)
                 throws IOException,
                        org.lastbamboo.common.offer.answer.NoAnswerException
Specified by:
newSocket in interface org.lastbamboo.common.p2p.SocketFactory<Socket>
Throws:
IOException
org.lastbamboo.common.offer.answer.NoAnswerException

newUnreliableSocket

public Socket newUnreliableSocket(URI uri)
                           throws IOException,
                                  org.lastbamboo.common.offer.answer.NoAnswerException
Specified by:
newUnreliableSocket in interface org.lastbamboo.common.p2p.SocketFactory<Socket>
Throws:
IOException
org.lastbamboo.common.offer.answer.NoAnswerException

newRawSocket

public Socket newRawSocket(URI uri)
                    throws IOException,
                           org.lastbamboo.common.offer.answer.NoAnswerException
Specified by:
newRawSocket in interface org.lastbamboo.common.p2p.SocketFactory<Socket>
Throws:
IOException
org.lastbamboo.common.offer.answer.NoAnswerException

newRawUnreliableSocket

public Socket newRawUnreliableSocket(URI uri)
                              throws IOException,
                                     org.lastbamboo.common.offer.answer.NoAnswerException
Specified by:
newRawUnreliableSocket in interface org.lastbamboo.common.p2p.SocketFactory<Socket>
Throws:
IOException
org.lastbamboo.common.offer.answer.NoAnswerException

login

public String login(String user,
                    String pass)
             throws IOException,
                    CredentialException
Specified by:
login in interface org.lastbamboo.common.p2p.P2PClient<Socket>
Throws:
IOException
CredentialException

login

public String login(String user,
                    String pass,
                    String serverHost,
                    int serverPort,
                    String serviceName)
             throws IOException,
                    CredentialException
Specified by:
login in interface XmppP2PClient<Socket>
Throws:
IOException
CredentialException

login

public String login(String user,
                    String pass,
                    String id)
             throws IOException,
                    CredentialException
Specified by:
login in interface org.lastbamboo.common.p2p.P2PClient<Socket>
Throws:
IOException
CredentialException

login

public String login(String user,
                    String pass,
                    String serverHost,
                    int serverPort,
                    String serviceName,
                    String id)
             throws CredentialException,
                    IOException
Specified by:
login in interface XmppP2PClient<Socket>
Throws:
CredentialException
IOException

login

public String login(XmppCredentials creds)
             throws CredentialException,
                    IOException
Specified by:
login in interface XmppP2PClient<Socket>
Throws:
CredentialException
IOException

login

public String login(XmppCredentials creds,
                    String serverHost,
                    int serverPort,
                    String serviceName)
             throws CredentialException,
                    IOException
Specified by:
login in interface XmppP2PClient<Socket>
Throws:
CredentialException
IOException

offer

public void offer(URI uri,
                  byte[] offer,
                  org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener transactionListener,
                  org.littleshoot.util.KeyStorage keyStorage)
           throws IOException
Specified by:
offer in interface org.lastbamboo.common.offer.answer.Offerer
Throws:
IOException

newError

protected org.jivesoftware.smack.packet.Message newError(org.jivesoftware.smack.packet.Message msg)

newError

protected org.jivesoftware.smack.packet.Message newError(String from,
                                                         Long tid)

getXmppConnection

public org.jivesoftware.smack.XMPPConnection getXmppConnection()
Specified by:
getXmppConnection in interface XmppP2PClient<Socket>

addMessageListener

public void addMessageListener(org.jivesoftware.smack.MessageListener ml)
Specified by:
addMessageListener in interface XmppP2PClient<Socket>

logout

public void logout()
Specified by:
logout in interface org.lastbamboo.common.p2p.P2PClient<Socket>

addConnectionListener

public void addConnectionListener(org.lastbamboo.common.p2p.P2PConnectionListener listener)
Specified by:
addConnectionListener in interface org.lastbamboo.common.p2p.P2PClient<Socket>

isLoggedOut

public boolean isLoggedOut()
Specified by:
isLoggedOut in interface XmppP2PClient<Socket>

handleClose

public void handleClose()
Specified by:
handleClose in interface XmppP2PClient<Socket>

stop

public void stop()
Specified by:
stop in interface XmppP2PClient<Socket>


Copyright © 2014 LittleShoot. All Rights Reserved.