Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class ProtocolProviderFactorySipImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.ProtocolProviderFactory
      extended by net.java.sip.communicator.impl.protocol.sip.ProtocolProviderFactorySipImpl

public class ProtocolProviderFactorySipImpl
extends ProtocolProviderFactory

A SIP implementation of the protocol provider factory interface.

Author:
Emil Ivov

Field Summary
 
Fields inherited from class net.java.sip.communicator.service.protocol.ProtocolProviderFactory
ACCOUNT_DISPLAY_NAME, ACCOUNT_ICON_PATH, ACCOUNT_UID, AUTHORIZATION_NAME, AUTO_CHANGE_USER_NAME, AUTO_DISCOVER_JINGLE_NODES, AUTO_DISCOVER_STUN, AUTO_GENERATE_RESOURCE, CLIENT_TLS_CERTIFICATE, DEFAULT_ENCRYPTION, DEFAULT_SIPZRTP_ATTRIBUTE, DISPLAY_NAME, FORCE_P2P_MODE, FORCE_PROXY_BYPASS, IS_ACCOUNT_DISABLED, IS_ALLOW_NON_SECURE, IS_CALLING_DISABLED_FOR_ACCOUNT, IS_DESKTOP_STREAMING_DISABLED, IS_PREFERRED_PROTOCOL, IS_PRESENCE_ENABLED, IS_PROTOCOL_HIDDEN, IS_SERVER_OVERRIDDEN, IS_USE_GOOGLE_ICE, IS_USE_ICE, IS_USE_JINGLE_NODES, IS_USE_UPNP, KEEP_ALIVE_INTERVAL, KEEP_ALIVE_METHOD, NO_PASSWORD_REQUIRED, PASSWORD, POLLING_PERIOD, PREFERRED_CLEAR_PORT_PROPERTY_NAME, PREFERRED_SECURE_PORT_PROPERTY_NAME, PREFERRED_TRANSPORT, PROTOCOL, PROTOCOL_ICON_PATH, PROXY_ADDRESS, PROXY_ADDRESS_VALIDATED, PROXY_AUTO_CONFIG, PROXY_PASSWORD, PROXY_PORT, PROXY_TRANSPORT, PROXY_TYPE, PROXY_USERNAME, registeredAccounts, RESOURCE, RESOURCE_PRIORITY, SAVP_MANDATORY, SAVP_OFF, SAVP_OPTION, SAVP_OPTIONAL, SDES_CIPHER_SUITES, SDES_ENABLED, SERVER_ADDRESS, SERVER_ADDRESS_VALIDATED, SERVER_PORT, SERVER_TRANSPORT, SMS_SERVER_ADDRESS, STRATEGY, STUN_ADDRESS, STUN_IS_TURN_SUPPORTED, STUN_PASSWORD, STUN_PORT, STUN_PREFIX, STUN_USERNAME, SUBSCRIPTION_EXPIRATION, USE_DEFAULT_STUN_SERVER, USER_ID, VOICEMAIL_URI
 
Constructor Summary
ProtocolProviderFactorySipImpl()
          Constructs a new instance of the ProtocolProviderFactorySipImpl.
 
Method Summary
protected  AccountID createAccountID(String userID, Map<String,String> accountProperties)
          Creates a new SipAccountID instance with a specific user ID to represent a given set of account properties.
protected  ProtocolProviderService createService(String userID, AccountID accountID)
          Initializes a new ProtocolProviderServiceSipImpl instance with a specific user ID to represent a specific AccountID.
 AccountID installAccount(String userIDStr, Map<String,String> accountProperties)
          Initializes and creates an account corresponding to the specified accountProperties and registers the resulting ProtocolProvider in the context BundleContext parameter.
 void modifyAccount(ProtocolProviderService protocolProvider, Map<String,String> accountProperties)
          Modifies the account corresponding to the specified accountID.
protected  void storeAccount(AccountID accountID)
          Ovverides the original in order not to save the XCAP_PASSWORD field.
 
Methods inherited from class net.java.sip.communicator.service.protocol.ProtocolProviderFactory
createAccount, findAccountPrefix, getBundleContext, getProtocolName, getProviderForAccount, getRegisteredAccounts, loadAccount, loadAccount, loadPassword, loadPassword, removeStoredAccount, stop, stop, storeAccount, storePassword, storePassword, uninstallAccount, unloadAccount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolProviderFactorySipImpl

public ProtocolProviderFactorySipImpl()
Constructs a new instance of the ProtocolProviderFactorySipImpl.

Method Detail

storeAccount

protected void storeAccount(AccountID accountID)
Ovverides the original in order not to save the XCAP_PASSWORD field.

Overrides:
storeAccount in class ProtocolProviderFactory
Parameters:
accountID - the account identifier.

installAccount

public AccountID installAccount(String userIDStr,
                                Map<String,String> accountProperties)
Initializes and creates an account corresponding to the specified accountProperties and registers the resulting ProtocolProvider in the context BundleContext parameter.

Specified by:
installAccount in class ProtocolProviderFactory
Parameters:
userIDStr - the user identifier uniquely representing the newly created account within the protocol namespace.
accountProperties - a set of protocol (or implementation) specific properties defining the new account.
Returns:
the AccountID of the newly created account.
Throws:
IllegalArgumentException - if userID does not correspond to an identifier in the context of the underlying protocol or if accountProperties does not contain a complete set of account installation properties.
IllegalStateException - if the account has already been installed.
NullPointerException - if any of the arguments is null.

modifyAccount

public void modifyAccount(ProtocolProviderService protocolProvider,
                          Map<String,String> accountProperties)
Modifies the account corresponding to the specified accountID. This method is meant to be used to change properties of already existing accounts. Note that if the given accountID doesn't correspond to any registered account this method would do nothing.

Specified by:
modifyAccount in class ProtocolProviderFactory
Parameters:
protocolProvider - the protocol provider service corresponding to the modified account.
accountProperties - a set of protocol (or implementation) specific properties defining the new account.
Throws:
NullPointerException - if any of the arguments is null.

createAccountID

protected AccountID createAccountID(String userID,
                                    Map<String,String> accountProperties)
Creates a new SipAccountID instance with a specific user ID to represent a given set of account properties.

Specified by:
createAccountID in class ProtocolProviderFactory
Parameters:
userID - the user ID of the new instance
accountProperties - the set of properties to be represented by the new instance
Returns:
a new AccountID instance with the specified user ID representing the given set of account properties

createService

protected ProtocolProviderService createService(String userID,
                                                AccountID accountID)
Initializes a new ProtocolProviderServiceSipImpl instance with a specific user ID to represent a specific AccountID.

Specified by:
createService in class ProtocolProviderFactory
Parameters:
userID - the user ID to initialize the new instance with
accountID - the AccountID to be represented by the new instance
Returns:
a new ProtocolProviderService instance with the specific user ID representing the specified AccountID

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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