|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.service.protocol.ProtocolProviderFactory
public abstract class ProtocolProviderFactory
The ProtocolProviderFactory is what actually creates instances of a ProtocolProviderService implementation. A provider factory would register, persistently store, and remove when necessary, ProtocolProviders. The way things are in the SIP Communicator, a user account is represented (in a 1:1 relationship) by an AccountID and a ProtocolProvider. In other words - one would have as many protocol providers installed in a given moment as they would user account registered through the various services.
| Field Summary | |
|---|---|
static String |
ACCOUNT_DISPLAY_NAME
The name that should be displayed to the user on call via and chat via lists. |
static String |
ACCOUNT_ICON_PATH
The name of a property representing the path to the account icon to be used in the user interface, when the protocol provider service is not available. |
static String |
ACCOUNT_UID
The name of the property under which we store protocol AccountID-s. |
static String |
AUTHORIZATION_NAME
The name of the property under which we store the the authorization name for the proxy stored against the PROXY_ADDRESS property. |
static String |
AUTO_CHANGE_USER_NAME
The name of the property under which we store the boolean value indicating if the user name should be automatically changed if the specified name already exists. |
static String |
AUTO_DISCOVER_JINGLE_NODES
Indicates if JingleNodes should be used with ICE. |
static String |
AUTO_DISCOVER_STUN
Indicates if STUN server should be automatically discovered. |
static String |
AUTO_GENERATE_RESOURCE
The name of the property under which we store whether we generate resource values or we just use the stored one. |
static String |
CLIENT_TLS_CERTIFICATE
The name of the property which defines the ID of the client TLS certificate configuration entry. |
static String |
DEFAULT_ENCRYPTION
The name of the property which defines that the call is encrypted by default |
static String |
DEFAULT_SIPZRTP_ATTRIBUTE
The name of the property which defines if to include the ZRTP attribute to SIP/SDP |
static String |
DISPLAY_NAME
The name that should be displayed to others when we are calling or writing them. |
static String |
FORCE_P2P_MODE
The name of the property under which we store if the p2p mode for SIMPLE should be forced. |
static String |
FORCE_PROXY_BYPASS
The name of the property that indicates whether loose routing should be forced for all traffic in an account, rather than routing through an outbound proxy which is the default for Jitsi. |
static String |
IS_ACCOUNT_DISABLED
The name of the property that would indicate if a given account is currently enabled or disabled. |
static String |
IS_ALLOW_NON_SECURE
Indicates if we allow non-TLS connection. |
static String |
IS_CALLING_DISABLED_FOR_ACCOUNT
Indicates if calling is disabled for a certain account. |
static String |
IS_DESKTOP_STREAMING_DISABLED
Indicates if desktop streaming/sharing is disabled for a certain account. |
static String |
IS_PREFERRED_PROTOCOL
Indicates if the given account is the preferred account. |
static String |
IS_PRESENCE_ENABLED
The name of the property under which we store if the presence is enabled. |
static String |
IS_PROTOCOL_HIDDEN
Indicates a protocol that would not be shown in the user interface as an account. |
static String |
IS_SERVER_OVERRIDDEN
Indicates if the server settings are over |
static String |
IS_USE_GOOGLE_ICE
Indicates if Google ICE should be used. |
static String |
IS_USE_ICE
Indicates if ICE should be used. |
static String |
IS_USE_JINGLE_NODES
Indicates if JingleNodes should be used with ICE. |
static String |
IS_USE_UPNP
Indicates if UPnP should be used with ICE. |
static String |
KEEP_ALIVE_INTERVAL
The interval for keep-alives if any. |
static String |
KEEP_ALIVE_METHOD
Keep-alive method used by the protocol. |
static String |
NO_PASSWORD_REQUIRED
The name of the property under which we store the boolean value indicating if a password is required. |
static String |
PASSWORD
Then name of a property which represents a password. |
static String |
POLLING_PERIOD
The name of the property under which we store the offline contact polling period for SIMPLE. |
static String |
PREFERRED_CLEAR_PORT_PROPERTY_NAME
The property indicating the preferred UDP and TCP port to bind to for clear communications. |
static String |
PREFERRED_SECURE_PORT_PROPERTY_NAME
The property indicating the preferred TLS (TCP) port to bind to for secure communications. |
static String |
PREFERRED_TRANSPORT
The name of the property under which we store the user preference for a transport protocol to use (i.e. |
static String |
PROTOCOL
The name of a property representing the name of the protocol for an ProtocolProviderFactory. |
static String |
PROTOCOL_ICON_PATH
The name of a property representing the path to protocol icons. |
static String |
PROXY_ADDRESS
The name of the property under which we store protocol the address of a protocol proxy. |
static String |
PROXY_ADDRESS_VALIDATED
Indicates if the proxy address has been validated. |
static String |
PROXY_AUTO_CONFIG
The name of the property which defines whether proxy is auto configured by the protocol by using known methods such as specific DNS queries. |
static String |
PROXY_PASSWORD
The name of the property under which we store the password for the proxy stored against the PROXY_ADDRESS property. |
static String |
PROXY_PORT
The name of the property under which we store the number of the port where the proxy stored against the PROXY_ADDRESS property is expecting connections to be made via this protocol. |
static String |
PROXY_TRANSPORT
The name of the property under which we store the name of the transport protocol that needs to be used to access the proxy. |
static String |
PROXY_TYPE
The name of the property under which we store the the type of the proxy stored against the PROXY_ADDRESS property. |
static String |
PROXY_USERNAME
The name of the property under which we store the the username for the proxy stored against the PROXY_ADDRESS property. |
protected Hashtable<AccountID,org.osgi.framework.ServiceRegistration> |
registeredAccounts
The table that we store our accounts in. |
static String |
RESOURCE
The name of the property under which we store resources such as the jabber resource property. |
static String |
RESOURCE_PRIORITY
The name of the property under which we store resource priority. |
static int |
SAVP_MANDATORY
Always use RTP/SAVP |
static int |
SAVP_OFF
Always use RTP/AVP |
static String |
SAVP_OPTION
The name of the property that indicates the AVP type. |
static int |
SAVP_OPTIONAL
Sends two media description, with RTP/SAVP being first. |
static String |
SDES_CIPHER_SUITES
The name of the property that defines the enabled SDES cipher suites. |
static String |
SDES_ENABLED
The name of the property that indicates if SDES is enabled for this account. |
static String |
SERVER_ADDRESS
The name of the property under which we store protocol the address of a protocol centric entity (any protocol server). |
static String |
SERVER_ADDRESS_VALIDATED
Indicates if the server address has been validated. |
static String |
SERVER_PORT
The name of the property under which we store the number of the port where the server stored against the SERVER_ADDRESS property is expecting connections to be made via this protocol. |
static String |
SERVER_TRANSPORT
The name of the property under which we store the name of the transport protocol that needs to be used to access the server. |
static String |
SMS_SERVER_ADDRESS
The sms default server address. |
static String |
STRATEGY
Indicates the search strategy chosen for the DICT protocole. |
static String |
STUN_ADDRESS
The base property name for address of additional STUN servers specified. |
static String |
STUN_IS_TURN_SUPPORTED
The base property name for the turn supported property of additional STUN servers specified. |
static String |
STUN_PASSWORD
The base property name for password of additional STUN servers specified. |
static String |
STUN_PORT
The base property name for port of additional STUN servers specified. |
static String |
STUN_PREFIX
The property name prefix for all stun server properties. |
static String |
STUN_USERNAME
The base property name for username of additional STUN servers specified. |
static String |
SUBSCRIPTION_EXPIRATION
The name of the property under which we store the chosen default subscription expiration value for SIMPLE. |
static String |
USE_DEFAULT_STUN_SERVER
Indicates if default STUN server would be used if no other STUN/TURN server are available. |
static String |
USER_ID
The name of a property which represents the AccountID of a ProtocolProvider and that, together with a password is used to login on the protocol network.. |
static String |
VOICEMAIL_URI
Address used to reach voicemail box, by services able to subscribe for voicemail new messages notifications. |
| Constructor Summary | |
|---|---|
protected |
ProtocolProviderFactory(org.osgi.framework.BundleContext bundleContext,
String protocolName)
Creates a new ProtocolProviderFactory. |
| Method Summary | |
|---|---|
AccountID |
createAccount(Map<String,String> accountProperties)
Initializes and creates an account corresponding to the specified accountProperties. |
protected abstract AccountID |
createAccountID(String userID,
Map<String,String> accountProperties)
Creates a new AccountID instance with a specific user ID to
represent a given set of account properties. |
protected abstract ProtocolProviderService |
createService(String userID,
AccountID accountID)
Initializes a new ProtocolProviderService instance with a
specific user ID to represent a specific AccountID. |
static String |
findAccountPrefix(org.osgi.framework.BundleContext bundleContext,
AccountID accountID,
String sourcePackageName)
Returns the prefix for all persistently stored properties of the account with the specified id. |
org.osgi.framework.BundleContext |
getBundleContext()
Gets the BundleContext containing (or to contain) the
service registration of this factory. |
String |
getProtocolName()
Gets the name of the protocol this factory registers its ProtocolProviderServices with and to be placed in the
properties of the accounts created by this factory. |
org.osgi.framework.ServiceReference |
getProviderForAccount(AccountID accountID)
Returns the ServiceReference for the protocol provider corresponding to the specified accountID or null if the accountID is unknown. |
ArrayList<AccountID> |
getRegisteredAccounts()
Returns a copy of the list containing the AccountIDs of all accounts currently registered in this protocol provider. |
abstract AccountID |
installAccount(String userID,
Map<String,String> accountProperties)
Initializes and creates an account corresponding to the specified accountProperties and registers the resulting ProtocolProvider in the context BundleContext parameter. |
boolean |
loadAccount(AccountID accountID)
Creates a protocol provider for the given accountID and registers it in the bundle context. |
AccountID |
loadAccount(Map<String,String> accountProperties)
Initializes and creates an account corresponding to the specified accountProperties and registers the resulting ProtocolProvider in the context BundleContext parameter. |
String |
loadPassword(AccountID accountID)
Returns the password last saved for the specified account. |
protected String |
loadPassword(org.osgi.framework.BundleContext bundleContext,
AccountID accountID)
Returns the password last saved for the specified account. |
abstract void |
modifyAccount(ProtocolProviderService protocolProvider,
Map<String,String> accountProperties)
Modifies the account corresponding to the specified accountID. |
protected boolean |
removeStoredAccount(AccountID accountID)
Removes the account with accountID from the set of accounts that are persistently stored inside the configuration service. |
void |
stop()
Prepares the factory for bundle shutdown. |
protected void |
stop(org.osgi.framework.ServiceRegistration registeredAccount)
Shuts down the ProtocolProviderService representing an
account registered with this factory. |
protected void |
storeAccount(AccountID accountID)
The method stores the specified account in the configuration service under the package name of the source factory. |
protected void |
storeAccount(AccountID accountID,
boolean isModification)
The method stores the specified account in the configuration service under the package name of the source factory. |
void |
storePassword(AccountID accountID,
String password)
Saves the password for the specified account after scrambling it a bit so that it is not visible from first sight. |
protected void |
storePassword(org.osgi.framework.BundleContext bundleContext,
AccountID accountID,
String password)
Saves the password for the specified account after scrambling it a bit so that it is not visible from first sight (Method remains highly insecure). |
boolean |
uninstallAccount(AccountID accountID)
Removes the specified account from the list of accounts that this provider factory is handling. |
boolean |
unloadAccount(AccountID accountID)
Unloads the account corresponding to the given accountID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PASSWORD
public static final String PROTOCOL
public static final String PROTOCOL_ICON_PATH
public static final String ACCOUNT_ICON_PATH
public static final String USER_ID
public static final String DISPLAY_NAME
public static final String ACCOUNT_DISPLAY_NAME
public static final String ACCOUNT_UID
public static final String SERVER_ADDRESS
public static final String SERVER_PORT
public static final String SERVER_TRANSPORT
public static final String PROXY_ADDRESS
public static final String PROXY_PORT
public static final String PROXY_AUTO_CONFIG
public static final String PREFERRED_CLEAR_PORT_PROPERTY_NAME
public static final String PREFERRED_SECURE_PORT_PROPERTY_NAME
public static final String PROXY_TYPE
public static final String PROXY_USERNAME
public static final String AUTHORIZATION_NAME
public static final String PROXY_PASSWORD
public static final String PROXY_TRANSPORT
public static final String FORCE_PROXY_BYPASS
public static final String PREFERRED_TRANSPORT
public static final String AUTO_GENERATE_RESOURCE
public static final String RESOURCE
public static final String RESOURCE_PRIORITY
public static final String DEFAULT_ENCRYPTION
public static final String DEFAULT_SIPZRTP_ATTRIBUTE
public static final String CLIENT_TLS_CERTIFICATE
public static final String AUTO_CHANGE_USER_NAME
public static final String NO_PASSWORD_REQUIRED
public static final String IS_PRESENCE_ENABLED
public static final String FORCE_P2P_MODE
public static final String POLLING_PERIOD
public static final String SUBSCRIPTION_EXPIRATION
public static final String SERVER_ADDRESS_VALIDATED
public static final String IS_SERVER_OVERRIDDEN
public static final String PROXY_ADDRESS_VALIDATED
public static final String STRATEGY
public static final String IS_PROTOCOL_HIDDEN
public static final String IS_PREFERRED_PROTOCOL
public static final String IS_ACCOUNT_DISABLED
public static final String IS_USE_ICE
public static final String IS_USE_GOOGLE_ICE
public static final String AUTO_DISCOVER_STUN
public static final String USE_DEFAULT_STUN_SERVER
public static final String STUN_PREFIX
public static final String STUN_ADDRESS
public static final String STUN_PORT
public static final String STUN_USERNAME
public static final String STUN_PASSWORD
public static final String STUN_IS_TURN_SUPPORTED
public static final String IS_USE_JINGLE_NODES
public static final String AUTO_DISCOVER_JINGLE_NODES
public static final String IS_USE_UPNP
public static final String IS_ALLOW_NON_SECURE
public static final String VOICEMAIL_URI
public static final String IS_CALLING_DISABLED_FOR_ACCOUNT
public static final String IS_DESKTOP_STREAMING_DISABLED
public static final String SMS_SERVER_ADDRESS
public static final String KEEP_ALIVE_METHOD
public static final String KEEP_ALIVE_INTERVAL
protected final Hashtable<AccountID,org.osgi.framework.ServiceRegistration> registeredAccounts
TODO Synchronize the access to the field which may in turn be better achieved by also hiding it from protected into private access.
public static final String SAVP_OPTION
public static final int SAVP_OFF
public static final int SAVP_MANDATORY
public static final int SAVP_OPTIONAL
public static final String SDES_CIPHER_SUITES
public static final String SDES_ENABLED
| Constructor Detail |
|---|
protected ProtocolProviderFactory(org.osgi.framework.BundleContext bundleContext,
String protocolName)
bundleContext - the bundle context reference of the serviceprotocolName - the name of the protocol| Method Detail |
|---|
public org.osgi.framework.BundleContext getBundleContext()
BundleContext containing (or to contain) the
service registration of this factory.
BundleContext containing (or to contain) the
service registration of this factory
public abstract AccountID installAccount(String userID,
Map<String,String> accountProperties)
throws IllegalArgumentException,
IllegalStateException,
NullPointerException
userID - 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.
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.
public abstract void modifyAccount(ProtocolProviderService protocolProvider,
Map<String,String> accountProperties)
throws NullPointerException
protocolProvider - the protocol provider service corresponding to
the modified account.accountProperties - a set of protocol (or implementation) specific
properties defining the new account.
NullPointerException - if any of the arguments is null.public ArrayList<AccountID> getRegisteredAccounts()
public org.osgi.framework.ServiceReference getProviderForAccount(AccountID accountID)
accountID - the accountID of the protocol provider we'd like to get
public boolean uninstallAccount(AccountID accountID)
accountID - the ID of the account to remove.
protected void storeAccount(AccountID accountID)
In order to store all account properties, the method would create an entry in the configuration service corresponding (beginning with) the sourceFactory's package name and add to it a unique identifier (e.g. the current miliseconds.)
accountID - the AccountID corresponding to the account that we would
like to store.
protected void storeAccount(AccountID accountID,
boolean isModification)
In order to store all account properties, the method would create an entry in the configuration service corresponding (beginning with) the sourceFactory's package name and add to it a unique identifier (e.g. the current miliseconds.)
accountID - the AccountID corresponding to the account that we would
like to store.isModification - if false there must be no such already
loaded account, it true ist modification of an existing account.
Usually we use this method with false in method installAccount
and with true or the overridden method in method
modifyAccount.
public void storePassword(AccountID accountID,
String password)
throws IllegalArgumentException
accountID - the AccountID for the account whose password we're
storingpassword - the password itself
IllegalArgumentException - if no account corresponding to
accountID has been previously stored
protected void storePassword(org.osgi.framework.BundleContext bundleContext,
AccountID accountID,
String password)
throws IllegalArgumentException,
OperationFailedException
TODO Delegate the implementation to AccountManager because it
knows the format in which the password (among the other account
properties) is to be saved.
bundleContext - a currently valid bundle context.accountID - the AccountID of the account whose password is
to be storedpassword - the password to be stored
IllegalArgumentException - if no account corresponding to
accountID has been previously stored.
OperationFailedException - if anything goes wrong while storing the
specified passwordpublic String loadPassword(AccountID accountID)
accountID - the AccountID for the account whose password we're
looking for
protected String loadPassword(org.osgi.framework.BundleContext bundleContext,
AccountID accountID)
TODO Delegate the implementation to AccountManager because it
knows the format in which the password (among the other account
properties) was saved.
bundleContext - a currently valid bundle context.accountID - the AccountID for the account whose password we're
looking for..
public AccountID loadAccount(Map<String,String> accountProperties)
accountProperties - a set of protocol (or implementation) specific
properties defining the new account.
public boolean loadAccount(AccountID accountID)
accountID - the account identifier
public boolean unloadAccount(AccountID accountID)
accountID - the account identifier
public AccountID createAccount(Map<String,String> accountProperties)
accountProperties - a set of protocol (or implementation) specific
properties defining the new account.
protected abstract AccountID createAccountID(String userID,
Map<String,String> accountProperties)
AccountID instance with a specific user ID to
represent a given set of account properties.
The method is a pure factory allowing implementers to specify the runtime
type of the created AccountID and customize the instance.
The returned AccountID will later be associated with a
ProtocolProviderService by the caller (e.g. using
createService(String, AccountID)).
userID - the user ID of the new instanceaccountProperties - the set of properties to be represented by the
new instance
AccountID instance with the specified user ID
representing the given set of account propertiespublic String getProtocolName()
ProtocolProviderServices with and to be placed in the
properties of the accounts created by this factory.
ProtocolProviderServices with and to be placed in
the properties of the accounts created by this factory
protected abstract ProtocolProviderService createService(String userID,
AccountID accountID)
ProtocolProviderService instance with a
specific user ID to represent a specific AccountID.
The method is a pure factory allowing implementers to specify the runtime
type of the created ProtocolProviderService and customize
the instance. The caller will later register the returned service with
the BundleContext of this factory.
userID - the user ID to initialize the new instance withaccountID - the AccountID to be represented by the new
instance
ProtocolProviderService instance with the
specific user ID representing the specified
AccountIDprotected boolean removeStoredAccount(AccountID accountID)
accountID - the AccountID of the account to remove.
public static String findAccountPrefix(org.osgi.framework.BundleContext bundleContext,
AccountID accountID,
String sourcePackageName)
bundleContext - a currently valid bundle context.accountID - the AccountID of the account whose properties we're
looking for.sourcePackageName - a String containing the package name of the
concrete factory class that extends us.
public void stop()
protected void stop(org.osgi.framework.ServiceRegistration registeredAccount)
ProtocolProviderService representing an
account registered with this factory.
registeredAccount - the ServiceRegistration of the
ProtocolProviderService representing an account
registered with this factory
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||