Implementing SIP support (work in progress)

Throw un exception during account installation if the account exists.
cusax-fix
Emil Ivov 20 years ago
parent c26061ccf7
commit d93459a77b

@ -112,6 +112,12 @@ public AccountID installAccount( String userIDStr,
AccountID accountID =
new SipAccountID(userIDStr, accountProperties, serverAddress);
//make sure we haven't seen this account id before.
if( registeredAccounts.containsKey(accountID) )
throw new IllegalStateException(
"An account for id " + userIDStr + " was already installed!");
//first store the account and only then load it as the load generates
//an osgi event, the osgi event triggers (trhgough the UI) a call to
//the register() method and it needs to acces the configuration service
@ -160,11 +166,6 @@ protected AccountID loadAccount(String userIDStr, Map accountProperties)
AccountID accountID =
new SipAccountID(userIDStr, accountProperties, serverAddress);
//make sure we haven't seen this account id before.
if( registeredAccounts.containsKey(accountID) )
throw new IllegalStateException(
"An account for id " + userIDStr + " was already installed!");
//get a reference to the configuration service and register whatever
//properties we have in it.

Loading…
Cancel
Save