|
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.contactsource.ContactDetail
public class ContactDetail
The ContactDetail is a detail of a SourceContact corresponding to a specific address (phone number, email, identifier, etc.), which defines the different possible types of communication and the preferred ProtocolProviderServices to go through.
Example: A ContactDetail could define two types of communication, by declaring two supported operation sets OperationSetBasicInstantMessaging to indicate the support of instant messages and OperationSetBasicTelephony to indicate the support of telephony. It may then specify a certain ProtocolProviderService to go through only for instant messages. This would mean that for sending an instant message to this ContactDetail one should obtain an instance of the OperationSetBasicInstantMessaging from the specific ProtocolProviderService and send a message through it. However when no provider is specified for telephony operations, then one should try to obtain all currently available telephony providers and let the user make their choice.
| Field Summary | |
|---|---|
static String |
CATEGORY_EMAIL
The standard/well-known category of a ContactDetail representing an e-mail address. |
static String |
CATEGORY_INSTANT_MESSAGING
The standard/well-known category of a ContactDetail representing a contact address for instant messaging. |
static String |
CATEGORY_PHONE
The standard/well-known category of a ContactDetail representing a phone number. |
static String |
LABEL_HOME
The standard/well-known label of a ContactDetail representing an address of a contact at their home. |
static String |
LABEL_MOBILE
The standard/well-known label of a ContactDetail representing a mobile contact address (e.g. |
static String |
LABEL_WORK
The standard/well-known label of a ContactDetail representing an address of a contact at their work. |
| Constructor Summary | |
|---|---|
ContactDetail(String contactAddress)
Creates a ContactDetail by specifying the contact address, corresponding to this detail. |
|
ContactDetail(String contactAddress,
String[] labels)
Initializes a new ContactDetail instance which is to represent a specific contact address and which is to be optionally labeled with a specific set of labels. |
|
ContactDetail(String contactAddress,
String category,
String[] labels)
Initializes a new ContactDetail instance which is to represent a specific contact address and which is to be optionally labeled with a specific category and a specific set of labels. |
|
| Method Summary | |
|---|---|
boolean |
containsLabel(String label)
Determines whether the set of labels of this ContactDetail contains a specific label. |
String |
getCategory()
Gets the category, if any, of this ContactQuery. |
String |
getContactAddress()
Returns the contact address corresponding to this detail. |
Collection<String> |
getLabels()
Gets the set of labels of this ContactDetail. |
String |
getPreferredProtocol(Class<? extends OperationSet> opSetClass)
Returns the name of the preferred protocol for the operation given by the opSetClass. |
ProtocolProviderService |
getPreferredProtocolProvider(Class<? extends OperationSet> opSetClass)
Returns the preferred ProtocolProviderService when using the given opSetClass. |
List<Class<? extends OperationSet>> |
getSupportedOperationSets()
Returns a list of all supported OperationSet classes, which would indicate what are the supported actions by this contact (e.g. |
void |
setPreferredProtocols(Map<Class<? extends OperationSet>,String> preferredProtocols)
Sets a mapping of a preferred preferredProtocol for a specific OperationSet. |
void |
setPreferredProviders(Map<Class<? extends OperationSet>,ProtocolProviderService> preferredProviders)
Sets a mapping of preferred ProtocolProviderServices for a specific OperationSet. |
void |
setSupportedOpSets(List<Class<? extends OperationSet>> supportedOpSets)
Creates a ContactDetail by specifying the corresponding contact address and a list of all supportedOpSets, indicating what are the supporting actions with this contact detail (e.g. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CATEGORY_EMAIL
public static final String CATEGORY_INSTANT_MESSAGING
public static final String CATEGORY_PHONE
public static final String LABEL_HOME
public static final String LABEL_MOBILE
public static final String LABEL_WORK
| Constructor Detail |
|---|
public ContactDetail(String contactAddress)
contactAddress - the contact address corresponding to this detail
public ContactDetail(String contactAddress,
String[] labels)
contactAddress - the contact address to be represented by the new
ContactDetail instancelabels - the set of labels with which the new ContactDetail
instance is to be labeled. The labels may be arbitrary and may include
any of the standard/well-known labels defined by the LABEL_XXX
constants of the ContactDetail class. For the sake of
convenience, null and duplicate values in the specified
String[] labels will be ignored i.e. will not appear in
the set of labels reported by the new ContactDetail instance
later on. Additionally, the category of the new
ContactDetail instance will be implied from the specified
labels by looking for the standard/well-known categories defined
by the CATEGORY_XXX constants of the ContactDetail
class
public ContactDetail(String contactAddress,
String category,
String[] labels)
contactAddress - the contact address to be represented by the new
ContactDetail instancecategory - the category (such as one of the CATEGORY_XXX
constants defined by the ContactDetail class, for example) to be
assigned to the new ContactDetail instancelabels - the set of labels with which the new ContactDetail
instance is to be labeled. The labels may be arbitrary and may include
any of the standard/well-known labels defined by the LABEL_XXX
constants of the ContactDetail class. For the sake of
convenience, null and duplicate values in the specified
String[] labels will be ignored i.e. will not appear in
the set of labels reported by the new ContactDetail instance
later on.| Method Detail |
|---|
public void setPreferredProviders(Map<Class<? extends OperationSet>,ProtocolProviderService> preferredProviders)
preferredProviders - a mapping of preferred
ProtocolProviderServices for specific OperationSet
classespublic void setPreferredProtocols(Map<Class<? extends OperationSet>,String> preferredProtocols)
preferredProtocols - a mapping of preferred
ProtocolProviderServices for specific OperationSet
classespublic void setSupportedOpSets(List<Class<? extends OperationSet>> supportedOpSets)
supportedOpSets - a list of all supportedOpSets, indicating
what are the supporting actions with this contact detail (e.g. sending a
message, making a call, etc.)public String getCategory()
CATEGORY_PHONE or CATEGORY_EMAIL.
public String getContactAddress()
public ProtocolProviderService getPreferredProtocolProvider(Class<? extends OperationSet> opSetClass)
opSetClass - the OperationSet class corresponding to a
certain action (e.g. sending an instant message, making a call, etc.).
public String getPreferredProtocol(Class<? extends OperationSet> opSetClass)
opSetClass - the OperationSet class corresponding to a
certain action (e.g. sending an instant message, making a call, etc.).
public List<Class<? extends OperationSet>> getSupportedOperationSets()
public boolean containsLabel(String label)
label - the label to be determined whether it is contained in the
set of labels of this ContactDetail
public Collection<String> getLabels()
|
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 | |||||||||