Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.icq
Class ProtocolProviderServiceIcqImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AbstractProtocolProviderService
      extended by net.java.sip.communicator.impl.protocol.icq.ProtocolProviderServiceIcqImpl
All Implemented Interfaces:
ProtocolProviderService

public class ProtocolProviderServiceIcqImpl
extends AbstractProtocolProviderService

An implementation of the protocol provider service over the AIM/ICQ protocol

Author:
Emil Ivov, Damian Minkov, Valentin Martinet

Nested Class Summary
static class ProtocolProviderServiceIcqImpl.AimConversationListener
           
static class ProtocolProviderServiceIcqImpl.AimIcbmListener
          Message listener.
static class ProtocolProviderServiceIcqImpl.ConnectionClosedListener
          Fix for late close connection due to multiple logins.
 
Field Summary
(package private)  boolean USING_ICQ
          Property whether we are using AIM or ICQ service
 
Fields inherited from interface net.java.sip.communicator.service.protocol.ProtocolProviderService
BIND_RETRIES_DEFAULT_VALUE, BIND_RETRIES_PROPERTY_NAME
 
Constructor Summary
ProtocolProviderServiceIcqImpl()
           
 
Method Summary
 void fireRegistrationStateChanged(RegistrationState oldState, RegistrationState newState, int reasonCode, String reason)
          Creates a RegistrationStateChange event corresponding to the specified old and new states and notifies all currently registered listeners.
 AccountID getAccountID()
          Returns the AccountID that uniquely identifies the account represented by this instance of the ProtocolProviderService.
protected  net.kano.joustsim.oscar.AimConnection getAimConnection()
          Returns the AimConnectionopened by this provider
protected  net.kano.joustsim.oscar.AimSession getAimSession()
          Returns the AimSession opened by this provider.
protected  InfoRetreiver getInfoRetreiver()
          Returns the info retriever that we've initialized for the current session.
 String getProtocolDisplayName()
          Returns the protocol display name.
 ProtocolIcon getProtocolIcon()
          Returns the icq/aim protocol icon.
 String getProtocolName()
          Returns the short name of the protocol that the implementation of this provider is based upon (like SIP, Jabber, ICQ/AIM, or others for example).
 RegistrationState getRegistrationState()
          Returns the state of the registration of this protocol provider
 TransportProtocol getTransportProtocol()
          Returns the "transport" protocol of this instance used to carry the control channel for the current protocol service.
