org.littleshoot.commom.xmpp
Class ControlEndpointXmppP2PClient
java.lang.Object
org.littleshoot.commom.xmpp.ControlEndpointXmppP2PClient
- All Implemented Interfaces:
- org.lastbamboo.common.offer.answer.Offerer, org.lastbamboo.common.p2p.P2PClient<org.littleshoot.util.FiveTuple>, org.lastbamboo.common.p2p.SocketFactory<org.littleshoot.util.FiveTuple>, XmppP2PClient<org.littleshoot.util.FiveTuple>
public class ControlEndpointXmppP2PClient
- extends Object
- implements XmppP2PClient<org.littleshoot.util.FiveTuple>
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 ControlEndpointXmppP2PClient |
newClient(org.lastbamboo.common.offer.answer.OfferAnswerFactory<org.littleshoot.util.FiveTuple> factory,
org.lastbamboo.common.offer.answer.OfferAnswerFactory<Socket> socketAnswerFactory,
InetSocketAddress plainTextRelayAddress,
org.littleshoot.util.SessionSocketListener callSocketListener,
int relayWait,
org.littleshoot.util.PublicIp publicIp,
SocketFactory socketFactory,
String host,
int port,
String serviceName,
org.lastbamboo.common.offer.answer.OfferAnswerListener<org.littleshoot.util.FiveTuple> answererListener)
|
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 ControlEndpointXmppP2PClient |
newGoogleTalkDirectClient(org.lastbamboo.common.offer.answer.OfferAnswerFactory<org.littleshoot.util.FiveTuple> factory,
org.lastbamboo.common.offer.answer.OfferAnswerFactory<Socket> socketAnswerFactory,
InetSocketAddress plainTextRelayAddress,
org.littleshoot.util.SessionSocketListener callSocketListener,
int relayWait,
org.littleshoot.util.PublicIp publicIp,
SocketFactory socketFactory,
org.lastbamboo.common.offer.answer.OfferAnswerListener<org.littleshoot.util.FiveTuple> answererListener)
|
org.littleshoot.util.FiveTuple |
newRawSocket(URI uri)
|
org.littleshoot.util.FiveTuple |
newRawUnreliableSocket(URI uri)
|
org.littleshoot.util.FiveTuple |
newSocket(URI uri)
|
org.littleshoot.util.FiveTuple |
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 |
newGoogleTalkDirectClient
public static ControlEndpointXmppP2PClient newGoogleTalkDirectClient(org.lastbamboo.common.offer.answer.OfferAnswerFactory<org.littleshoot.util.FiveTuple> factory,
org.lastbamboo.common.offer.answer.OfferAnswerFactory<Socket> socketAnswerFactory,
InetSocketAddress plainTextRelayAddress,
org.littleshoot.util.SessionSocketListener callSocketListener,
int relayWait,
org.littleshoot.util.PublicIp publicIp,
SocketFactory socketFactory,
org.lastbamboo.common.offer.answer.OfferAnswerListener<org.littleshoot.util.FiveTuple> answererListener)
newClient
public static ControlEndpointXmppP2PClient newClient(org.lastbamboo.common.offer.answer.OfferAnswerFactory<org.littleshoot.util.FiveTuple> factory,
org.lastbamboo.common.offer.answer.OfferAnswerFactory<Socket> socketAnswerFactory,
InetSocketAddress plainTextRelayAddress,
org.littleshoot.util.SessionSocketListener callSocketListener,
int relayWait,
org.littleshoot.util.PublicIp publicIp,
SocketFactory socketFactory,
String host,
int port,
String serviceName,
org.lastbamboo.common.offer.answer.OfferAnswerListener<org.littleshoot.util.FiveTuple> answererListener)
newSocket
public org.littleshoot.util.FiveTuple newSocket(URI uri)
throws IOException,
org.lastbamboo.common.offer.answer.NoAnswerException
- Specified by:
newSocket in interface org.lastbamboo.common.p2p.SocketFactory<org.littleshoot.util.FiveTuple>
- Throws:
IOException
org.lastbamboo.common.offer.answer.NoAnswerException
newUnreliableSocket
public org.littleshoot.util.FiveTuple newUnreliableSocket(URI uri)
throws IOException,
org.lastbamboo.common.offer.answer.NoAnswerException
- Specified by:
newUnreliableSocket in interface org.lastbamboo.common.p2p.SocketFactory<org.littleshoot.util.FiveTuple>
- Throws:
IOException
org.lastbamboo.common.offer.answer.NoAnswerException
newRawSocket
public org.littleshoot.util.FiveTuple newRawSocket(URI uri)
throws IOException,
org.lastbamboo.common.offer.answer.NoAnswerException
- Specified by:
newRawSocket in interface org.lastbamboo.common.p2p.SocketFactory<org.littleshoot.util.FiveTuple>
- Throws:
IOException
org.lastbamboo.common.offer.answer.NoAnswerException
newRawUnreliableSocket
public org.littleshoot.util.FiveTuple newRawUnreliableSocket(URI uri)
throws IOException,
org.lastbamboo.common.offer.answer.NoAnswerException
- Specified by:
newRawUnreliableSocket in interface org.lastbamboo.common.p2p.SocketFactory<org.littleshoot.util.FiveTuple>
- 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<org.littleshoot.util.FiveTuple>
- 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<org.littleshoot.util.FiveTuple>
- 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<org.littleshoot.util.FiveTuple>
- 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<org.littleshoot.util.FiveTuple>
- Throws:
CredentialException
IOException
login
public String login(XmppCredentials creds)
throws CredentialException,
IOException
- Specified by:
login in interface XmppP2PClient<org.littleshoot.util.FiveTuple>
- Throws:
CredentialException
IOException
login
public String login(XmppCredentials creds,
String serverHost,
int serverPort,
String serviceName)
throws CredentialException,
IOException
- Specified by:
login in interface XmppP2PClient<org.littleshoot.util.FiveTuple>
- 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<org.littleshoot.util.FiveTuple>
addMessageListener
public void addMessageListener(org.jivesoftware.smack.MessageListener ml)
- Specified by:
addMessageListener in interface XmppP2PClient<org.littleshoot.util.FiveTuple>
logout
public void logout()
- Specified by:
logout in interface org.lastbamboo.common.p2p.P2PClient<org.littleshoot.util.FiveTuple>
addConnectionListener
public void addConnectionListener(org.lastbamboo.common.p2p.P2PConnectionListener listener)
- Specified by:
addConnectionListener in interface org.lastbamboo.common.p2p.P2PClient<org.littleshoot.util.FiveTuple>
isLoggedOut
public boolean isLoggedOut()
- Specified by:
isLoggedOut in interface XmppP2PClient<org.littleshoot.util.FiveTuple>
handleClose
public void handleClose()
- Specified by:
handleClose in interface XmppP2PClient<org.littleshoot.util.FiveTuple>
stop
public void stop()
- Specified by:
stop in interface XmppP2PClient<org.littleshoot.util.FiveTuple>
Copyright © 2014 LittleShoot. All Rights Reserved.