org.lastbamboo.common.p2p
Interface P2PClient<T>

All Superinterfaces:
org.lastbamboo.common.offer.answer.Offerer, SocketFactory<T>

public interface P2PClient<T>
extends SocketFactory<T>, org.lastbamboo.common.offer.answer.Offerer

General interface for P2P clients.


Method Summary
 void addConnectionListener(P2PConnectionListener listener)
          Adds a listener for changes to the state of p2p connections.
 String login(String user, String password)
          Logs in to the server.
 String login(String user, String password, String id)
          Logs in to the server.
 void logout()
          Logs out the currently logged in user.
 
Methods inherited from interface org.lastbamboo.common.p2p.SocketFactory
newRawSocket, newRawUnreliableSocket, newSocket, newUnreliableSocket
 
Methods inherited from interface org.lastbamboo.common.offer.answer.Offerer
offer
 

Method Detail

login

String login(String user,
             String password)
             throws IOException,
                    CredentialException
Logs in to the server.

Parameters:
user - The user name.
password - The password.
Returns:
The JID of the logged in user.
Throws:
IOException - If we could not log in.
CredentialException - If the credentials are wrong.

login

String login(String user,
             String password,
             String id)
             throws IOException,
                    CredentialException
Logs in to the server.

Parameters:
user - The user name.
password - The password.
id - An ID to use to identify this logged-in instance.
Returns:
The JID of the logged in user.
Throws:
IOException - If we could not log in.
CredentialException - If the credentials are wrong.

logout

void logout()
Logs out the currently logged in user.


addConnectionListener

void addConnectionListener(P2PConnectionListener listener)
Adds a listener for changes to the state of p2p connections.

Parameters:
listener - The listener to add.


Copyright © 2013 LittleShoot. All Rights Reserved.