Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.yahoo
Class ProtocolProviderServiceYahooImpl

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

public class ProtocolProviderServiceYahooImpl
extends AbstractProtocolProviderService

An implementation of the protocol provider service over the Yahoo protocol

Author:
Damian Minkov

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.ProtocolProviderService
BIND_RETRIES_DEFAULT_VALUE, BIND_RETRIES_PROPERTY_NAME
 
Constructor Summary
ProtocolProviderServiceYahooImpl()
           
 
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.
 ProtocolIcon getProtocolIcon()
          Returns the yahoo protocol icon.
 String getProtocolName()
          Returns the short name of the protocol that the implementation of this provider is based upon (like SIP, Msn, 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.
(package private)  YahooSession getYahooSession()
          Returns the YahooSessionopened by this provider
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.
 void register(SecurityAuthority authority)
          Starts the registration process.
(package private)  void reregister(int reasonCode)
          Reconnects if fails fire connection failed.
 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.
(package private)  void unregister(boolean fireEvent)
          Unregister and fire the event if requested
 
Methods inherited from class net.java.sip.communicator.service.protocol.AbstractProtocolProviderService
addRegistrationStateChangeListener, addSupportedOperationSet, clearRegistrationStateChangeListener, getOperationSet, getProtocolDisplayName, 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
 

Constructor Detail

ProtocolProviderServiceYahooImpl

public ProtocolProviderServiceYahooImpl()
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).

reregister

void reregister(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.


unregister

void unregister(boolean fireEvent)
Unregister and fire the event if requested

Parameters:
fireEvent - boolean

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, Msn, ICQ/AIM, or others for example).

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

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.

getYahooSession

YahooSession getYahooSession()
Returns the YahooSessionopened by this provider

Returns:
a reference to the Session last opened 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.

getProtocolIcon

public ProtocolIcon getProtocolIcon()
Returns the yahoo protocol icon.

Returns:
the yahoo protocol icon

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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