Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Interface OperationSetServerStoredContactInfo

All Superinterfaces:
OperationSet
All Known Implementing Classes:
OperationSetServerStoredContactInfoIcqImpl, OperationSetServerStoredContactInfoJabberImpl

public interface OperationSetServerStoredContactInfo
extends OperationSet

The User Info Operation set is a means of accessing detailed information of Contacts that have made it available on-line (on a protocol server, p2p net or others). Examples of such details are your picture, postal or e-mail addresses, work, hobbies, interests, and many many others.

Various types of details have been defined in the ServerStoredDetails class and can be used with the get methods of this interface. Implementors may also define their own details by extending or instantiating the ServerStoredDetails.GenericDetail class.

Note that this is a read only Operation Set, as it only provides access to information stored by Contacts themselves, and not notes that you have been adding for them..

The OperationSetServerStoredContactInfo only concerns Contact-s other than us. For accessing and modifying the information of the user that we are logged in with, we need to use the OperationSetServerStoredAccountInfo

Author:
Emil Ivov

Nested Class Summary
static interface OperationSetServerStoredContactInfo.DetailsResponseListener
          Retrieving details can take some time, this listener will inform when retrieving has ended and will return the details if any.
 
Method Summary
 Iterator<ServerStoredDetails.GenericDetail> getAllDetailsForContact(Contact contact)
          Returns all details existing for the specified contact.
 Iterator<ServerStoredDetails.GenericDetail> getDetails(Contact contact, Class<? extends ServerStoredDetails.GenericDetail> detailClass)
          Returns an iterator over all details that are instances of exactly the same class as the one specified.
 Iterator<ServerStoredDetails.GenericDetail> getDetailsAndDescendants(Contact contact, Class<? extends ServerStoredDetails.GenericDetail> detailClass)
          Returns an iterator over all details that are instances or descendants of the specified class.
 Iterator<ServerStoredDetails.GenericDetail> requestAllDetailsForContact(Contact contact, OperationSetServerStoredContactInfo.DetailsResponseListener listener)
          Requests all details existing for the specified contact.
 

Method Detail

getDetailsAndDescendants

Iterator<ServerStoredDetails.GenericDetail> getDetailsAndDescendants(Contact contact,
                                                                     Class<? extends ServerStoredDetails.GenericDetail> detailClass)
Returns an iterator over all details that are instances or descendants of the specified class. If for example an existing contact has a workaddress and an address detail, a call to this method with AddressDetail.class would return both of them.

Parameters:
detailClass - one of the detail classes defined in the ServerStoredDetails class, indicating the kind of details we're interested in.
contact - the contact whose details we're interested in.

Returns:
a java.util.Iterator over all details that are instances or descendants of the specified class.

getDetails

Iterator<ServerStoredDetails.GenericDetail> getDetails(Contact contact,
                                                       Class<? extends ServerStoredDetails.GenericDetail> detailClass)
Returns an iterator over all details that are instances of exactly the same class as the one specified. Not that, contrary to the getDetailsAndDescendants() method this one would only return details that are instances of the specified class and not only its descendants. If for example an existing contact has both a workaddress and an address detail, a call to this method with AddressDetail.class would return only the AddressDetail instance and not the WorkAddressDetail instance.

Parameters:
detailClass - one of the detail classes defined in the ServerStoredDetails class, indicating the kind of details we're interested in.
contact - the contact whose details we're interested in.

Returns:
a java.util.Iterator over all details of specified class.

getAllDetailsForContact

Iterator<ServerStoredDetails.GenericDetail> getAllDetailsForContact(Contact contact)
Returns all details existing for the specified contact.

Parameters:
contact - the specified contact
Returns:
a java.util.Iterator over all details existing for the specified contact.

requestAllDetailsForContact

Iterator<ServerStoredDetails.GenericDetail> requestAllDetailsForContact(Contact contact,
                                                                        OperationSetServerStoredContactInfo.DetailsResponseListener listener)
Requests all details existing for the specified contact.

Parameters:
contact - the specified contact
Returns:
a java.util.Iterator over all details existing for the specified contact. If there are missing in the local cache null value will be returned and they will be scheduled for retrieve. The listener will be used to inform that retrieve has finished.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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