Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Classes | |
class | Crypto |
Public Member Functions | |
XMPPAccountStore () | |
synchronized void | setAccountFile (final File file, final String key) |
synchronized List< XMPPAccount > | getAllAccounts () |
synchronized List< String > | getDomains () |
synchronized List< String > | getServers () |
synchronized void | setAccountActive (XMPPAccount account) |
synchronized void | deleteAccount (XMPPAccount account) |
synchronized XMPPAccount | createAccount (String username, String password, String domain, String server, int port, boolean useTLS, boolean useSASL) |
synchronized void | changeAccountData (XMPPAccount account, String username, String password, String domain, String server, int port, boolean useTLS, boolean useSASL) |
synchronized XMPPAccount | getActiveAccount () |
synchronized boolean | isEmpty () |
synchronized boolean | exists (String username, String domain, String server, int port) |
XMPPAccount | findAccount (String jidString) |
The XMPPAccountStore is responsible for administering XMPP account credentials. All data will just reside in memory unless setAccountFile(File, String) is called. This call should only be made once and before any account manipulation is done. Note: Although this class is thread safe it is not recommended to manipulate and use data from different threads.
de.fu_berlin.inf.dpp.account.XMPPAccountStore.XMPPAccountStore | ( | ) |
synchronized void de.fu_berlin.inf.dpp.account.XMPPAccountStore.changeAccountData | ( | XMPPAccount | account, |
String | username, | ||
String | password, | ||
String | domain, | ||
String | server, | ||
int | port, | ||
boolean | useTLS, | ||
boolean | useSASL | ||
) |
Changes the properties of an account.
username | the new user name |
password | the new password |
domain | the domain name of the server |
server | the server ip / name |
port | the port of the server |
useTLS | if the connection should be secured using TLS |
useSASL | if the authentication should be negotiated using SASL |
IllegalArgumentException | if username or domain string is empty or only contains whitespace characters if the domain or server contains upper case characters if the port value is not in range of 0 <= x <= 65535 if the server string is not empty and the port is 0 if an account already exists with the given username, password, domain, server and port |
synchronized XMPPAccount de.fu_berlin.inf.dpp.account.XMPPAccountStore.createAccount | ( | String | username, |
String | password, | ||
String | domain, | ||
String | server, | ||
int | port, | ||
boolean | useTLS, | ||
boolean | useSASL | ||
) |
Creates an account. The account will automatically become active if the account store is empty.
username | the user name of the new account as lower case string |
password | the password of the new account. |
domain | the domain name of the server |
server | the server of the new account as lower case string or an empty string if not used |
port | the port of the server or 0 if not used |
useTLS | if the connection should be secured using TLS |
useSASL | if the authentication should be negotiated using SASL |
NullPointerException | if username, password, domain or server is null |
IllegalArgumentException | if username or domain string is empty or only contains whitespace characters if the domain or server contains upper case characters if the port value is not in range of 0 < x <= 65535 if the server string is not empty and the port is 0 if an account already exists with the given username, password, domain, server and port |
synchronized void de.fu_berlin.inf.dpp.account.XMPPAccountStore.deleteAccount | ( | XMPPAccount | account | ) |
Deletes an account.
account | the account to delete |
IllegalArgumentException | if the account is not found in the store |
IllegalStateException | if the account is active |
synchronized boolean de.fu_berlin.inf.dpp.account.XMPPAccountStore.exists | ( | String | username, |
String | domain, | ||
String | server, | ||
int | port | ||
) |
Checks if the an account with the given arguments exists in the account store
username | the username |
domain | the domain name of the server |
server | the server ip / name |
port | the port of the server |
true if such an account exists, false
otherwise
XMPPAccount de.fu_berlin.inf.dpp.account.XMPPAccountStore.findAccount | ( | String | jidString | ) |
Searches for an account in the account store.
jidString | the jid of the user as string |
NullPointerException | if jidString is null |
synchronized XMPPAccount de.fu_berlin.inf.dpp.account.XMPPAccountStore.getActiveAccount | ( | ) |
Returns the current active account.
IllegalStateException | if the account store is empty |
synchronized List<XMPPAccount> de.fu_berlin.inf.dpp.account.XMPPAccountStore.getAllAccounts | ( | ) |
Returns a list containing all accounts.
synchronized List<String> de.fu_berlin.inf.dpp.account.XMPPAccountStore.getDomains | ( | ) |
Returns a list of all used domains.
Example:
If the XMPPAccountStore contains users
the server list contains
synchronized List<String> de.fu_berlin.inf.dpp.account.XMPPAccountStore.getServers | ( | ) |
Returns a list of all used servers.
Example:
If the XMPPAccountStore contains users
the server list contains
synchronized boolean de.fu_berlin.inf.dpp.account.XMPPAccountStore.isEmpty | ( | ) |
Returns if the account store is currently empty
true
if the account store is empty, false
otherwise synchronized void de.fu_berlin.inf.dpp.account.XMPPAccountStore.setAccountActive | ( | XMPPAccount | account | ) |
Makes the given account active.
account | the account to activate |
IllegalArgumentException | if the account is not found in the store |
synchronized void de.fu_berlin.inf.dpp.account.XMPPAccountStore.setAccountFile | ( | final File | file, |
final String | key | ||
) |
Sets the account file where the store should search for accounts. This method should be used with care as it discards all currently loaded accounts which may result in unexpected behavior if account objects are already in use. The store will be refreshed with possible new data when this method is called. All missing directories will be created on demand. Note: Although the file is encrypted it is highly recommended to use a file location that is only accessible by the current user.
file | the file to load and store account data or null to just enable in memory account management |
key | the key for encryption and decryption of the file or null to use the default key |