|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.engine.content.ThumbnailHandler
public class ThumbnailHandler
ThumbnailHandler is a handler for contents. The ContentEngine uses handlers to handle transfers of ContentObjects. The handler implements the TransferListener interface and registers itself in the ContentObjects before sending them to the ContentEngine. The ContentEngine calls the TransferListener on a ContentObject after a transfer completes. The ThumbnailHandler handles the fetching of thumbnails for contacts, saving them and refreshing the list.
Field Summary | |
---|---|
private static int |
MAX_QUALITY
Used only for jpeg but mandatory for some calls. |
private static int |
MAX_THUMBS_FETCHED_PER_PAGE
Number of thumbnails to fetch in a single RPG request batch. |
private java.util.List<Contact> |
mContactsQueue
Queue with contacts to fetch thumbnails for. |
private java.util.List<ContentObject> |
mContentObjects
List with ContentObjects. |
private static ThumbnailHandler |
mThumbnailHandlerInstance
instance of ThumbnailHandler. |
Constructor Summary | |
---|---|
private |
ThumbnailHandler()
Private constructor. |
Method Summary | |
---|---|
void |
downloadContactThumbnails(java.util.List<Contact> contactList)
Puts the contactlist in to a queue and starts downloading the thumbnails for them. |
private void |
downloadThumbnails()
Download the next bunch of contacts from the queue. |
static ThumbnailHandler |
getInstance()
Factory method for creating and getting singleton instance of this handler. |
private DatabaseHelper.ThumbnailInfo |
getThumbnailForContact(java.util.List<DatabaseHelper.ThumbnailInfo> thumbnailInfoList,
Contact contact)
Returns a ThumbanailInfo for a given Contact from a list of ThumbnailInfos. |
void |
transferComplete(ContentObject content)
Called by ContentEngine when a Transfer is done. |
void |
transferError(ContentObject content,
java.lang.RuntimeException exc)
Called when there was an error transfering a ContentObject. |
void |
uploadServerThumbnails()
Dummy method to replace the dummy processor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static ThumbnailHandler mThumbnailHandlerInstance
private static final int MAX_THUMBS_FETCHED_PER_PAGE
private static final int MAX_QUALITY
private java.util.List<Contact> mContactsQueue
private java.util.List<ContentObject> mContentObjects
Constructor Detail |
---|
private ThumbnailHandler()
Method Detail |
---|
public static ThumbnailHandler getInstance()
public final void transferComplete(ContentObject content)
transferComplete
in interface TransferListener
content
- Transfered ContentObject containing the Thumbnailpublic final void transferError(ContentObject content, java.lang.RuntimeException exc)
transferError
in interface TransferListener
content
- The failing ContentObjectexc
- RuntimeException explaining what happenedprivate DatabaseHelper.ThumbnailInfo getThumbnailForContact(java.util.List<DatabaseHelper.ThumbnailInfo> thumbnailInfoList, Contact contact)
thumbnailInfoList
- List with all available Thumbnailscontact
- A Contact object for which the ThumbnailInfo is to be
searched for
public final void downloadContactThumbnails(java.util.List<Contact> contactList)
contactList
- List of contacts to download the thumbnails forprivate void downloadThumbnails()
public void uploadServerThumbnails()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc