public abstract class ProtocolProviderFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACCOUNT_DISPLAY_NAME
The name that should be displayed to the user on call via and chat via
lists.
|
static java.lang.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 java.lang.String |
ACCOUNT_READ_ONLY_GROUPS
The name of the property that would indicate if a given account
groups are readonly, values can be all or a comma separated
group names including root.
|
static java.lang.String |
ACCOUNT_UID
The name of the property under which we store protocol AccountID-s.
|
static java.lang.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 java.lang.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 java.lang.String |
AUTO_DISCOVER_JINGLE_NODES
Indicates if JingleNodes should be used with ICE.
|
static java.lang.String |
AUTO_DISCOVER_STUN
Indicates if STUN server should be automatically discovered.
|
static java.lang.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 java.lang.String |
CLIENT_TLS_CERTIFICATE
The name of the property which defines the ID of the client TLS
certificate configuration entry.
|
static java.lang.String |
CUSAX_PROVIDER_ACCOUNT_PROP
An account property to provide a connected account to check for
its status.
|
static java.lang.String |
DEFAULT_ENCRYPTION
The name of the property which defines that the call is encrypted by
default
|
static java.lang.String |
DEFAULT_SIPZRTP_ATTRIBUTE
The name of the property which defines if to include the ZRTP attribute
to SIP/SDP
|
static java.lang.String |
DISPLAY_NAME
The name that should be displayed to others when we are calling or
writing them.
|
static java.lang.String |
DTMF_METHOD
The name of the property holding DTMF method.
|
static java.lang.String |
DTMF_MINIMAL_TONE_DURATION
The minimal DTMF tone duration.
|
static java.lang.String |
ENCODING_PROP_PREFIX
The prefix used to store account encoding properties
|
static java.lang.String |
ENCRYPTION_PROTOCOL
The name of the property that indicates the encryption protocols for this
account.
|
static java.lang.String |
ENCRYPTION_PROTOCOL_STATUS
The name of the property that indicates the status (enabed or disabled)
encryption protocols for this account.
|
static java.lang.String |
FORCE_P2P_MODE
The name of the property under which we store if the p2p mode for SIMPLE
should be forced.
|
static java.lang.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 java.lang.String |
IS_ACCOUNT_CONFIG_HIDDEN
The name of the property that would indicate if a given account
configuration form is currently hidden.
|
static java.lang.String |
IS_ACCOUNT_DISABLED
The name of the property that would indicate if a given account is
currently enabled or disabled.
|
static java.lang.String |
IS_ACCOUNT_READ_ONLY
The name of the property that would indicate if a given account
configuration is read only.
|
static java.lang.String |
IS_ACCOUNT_STATUS_MENU_HIDDEN
The name of the property that would indicate if a given account
status menu is currently hidden.
|
static java.lang.String |
IS_ALLOW_NON_SECURE
Indicates if we allow non-TLS connection.
|
static java.lang.String |
IS_CALLING_DISABLED_FOR_ACCOUNT
Indicates if calling is disabled for a certain account.
|
static java.lang.String |
IS_CARBON_DISABLED
The name of the property that defines the enabled/disabled state of
message carbons.
|
static java.lang.String |
IS_DESKTOP_REMOTE_CONTROL_DISABLED
Indicates if desktop remote control is disabled for a certain account.
|
static java.lang.String |
IS_DESKTOP_STREAMING_DISABLED
Indicates if desktop streaming/sharing is disabled for a certain account.
|
static java.lang.String |
IS_PREFERRED_PROTOCOL
Indicates if the given account is the preferred account.
|
static java.lang.String |
IS_PRESENCE_ENABLED
The name of the property under which we store if the presence is enabled.
|
static java.lang.String |
IS_PROTOCOL_HIDDEN
Indicates a protocol that would not be shown in the user interface as an
account.
|
static java.lang.String |
IS_SERVER_OVERRIDDEN
Indicates if the server settings are over
|
static java.lang.String |
IS_USE_ICE
Indicates if ICE should be used.
|
static java.lang.String |
IS_USE_JINGLE_NODES
Indicates if JingleNodes should be used with ICE.
|
static java.lang.String |
IS_USE_UPNP
Indicates if UPnP should be used with ICE.
|
static java.lang.String |
IS_VIDEO_CALLING_DISABLED_FOR_ACCOUNT
Indicates if video calling is disabled for a certain account.
|
static java.lang.String |
JINGLE_NODES_SEARCH_BUDDIES
Indicates if JingleNodes should use buddies to search for nodes.
|
static java.lang.String |
KEEP_ALIVE_INTERVAL
The interval for keep-alives if any.
|
static java.lang.String |
KEEP_ALIVE_METHOD
Keep-alive method used by the protocol.
|
static java.lang.String |
MODE_PARANOIA
Paranoia mode when turned on requires all calls to be secure and
indicated as such.
|
static java.lang.String |
MUST_REGISTER_TO_CALL
The name of the property that indicates whether the client must
be registered with a registrar when making outgoing calls.
|
static java.lang.String |
NO_PASSWORD_REQUIRED
The name of the property under which we store the boolean value
indicating if a password is required.
|
static java.lang.String |
OVERRIDE_ENCODINGS
The name of the "override encodings" property
|
static java.lang.String |
PASSWORD
Then name of a property which represents a password.
|
static java.lang.String |
POLLING_PERIOD
The name of the property under which we store the offline contact polling
period for SIMPLE.
|
static java.lang.String |
PREFERRED_CLEAR_PORT_PROPERTY_NAME
The property indicating the preferred UDP and TCP
port to bind to for clear communications.
|
static java.lang.String |
PREFERRED_SECURE_PORT_PROPERTY_NAME
The property indicating the preferred TLS (TCP)
port to bind to for secure communications.
|
static java.lang.String |
PREFERRED_TRANSPORT
The name of the property under which we store the user preference for a
transport protocol to use (i.e.
|
static java.lang.String |
PROTOCOL
The name of a property representing the name of the protocol for an
ProtocolProviderFactory.
|
static java.lang.String |
PROTOCOL_ICON_PATH
The name of a property representing the path to protocol icons.
|
static java.lang.String |
PROXY_ADDRESS
The name of the property under which we store protocol the address of
a protocol proxy.
|
static java.lang.String |
PROXY_ADDRESS_VALIDATED
Indicates if the proxy address has been validated.
|
static java.lang.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 java.lang.String |
PROXY_PASSWORD
The name of the property under which we store the password for the proxy
stored against the PROXY_ADDRESS property.
|
static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.util.Map<AccountID,org.osgi.framework.ServiceRegistration<ProtocolProviderService>> |
registeredAccounts
The table that we store our accounts in.
|
static java.lang.String |
RESOURCE
The name of the property under which we store resources such as the
jabber resource property.
|
static java.lang.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 java.lang.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 java.lang.String |
SDES_CIPHER_SUITES
The name of the property that defines the enabled SDES cipher suites.
|
static java.lang.String |
SERVER_ADDRESS
The name of the property under which we store protocol the address of
a protocol centric entity (any protocol server).
|
static java.lang.String |
SERVER_ADDRESS_VALIDATED
Indicates if the server address has been validated.
|
static java.lang.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 java.lang.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 java.lang.String |
SMS_SERVER_ADDRESS
The sms default server address.
|
static java.lang.String |
STRATEGY
Indicates the search strategy chosen for the DICT protocole.
|
static java.lang.String |
STUN_ADDRESS
The base property name for address of additional STUN servers specified.
|
static java.lang.String |
STUN_IS_TURN_SUPPORTED
The base property name for the turn supported property of additional
STUN servers specified.
|
static java.lang.String |
STUN_PASSWORD
The base property name for password of additional STUN servers specified.
|
static java.lang.String |
STUN_PORT
The base property name for port of additional STUN servers specified.
|
static java.lang.String |
STUN_PREFIX
The property name prefix for all stun server properties.
|
static java.lang.String |
STUN_USERNAME
The base property name for username of additional STUN servers specified.
|
static java.lang.String |
SUBSCRIPTION_EXPIRATION
The name of the property under which we store the chosen default
subscription expiration value for SIMPLE.
|
static java.lang.String |
USE_DEFAULT_STUN_SERVER
Indicates if default STUN server would be used if no other STUN/TURN
server are available.
|
static java.lang.String |
USE_JITSI_VIDEO_BRIDGE
The name of the boolean account property which indicates whether Jitsi
Videobridge is to be used, if available and supported, for conference
calls.
|
static java.lang.String |
USE_TRANSLATOR_IN_CONFERENCE
The name of the boolean account property which indicates whether Jitsi
will use translator for media, instead of mixing, for conference
calls.
|
static java.lang.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 java.lang.String |
VOICEMAIL_CHECK_URI
Address used to call to hear your messages stored on the server
for your voicemail.
|
static java.lang.String |
VOICEMAIL_ENABLED
Enable notifications for new voicemail messages.
|
static java.lang.String |
VOICEMAIL_URI
Address used to reach voicemail box, by services able to
subscribe for voicemail new messages notifications.
|
Modifier | Constructor and Description |
---|---|
protected |
ProtocolProviderFactory(org.osgi.framework.BundleContext bundleContext,
java.lang.String protocolName)
Creates a new ProtocolProviderFactory.
|
Modifier and Type | Method and Description |
---|---|
AccountID |
createAccount(java.util.Map<java.lang.String,java.lang.String> accountProperties)
Initializes and creates an account corresponding to the specified
accountProperties.
|
protected abstract AccountID |
createAccountID(java.lang.String userID,
java.util.Map<java.lang.String,java.lang.String> accountProperties)
Creates a new
AccountID instance with a specific user ID to
represent a given set of account properties. |
protected abstract ProtocolProviderService |
createService(java.lang.String userID,
AccountID accountID)
Initializes a new
ProtocolProviderService instance with a
specific user ID to represent a specific AccountID . |
static java.lang.String |
findAccountPrefix(org.osgi.framework.BundleContext bundleContext,
AccountID accountID,
java.lang.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. |
java.lang.String |
getProtocolName()
Gets the name of the protocol this factory registers its
ProtocolProviderService s with and to be placed in the
properties of the accounts created by this factory. |
static ProtocolProviderFactory |
getProtocolProviderFactory(org.osgi.framework.BundleContext bundleContext,
java.lang.String protocolName)
Finds registered ProtocolProviderFactory for given
protocolName.
|
org.osgi.framework.ServiceReference<ProtocolProviderService> |
getProviderForAccount(AccountID accountID)
Returns the ServiceReference for the protocol provider corresponding to
the specified accountID or null if the accountID is unknown.
|
java.util.ArrayList<AccountID> |
getRegisteredAccounts()
Returns a copy of the list containing the AccountIDs of all
accounts currently registered in this protocol provider.
|
abstract AccountID |
installAccount(java.lang.String userID,
java.util.Map<java.lang.String,java.lang.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(java.util.Map<java.lang.String,java.lang.String> accountProperties)
Initializes and creates an account corresponding to the specified
accountProperties and registers the resulting ProtocolProvider in the
context BundleContext parameter.
|
java.lang.String |
loadPassword(AccountID accountID)
Returns the password last saved for the specified account.
|
protected java.lang.String |
loadPassword(org.osgi.framework.BundleContext bundleContext,
AccountID accountID)
Returns the password last saved for the specified account.
|
abstract void |
modifyAccount(ProtocolProviderService protocolProvider,
java.util.Map<java.lang.String,java.lang.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<ProtocolProviderService> 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,
java.lang.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,
java.lang.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.
|
public static final java.lang.String PASSWORD
public static final java.lang.String PROTOCOL
public static final java.lang.String PROTOCOL_ICON_PATH
public static final java.lang.String ACCOUNT_ICON_PATH
public static final java.lang.String USER_ID
public static final java.lang.String DISPLAY_NAME
public static final java.lang.String ACCOUNT_DISPLAY_NAME
public static final java.lang.String ACCOUNT_UID
public static final java.lang.String SERVER_ADDRESS
public static final java.lang.String SERVER_PORT
public static final java.lang.String SERVER_TRANSPORT
public static final java.lang.String PROXY_ADDRESS
public static final java.lang.String PROXY_PORT
public static final java.lang.String PROXY_AUTO_CONFIG
public static final java.lang.String PREFERRED_CLEAR_PORT_PROPERTY_NAME
public static final java.lang.String PREFERRED_SECURE_PORT_PROPERTY_NAME
public static final java.lang.String PROXY_TYPE
public static final java.lang.String PROXY_USERNAME
public static final java.lang.String AUTHORIZATION_NAME
public static final java.lang.String PROXY_PASSWORD
public static final java.lang.String PROXY_TRANSPORT
public static final java.lang.String FORCE_PROXY_BYPASS
public static final java.lang.String MUST_REGISTER_TO_CALL
public static final java.lang.String PREFERRED_TRANSPORT
public static final java.lang.String AUTO_GENERATE_RESOURCE
public static final java.lang.String RESOURCE
public static final java.lang.String RESOURCE_PRIORITY
public static final java.lang.String DEFAULT_ENCRYPTION
public static final java.lang.String ENCRYPTION_PROTOCOL
public static final java.lang.String ENCRYPTION_PROTOCOL_STATUS
public static final java.lang.String DEFAULT_SIPZRTP_ATTRIBUTE
public static final java.lang.String CLIENT_TLS_CERTIFICATE
public static final java.lang.String AUTO_CHANGE_USER_NAME
public static final java.lang.String NO_PASSWORD_REQUIRED
public static final java.lang.String IS_PRESENCE_ENABLED
public static final java.lang.String FORCE_P2P_MODE
public static final java.lang.String POLLING_PERIOD
public static final java.lang.String SUBSCRIPTION_EXPIRATION
public static final java.lang.String SERVER_ADDRESS_VALIDATED
public static final java.lang.String IS_SERVER_OVERRIDDEN
public static final java.lang.String PROXY_ADDRESS_VALIDATED
public static final java.lang.String STRATEGY
public static final java.lang.String IS_PROTOCOL_HIDDEN
public static final java.lang.String IS_PREFERRED_PROTOCOL
public static final java.lang.String IS_ACCOUNT_DISABLED
public static final java.lang.String IS_ACCOUNT_CONFIG_HIDDEN
public static final java.lang.String IS_ACCOUNT_STATUS_MENU_HIDDEN
public static final java.lang.String IS_ACCOUNT_READ_ONLY
public static final java.lang.String ACCOUNT_READ_ONLY_GROUPS
public static final java.lang.String IS_USE_ICE
public static final java.lang.String AUTO_DISCOVER_STUN
public static final java.lang.String USE_DEFAULT_STUN_SERVER
public static final java.lang.String USE_JITSI_VIDEO_BRIDGE
public static final java.lang.String USE_TRANSLATOR_IN_CONFERENCE
public static final java.lang.String STUN_PREFIX
public static final java.lang.String STUN_ADDRESS
public static final java.lang.String STUN_PORT
public static final java.lang.String STUN_USERNAME
public static final java.lang.String STUN_PASSWORD
public static final java.lang.String STUN_IS_TURN_SUPPORTED
public static final java.lang.String IS_USE_JINGLE_NODES
public static final java.lang.String AUTO_DISCOVER_JINGLE_NODES
public static final java.lang.String JINGLE_NODES_SEARCH_BUDDIES
public static final java.lang.String IS_USE_UPNP
public static final java.lang.String IS_ALLOW_NON_SECURE
public static final java.lang.String VOICEMAIL_ENABLED
public static final java.lang.String VOICEMAIL_URI
public static final java.lang.String VOICEMAIL_CHECK_URI
public static final java.lang.String IS_CALLING_DISABLED_FOR_ACCOUNT
public static final java.lang.String IS_VIDEO_CALLING_DISABLED_FOR_ACCOUNT
public static final java.lang.String IS_DESKTOP_STREAMING_DISABLED
public static final java.lang.String IS_DESKTOP_REMOTE_CONTROL_DISABLED
public static final java.lang.String SMS_SERVER_ADDRESS
public static final java.lang.String KEEP_ALIVE_METHOD
public static final java.lang.String KEEP_ALIVE_INTERVAL
public static final java.lang.String DTMF_METHOD
public static final java.lang.String DTMF_MINIMAL_TONE_DURATION
public static final java.lang.String MODE_PARANOIA
public static final java.lang.String OVERRIDE_ENCODINGS
public static final java.lang.String ENCODING_PROP_PREFIX
public static final java.lang.String CUSAX_PROVIDER_ACCOUNT_PROP
protected final java.util.Map<AccountID,org.osgi.framework.ServiceRegistration<ProtocolProviderService>> 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 java.lang.String SAVP_OPTION
public static final int SAVP_OFF
public static final int SAVP_MANDATORY
public static final int SAVP_OPTIONAL
public static final java.lang.String SDES_CIPHER_SUITES
public static final java.lang.String IS_CARBON_DISABLED
protected ProtocolProviderFactory(org.osgi.framework.BundleContext bundleContext, java.lang.String protocolName)
bundleContext
- the bundle context reference of the serviceprotocolName
- the name of the protocolpublic 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 factorypublic abstract AccountID installAccount(java.lang.String userID, java.util.Map<java.lang.String,java.lang.String> accountProperties) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.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.java.lang.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.java.lang.IllegalStateException
- if the account has already been
installed.java.lang.NullPointerException
- if any of the arguments is null.public abstract void modifyAccount(ProtocolProviderService protocolProvider, java.util.Map<java.lang.String,java.lang.String> accountProperties) throws java.lang.NullPointerException
protocolProvider
- the protocol provider service corresponding to
the modified account.accountProperties
- a set of protocol (or implementation) specific
properties defining the new account.java.lang.NullPointerException
- if any of the arguments is null.public java.util.ArrayList<AccountID> getRegisteredAccounts()
public org.osgi.framework.ServiceReference<ProtocolProviderService> getProviderForAccount(AccountID accountID)
accountID
- the accountID of the protocol provider we'd like to getpublic 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, java.lang.String password) throws java.lang.IllegalArgumentException
accountID
- the AccountID for the account whose password we're
storingpassword
- the password itselfjava.lang.IllegalArgumentException
- if no account corresponding to
accountID
has been previously storedprotected void storePassword(org.osgi.framework.BundleContext bundleContext, AccountID accountID, java.lang.String password) throws java.lang.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 storedjava.lang.IllegalArgumentException
- if no account corresponding to
accountID has been previously stored.OperationFailedException
- if anything goes wrong while storing the
specified passwordpublic java.lang.String loadPassword(AccountID accountID)
accountID
- the AccountID for the account whose password we're
looking forprotected java.lang.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(java.util.Map<java.lang.String,java.lang.String> accountProperties)
accountProperties
- a set of protocol (or implementation) specific
properties defining the new account.public boolean loadAccount(AccountID accountID)
accountID
- the account identifierpublic boolean unloadAccount(AccountID accountID)
accountID
- the account identifierpublic AccountID createAccount(java.util.Map<java.lang.String,java.lang.String> accountProperties)
accountProperties
- a set of protocol (or implementation) specific
properties defining the new account.protected abstract AccountID createAccountID(java.lang.String userID, java.util.Map<java.lang.String,java.lang.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 instanceAccountID
instance with the specified user ID
representing the given set of account propertiespublic java.lang.String getProtocolName()
ProtocolProviderService
s with and to be placed in the
properties of the accounts created by this factory.ProtocolProviderService
s with and to be placed in
the properties of the accounts created by this factoryprotected abstract ProtocolProviderService createService(java.lang.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
instanceProtocolProviderService
instance with the
specific user ID representing the specified
AccountID
protected boolean removeStoredAccount(AccountID accountID)
accountID
- the AccountID of the account to remove.public static java.lang.String findAccountPrefix(org.osgi.framework.BundleContext bundleContext, AccountID accountID, java.lang.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<ProtocolProviderService> registeredAccount)
ProtocolProviderService
representing an
account registered with this factory.registeredAccount
- the ServiceRegistration
of the
ProtocolProviderService
representing an account
registered with this factorypublic static ProtocolProviderFactory getProtocolProviderFactory(org.osgi.framework.BundleContext bundleContext, java.lang.String protocolName)
bundleContext
- the OSGI bundle context that will be used.protocolName
- the protocol name.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.