Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class SipAccountID

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AccountID
      extended by net.java.sip.communicator.impl.protocol.sip.SipAccountID

public class SipAccountID
extends AccountID

A SIP extension of the account ID property.

Author:
Emil Ivov

Field Summary
 
Fields inherited from class net.java.sip.communicator.service.protocol.AccountID
accountProperties
 
Constructor Summary
protected SipAccountID(String userID, Map<String,String> accountProperties, String serverName)
          Creates a SIP account id from the specified ide and account properties.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this account id.
 String getAccountAddress()
          Returns a string that could be directly used (or easily converted to) an address that other users of the procotol can use to communicate with us.
 String getAccountPropertyString(Object key)
          Returns the account property string corresponding to the given key.
 String getDisplayName()
          The reason we need to override this method here comes from the fact that the user id that is standardly returned by the parent method is not sufficient for the user to distinguish this account from other sip accounts with the same user name.
 
Methods inherited from class net.java.sip.communicator.service.protocol.AccountID
getAccountProperties, getAccountProperty, getAccountPropertyBoolean, getAccountPropertyInt, getAccountUniqueID, getProtocolDisplayName, getProtocolName, getService, getUserID, hashCode, isEnabled, putAccountProperty, removeAccountProperty, setAccountProperties, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SipAccountID

protected SipAccountID(String userID,
                       Map<String,String> accountProperties,
                       String serverName)
Creates a SIP account id from the specified ide and account properties.

Parameters:
userID - the user id part of the SIP uri identifying this contact.
accountProperties - any other properties necessary for the account.
serverName - the name of the server that the user belongs to.
Method Detail

getAccountAddress

public String getAccountAddress()
Returns a string that could be directly used (or easily converted to) an address that other users of the procotol can use to communicate with us. By default this string is set to userid@servicename. Protocol implementors should override it if they'd need it to respect a different syntax.

Overrides:
getAccountAddress in class AccountID
Returns:
a String in the form of userid@service that other protocol users should be able to parse into a meaningful address and use it to communicate with us.

getDisplayName

public String getDisplayName()
The reason we need to override this method here comes from the fact that the user id that is standardly returned by the parent method is not sufficient for the user to distinguish this account from other sip accounts with the same user name. Besides we also need to handle the case of registrar-less accounts.

Overrides:
getDisplayName in class AccountID
Returns:
A String that can be showed to users when referring to this account.

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this account id.

Overrides:
equals in class AccountID
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
AccountID.hashCode(), Hashtable

getAccountPropertyString

public String getAccountPropertyString(Object key)
Returns the account property string corresponding to the given key. If property is xcap password obtain it from credential storage.

Overrides:
getAccountPropertyString in class AccountID
Parameters:
key - the key, corresponding to the property string we're looking for
Returns:
the account property string corresponding to the given key

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.