Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore Class Reference

List of all members.

Public Member Functions

 XMPPAccountStore (IPreferenceStore preferenceStore, ISecurePreferences securePreferenceStore)
synchronized List< XMPPAccountgetAllAccounts ()
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)

Detailed Description

Class for the management of multiple XMPP accounts in Saros.

Author:
Stefan Rossbach
Deprecated:
Use de.fu_berlin.inf.dpp.account.XMPPAccountStore instead

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.XMPPAccountStore ( IPreferenceStore  preferenceStore,
ISecurePreferences  securePreferenceStore 
)

Member Function Documentation

synchronized void de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.changeAccountData ( XMPPAccount  account,
String  username,
String  password,
String  domain,
String  server,
int  port,
boolean  useTLS,
boolean  useSASL 
)

Changes the properties of an account.

Parameters:
usernamethe new user name
passwordthe new password
domainthe domain name of the server
serverthe server ip / name
portthe port of the server
useTLSif the connection should be secured using TLS
useSASLif the authentication should be negotiated using SASL
Exceptions:
IllegalArgumentExceptionif 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.accountManagement.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.

Parameters:
usernamethe user name of the new account as lower case string
passwordthe password of the new account.
domainthe domain name of the server
serverthe server of the new account as lower case string or an empty string if not used
portthe port of the server or 0 if not used
useTLSif the connection should be secured using TLS
useSASLif the authentication should be negotiated using SASL
Exceptions:
NullPointerExceptionif username, password, domain or server is null
IllegalArgumentExceptionif 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.accountManagement.XMPPAccountStore.deleteAccount ( XMPPAccount  account)

Deletes an account.

Parameters:
accountthe account to delete
Exceptions:
IllegalArgumentExceptionif the account is not found in the store
IllegalStateExceptionif the account is active
synchronized boolean de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.exists ( String  username,
String  domain,
String  server,
int  port 
)

Checks if the an account with the given arguments exists in the account store

Parameters:
usernamethe username
domainthe domain name of the server
serverthe server ip / name
portthe port of the server
Returns:
true if such an account exists, false otherwise
synchronized XMPPAccount de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.getActiveAccount ( )

Returns the current active account.

Returns:
the active account
Exceptions:
IllegalStateExceptionif the account store is empty
synchronized List<XMPPAccount> de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.getAllAccounts ( )

Returns a list containing all accounts.

Returns:
synchronized List<String> de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.getDomains ( )

Returns a list of all used domains.

Example:
If the XMPPAccountStore contains users

the server list contains

  • jabber.org
  • xyz.com
  • saros-con.imp.fu-berlin.de
Returns:
synchronized List<String> de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.getServers ( )

Returns a list of all used servers.

Example:
If the XMPPAccountStore contains users

the server list contains

  • jabber.org
  • googlemail.com
  • saros-con.imp.fu-berlin.de
Returns:
synchronized boolean de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.isEmpty ( )

Returns if the account store is currently empty

Returns:
true if the account store is empty, false otherwise
synchronized void de.fu_berlin.inf.dpp.accountManagement.XMPPAccountStore.setAccountActive ( XMPPAccount  account)

Makes the given account active.

Parameters:
accountthe account to activate
Exceptions:
IllegalArgumentExceptionif the account is not found in the store
 All Classes Namespaces Files Functions Variables Enumerations