pl.mn.communicator
Interface IConnectionService

All Known Implementing Classes:
DefaultConnectionService

public interface IConnectionService

The client should use this interface if there is a need to connect to Gadu-Gadu server or disconnect from it. Also client can register itself as a listener for the connection related events.

Created on 2004-11-27

Version:
$Id: IConnectionService.java,v 1.1 2005/11/05 23:34:52 winnetou25 Exp $
Author:
Mateusz Szczap
See Also:
ConnectionListener

Method Summary
 void addConnectionListener(ConnectionListener connectionListener)
          Adds ConnectionListener object to the list of listeners that will receive notification of connection related events.
 void addPacketListener(GGPacketListener packetListener)
          Adds GGPacketListener object to the list of listeners that will be notified of Gadu-Gadu packet related events.
 void addPingListener(PingListener pingListener)
           
 void connect(IServer server)
          Tries to connect to Gadu-Gadu server that has been previously assigned to Session instance.
 void disconnect()
          Tries to close the connection to the Gadu-Gadu server.
 IServer getServer()
          Get server user is currently connected to, returns null if user is not connected to any server.
 boolean isConnected()
          Method to check if we are connected or not.
 IServer lookupServer(int uin)
           
 void removeConnectionListener(ConnectionListener connectionListener)
          Remove ConnectionListener object from the list that will receive notification of connection related events.
 void removePacketListener(GGPacketListener packetListener)
          Remove GGPacketListener object from the list of listeners that will be notified of Gadu-Gadu packet related events.
 void removePingListener(PingListener pingListener)
           
 

Method Detail

lookupServer

IServer lookupServer(int uin)
                     throws GGException
Throws:
GGException

connect

void connect(IServer server)
             throws GGException
Tries to connect to Gadu-Gadu server that has been previously assigned to Session instance.

Throws:
GGException - if error occurs while connecting to Gadu-Gadu server.
GGSessionException - if there is an incorrect session state.

disconnect

void disconnect()
                throws GGException
Tries to close the connection to the Gadu-Gadu server.

Throws:
GGSessionException - if there is an incorrect session state.
GGException

isConnected

boolean isConnected()
Method to check if we are connected or not.

Returns:
boolean indicating whether we are connected or not.

getServer

IServer getServer()
Get server user is currently connected to, returns null if user is not connected to any server.

Returns:

addConnectionListener

void addConnectionListener(ConnectionListener connectionListener)
Adds ConnectionListener object to the list of listeners that will receive notification of connection related events.

Parameters:
connectionListener - that will be added to the list of connection listeners.
Throws:
java.lang.NullPointerException - if the ConnectionListener object is null.
See Also:
ConnectionListener

removeConnectionListener

void removeConnectionListener(ConnectionListener connectionListener)
Remove ConnectionListener object from the list that will receive notification of connection related events. The listener will no longer be notified of connection related events.

Parameters:
connectionListener - that will be removed from the list of connection listeners.
Throws:
java.lang.NullPointerException - if the ConnectionListener objct is null.
See Also:
ConnectionListener

addPacketListener

void addPacketListener(GGPacketListener packetListener)
Adds GGPacketListener object to the list of listeners that will be notified of Gadu-Gadu packet related events.

Parameters:
packetListener - that will be added to the list of packet listeners.
Throws:
java.lang.NullPointerException - if the GGPacketListener instance is null.
See Also:
GGPacketListener

removePacketListener

void removePacketListener(GGPacketListener packetListener)
Remove GGPacketListener object from the list of listeners that will be notified of Gadu-Gadu packet related events.

Parameters:
packetListener - that will be removed from the list of packet listeners.
Throws:
java.lang.NullPointerException - if the GGPacketListener instance is null.
See Also:
GGPacketListener

addPingListener

void addPingListener(PingListener pingListener)

removePingListener

void removePingListener(PingListener pingListener)


Copyright 2004-2004-2005 SourceForge.net. All Rights Reserved.