|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.mn.communicator.DefaultConnectionService
public class DefaultConnectionService
The default implementation of IConnectionService.
Created on 2004-11-27
| Constructor Summary | |
|---|---|
DefaultConnectionService(Session session)
|
|
| 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)
|
protected void |
notifyConnectionClosed()
|
protected void |
notifyConnectionError(java.lang.Exception ex)
|
protected void |
notifyConnectionEstablished()
|
protected void |
notifyPacketReceived(GGIncomingPackage incomingPackage)
|
protected void |
notifyPacketSent(GGOutgoingPackage outgoingPackage)
|
protected void |
notifyPingSent()
|
protected void |
notifyPongReceived()
|
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)
|
protected void |
sendPackage(GGOutgoingPackage outgoingPackage)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
DefaultConnectionService(Session session)
| Method Detail |
|---|
public IServer lookupServer(int uin)
throws GGException
lookupServer in interface IConnectionServiceGGExceptionpl.mn.communicator.IConnectionService#getServer(int)
public void connect(IServer server)
throws GGException
IConnectionServiceSession instance.
connect in interface IConnectionServiceGGException - if error occurs while connecting to Gadu-Gadu server.
GGSessionException - if there is an incorrect session state.pl.mn.communicator.IConnectionService#connect()
public void disconnect()
throws GGException
IConnectionService
disconnect in interface IConnectionServiceGGSessionException - if there is an incorrect session state.
GGExceptionIConnectionService.disconnect()public boolean isConnected()
IConnectionService
isConnected in interface IConnectionServiceIConnectionService.isConnected()public IServer getServer()
IConnectionService
getServer in interface IConnectionServiceIConnectionService.getServer()public void addConnectionListener(ConnectionListener connectionListener)
IConnectionServiceConnectionListener object to the list
of listeners that will receive notification of connection
related events.
addConnectionListener in interface IConnectionServiceconnectionListener - that will be added to the list of connection listeners.IConnectionService.addConnectionListener(pl.mn.communicator.event.ConnectionListener)public void removeConnectionListener(ConnectionListener connectionListener)
IConnectionServiceConnectionListener object from the list
that will receive notification of connection related events.
The listener will no longer be notified of connection related events.
removeConnectionListener in interface IConnectionServiceconnectionListener - that will be removed from the list of connection listeners.IConnectionService.removeConnectionListener(pl.mn.communicator.event.ConnectionListener)public void addPacketListener(GGPacketListener packetListener)
IConnectionServiceGGPacketListener object to the list of listeners
that will be notified of Gadu-Gadu packet related events.
addPacketListener in interface IConnectionServicepacketListener - that will be added to the list of packet listeners.IConnectionService.addPacketListener(pl.mn.communicator.event.GGPacketListener)public void removePacketListener(GGPacketListener packetListener)
IConnectionServiceGGPacketListener object from the list of listeners
that will be notified of Gadu-Gadu packet related events.
removePacketListener in interface IConnectionServicepacketListener - that will be removed from the list of packet listeners.IConnectionService.removePacketListener(pl.mn.communicator.event.GGPacketListener)public void addPingListener(PingListener pingListener)
addPingListener in interface IConnectionServiceIConnectionService.addPingListener(pl.mn.communicator.event.PingListener)public void removePingListener(PingListener pingListener)
removePingListener in interface IConnectionServiceIConnectionService.removePingListener(pl.mn.communicator.event.PingListener)
protected void notifyConnectionEstablished()
throws GGException
GGException
protected void notifyConnectionClosed()
throws GGException
GGException
protected void notifyConnectionError(java.lang.Exception ex)
throws GGException
GGExceptionprotected void notifyPingSent()
protected void notifyPongReceived()
protected void notifyPacketReceived(GGIncomingPackage incomingPackage)
protected void notifyPacketSent(GGOutgoingPackage outgoingPackage)
protected void sendPackage(GGOutgoingPackage outgoingPackage)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||