public class AccountManager
extends java.lang.Object
Constructor and Description |
---|
AccountManager(org.osgi.framework.BundleContext bundleContext)
Initializes a new AccountManagerImpl instance loaded in a
specific BundleContext (in which the caller will usually
later register it).
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(AccountManagerListener listener)
Implements AccountManager#addListener(AccountManagerListener).
|
AccountID |
findAccountID(java.lang.String uid)
Searches for stored account with uid in stored
configuration.
|
java.lang.String |
getAccountNodeName(ProtocolProviderFactory factory,
java.lang.String accountUID)
Gets account node name under which account configuration properties are
stored.
|
java.lang.String |
getFactoryImplPackageName(ProtocolProviderFactory factory)
Returns the package name of the factory.
|
java.util.Collection<AccountID> |
getStoredAccounts()
Returns an Iterator over a list of all stored
AccountIDs.
|
boolean |
hasStoredAccount(java.lang.String protocolName,
boolean includeHidden,
java.lang.String userID)
Checks whether a stored account with userID is stored
in configuration.
|
boolean |
hasStoredAccounts(java.lang.String protocolName,
boolean includeHidden)
Check for stored accounts for the supplied protocolName.
|
boolean |
isAccountLoaded(AccountID accountID)
Checks if the account corresponding to the given accountID is
loaded.
|
void |
loadAccount(AccountID accountID)
Loads the account corresponding to the given AccountID.
|
void |
removeListener(AccountManagerListener listener)
Implements AccountManager#removeListener(AccountManagerListener).
|
boolean |
removeStoredAccount(ProtocolProviderFactory factory,
AccountID accountID)
Removes the account with accountID from the set of accounts
that are persistently stored inside the configuration service.
|
void |
removeStoredAccounts()
Removes all accounts which have been persistently stored.
|
void |
storeAccount(ProtocolProviderFactory factory,
AccountID accountID)
Stores an account represented in the form of an AccountID
created by a specific ProtocolProviderFactory.
|
void |
unloadAccount(AccountID accountID)
Unloads the account corresponding to the given AccountID.
|
public AccountManager(org.osgi.framework.BundleContext bundleContext)
bundleContext
- the BundleContext in which the new
instance is loaded (and in which the caller will usually later
register it as a service)public void addListener(AccountManagerListener listener)
listener
- the AccountManagerListener to addpublic java.lang.String getFactoryImplPackageName(ProtocolProviderFactory factory)
factory
- the factory which package will be returned.public boolean hasStoredAccounts(java.lang.String protocolName, boolean includeHidden)
protocolName
- the protocol name to check forincludeHidden
- whether to include hidden providerspublic boolean hasStoredAccount(java.lang.String protocolName, boolean includeHidden, java.lang.String userID)
protocolName
- the protocol nameincludeHidden
- whether to check hidden providersuserID
- the user id to check.public AccountID findAccountID(java.lang.String uid)
public void removeListener(AccountManagerListener listener)
listener
- the AccountManagerListener to removepublic void storeAccount(ProtocolProviderFactory factory, AccountID accountID) throws OperationFailedException
factory
- the ProtocolProviderFactory which created the
account to be storedaccountID
- the account in the form of AccountID to be
storedOperationFailedException
- if anything goes wrong while storing the
accountpublic java.lang.String getAccountNodeName(ProtocolProviderFactory factory, java.lang.String accountUID)
factory
- account's protocol provider factoryaccountUID
- account for which the prefix will be returnedpublic boolean removeStoredAccount(ProtocolProviderFactory factory, AccountID accountID)
factory
- the ProtocolProviderFactory which created the
account to be storedaccountID
- the AccountID of the account to remove.public void removeStoredAccounts()
public java.util.Collection<AccountID> getStoredAccounts()
In order to check if an account is already loaded please use the #isAccountLoaded(AccountID accountID) method. To load an account use the #loadAccount(AccountID accountID) method.
public void loadAccount(AccountID accountID) throws OperationFailedException
accountID
- the identifier of the account to loadOperationFailedException
- if anything goes wrong while loading the
account corresponding to the specified accountIDpublic void unloadAccount(AccountID accountID) throws OperationFailedException
accountID
- the identifier of the account to loadOperationFailedException
- if anything goes wrong while unloading
the account corresponding to the specified accountIDpublic boolean isAccountLoaded(AccountID accountID)
accountID
- the identifier of the account to load
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.