protected  void initialize(String screenname, AccountID accountID)
          Initialized the service implementation, and puts it in a sate where it could interoperate with other services.
 boolean isInitialized()
          Returns true if the provider service implementation is initialized and ready for use by other services, and false otherwise.
 boolean isSignalingTransportSecure()
          Indicate if the signaling transport of this protocol instance uses a secure (e.g.
(package private)  void reconnect(int reasonCode)
          Reconnects if fails fire connection failed.
 void register(SecurityAuthority authority)
          Starts the registration process.
 void shutdown()
          Makes the service implementation close all open sockets and release any resources that it might have taken and prepare for shutdown/garbage collection.
 void unregister()
          Ends the registration of this protocol provider with the service.
 
Methods inherited from class net.java.sip.communicator.service.protocol.AbstractProtocolProviderService
addRegistrationStateChangeListener, addSupportedOperationSet, clearRegistrationStateChangeListener, getOperationSet, getSupportedOperationSets, isRegistered, removeRegistrationStateChangeListener, removeSupportedOperationSet, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.protocol.ProtocolProviderService
hashCode
 

Field Detail

USING_ICQ

boolean USING_ICQ
Property whether we are using AIM or ICQ service

Constructor Detail

ProtocolProviderServiceIcqImpl

public ProtocolProviderServiceIcqImpl()
Method Detail

getRegistrationState

public RegistrationState getRegistrationState()
Returns the state of the registration of this protocol provider

Returns:
the RegistrationState that this provider is currently in or null in case it is in a unknown state.

register

public void register(SecurityAuthority authority)
              throws OperationFailedException
Starts the registration process. Connection details such as registration server, user name/number are provided through the configuration service through implementation specific properties.

Parameters:
authority - the security authority that will be used for resolving any security challenges that may be returned during the registration or at any moment while wer're registered.
Throws:
OperationFailedException - with the corresponding code it the registration fails for some reason (e.g. a networking error or an implementation problem).

reconnect

void reconnect(int reasonCode)
Reconnects if fails fire connection failed.

Parameters:
reasonCode - the appropriate SecurityAuthority reasonCode, which would specify the reason for which we're re-calling the login.

unregister

public void unregister()
Ends the registration of this protocol provider with the service.


isSignalingTransportSecure

public boolean isSignalingTransportSecure()
Description copied from interface: ProtocolProviderService
Indicate if the signaling transport of this protocol instance uses a secure (e.g. via TLS) connection.

Returns:
True when the connection is secured, false otherwise.

getTransportProtocol

public TransportProtocol getTransportProtocol()
Returns the "transport" protocol of this instance used to carry the control channel for the current protocol service.

Returns:
The "transport" protocol of this instance: TCP.

getProtocolName

public String getProtocolName()
Returns the short name of the protocol that the implementation of this provider is based upon (like SIP, Jabber, ICQ/AIM, or others for example).

Returns:
a String containing the short name of the protocol this service is taking care of.

getProtocolDisplayName

public String getProtocolDisplayName()
Returns the protocol display name. This is the name that would be used by the GUI to display the protocol name.

Specified by:
getProtocolDisplayName in interface ProtocolProviderService
Overrides:
getProtocolDisplayName in class AbstractProtocolProviderService
Returns:
a String containing the display name of the protocol this service is implementing

initialize

protected void initialize(String screenname,
                          AccountID accountID)
Initialized the service implementation, and puts it in a sate where it could interoperate with other services. It is strongly recomended that properties in this Map be mapped to property names as specified by AccountProperties.

Parameters:
screenname - the account id/uin/screenname of the account that we're about to create
accountID - the identifier of the account that this protocol provider represents.
See Also:
AccountID

shutdown

public void shutdown()
Makes the service implementation close all open sockets and release any resources that it might have taken and prepare for shutdown/garbage collection.


isInitialized

public boolean isInitialized()
Returns true if the provider service implementation is initialized and ready for use by other services, and false otherwise.

Returns:
true if the provider is initialized and ready for use and false otherwise

getAccountID

public AccountID getAccountID()
Returns the AccountID that uniquely identifies the account represented by this instance of the ProtocolProviderService.

Returns:
the id of the account represented by this provider.

fireRegistrationStateChanged

public void fireRegistrationStateChanged(RegistrationState oldState,
                                         RegistrationState newState,
                                         int reasonCode,
                                         String reason)
Creates a RegistrationStateChange event corresponding to the specified old and new states and notifies all currently registered listeners.

Overrides:
fireRegistrationStateChanged in class AbstractProtocolProviderService
Parameters:
oldState - the state that the provider had before the change occurred
newState - the state that the provider is currently in.
reasonCode - a value corresponding to one of the REASON_XXX fields of the RegistrationStateChangeEvent class, indicating the reason for this state transition.
reason - a String further explaining the reason code or null if no such explanation is necessary.

getInfoRetreiver

protected InfoRetreiver getInfoRetreiver()
Returns the info retriever that we've initialized for the current session.

Returns:
the info retriever that we've initialized for the current session.

getAimSession

protected net.kano.joustsim.oscar.AimSession getAimSession()
Returns the AimSession opened by this provider.

Returns:
a reference to the AimSession that this provider last opened.

getAimConnection

protected net.kano.joustsim.oscar.AimConnection getAimConnection()
Returns the AimConnectionopened by this provider

Returns:
a reference to the AimConnection last opened by this provider.

getProtocolIcon

public ProtocolIcon getProtocolIcon()
Returns the icq/aim protocol icon.

Returns:
the icq/aim protocol icon

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.