|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.service.protocol.AccountID
public abstract class AccountID
The AccountID is an account identifier that, uniquely represents a specific user account over a specific protocol. The class needs to be extended by every protocol implementation because of its protected constructor. The reason why this constructor is protected is mostly avoiding confusion and letting people (using the protocol provider service) believe that they are the ones who are supposed to instantiate the accountid class.
Every instance of the ProtocolProviderService, created through the ProtocolProviderFactory is assigned an AccountID instance, that uniquely represents it and whose string representation (obtained through the getAccountUID() method) can be used for identification of persistently stored account details.
Account id's are guaranteed to be different for different accounts and in the same time are bound to be equal for multiple installations of the same account.
| Field Summary | |
|---|---|
protected Map<String,String> |
accountProperties
Contains all implementation specific properties that define the account. |
| Constructor Summary | |
|---|---|
protected |
AccountID(String userID,
Map<String,String> accountProperties,
String protocolName,
String serviceName)
Creates an account id for the specified provider userid and accountProperties. |
| 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 protocol can use to communicate with us. |
Map<String,String> |
getAccountProperties()
Returns a Map containing protocol and implementation account initialization properties. |
Object |
getAccountProperty(Object key)
Returns the specific account property. |
boolean |
getAccountPropertyBoolean(Object key,
boolean defaultValue)
Returns the specific account property. |
int |
getAccountPropertyInt(Object key,
int defaultValue)
Gets the value of a specific property as a signed decimal integer. |
String |
getAccountPropertyString(Object key)
Returns the account property string corresponding to the given key. |
String |
getAccountUniqueID()
Returns a String uniquely identifying this account, guaranteed to remain the same across multiple installations of the same account and to always be unique for differing accounts. |
String |
getDisplayName()
Returns a name that can be displayed to the user when referring to this account. |
String |
getProtocolDisplayName()
Returns the display name of the protocol. |
String |
getProtocolName()
Returns the name of the protocol. |
String |
getService()
Returns the name of the service that defines the context for this account. |
String |
getUserID()
Returns the user id associated with this account. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isEnabled()
Indicates if this account is currently enabled. |
void |
putAccountProperty(String key,
String value)
Adds a property to the map of properties for this account identifier. |
void |
removeAccountProperty(String key)
Removes specified account property. |
void |
setAccountProperties(Map<String,String> accountProperties)
Set the account properties. |
String |
toString()
Returns a string representation of this account id (same as calling getAccountUniqueID()). |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,String> accountProperties
| Constructor Detail |
|---|
protected AccountID(String userID,
Map<String,String> accountProperties,
String protocolName,
String serviceName)
userID - a String that uniquely identifies the user.accountProperties - a Map containing any other protocol and
implementation specific account initialization propertiesprotocolName - the name of the protocol implemented by the provider
that this id is meant for.serviceName - the name of the service (e.g. iptel.org, jabber.org,
icq.com) that this account is registered with.| Method Detail |
|---|
public String getUserID()
public String getDisplayName()
public String getProtocolDisplayName()
public String getProtocolName()
public String getAccountUniqueID()
public Map<String,String> getAccountProperties()
public Object getAccountProperty(Object key)
key - property key
public boolean getAccountPropertyBoolean(Object key,
boolean defaultValue)
key - property keydefaultValue - default value if the property does not exist
public int getAccountPropertyInt(Object key,
int defaultValue)
Integer.parseInt(String) . If parsing the value as a signed
decimal integer fails or there is no value associated with the specified
property key, defaultValue is returned.
key - the key of the property to get the value of as a
signed decimal integerdefaultValue - the value to be returned if parsing the value of the
specified property key as a signed decimal integer fails or there is no
value associated with the specified property key in this
AccountID
public String getAccountPropertyString(Object key)
key - the key, corresponding to the property string we're looking
for
public void putAccountProperty(String key,
String value)
key - the key of the propertyvalue - the property valuepublic void removeAccountProperty(String key)
key - the key to remove.public int hashCode()
hashCode in class ObjectObject.equals(java.lang.Object),
Hashtablepublic boolean equals(Object obj)
equals in class Objectobj - the reference object with which to compare.
hashCode(),
Hashtablepublic String toString()
toString in class Objectpublic String getService()
public String getAccountAddress()
public boolean isEnabled()
public void setAccountProperties(Map<String,String> accountProperties)
accountProperties - the properties of the account
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||