|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vodafone360.people.engine.BaseEngine
com.vodafone360.people.engine.content.ContentEngine
public class ContentEngine
Content engine for downloading and uploading all kind of content (pictures, videos, files)
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.vodafone360.people.engine.BaseEngine |
|---|
BaseEngine.IEngineEventCallback |
| Field Summary | |
|---|---|
private DatabaseHelper |
mDbHelper
Instance of DatabaseHelper. |
private FiFoQueue |
mDownloadQueue
Queue with ContentObjects for downloads. |
private FiFoQueue |
mUnprocessedQueue
Queue with unprocessed ContentObjects. |
private FiFoQueue |
mUploadQueue
Queue with ContentObjects for uploads. |
private java.util.Hashtable<java.lang.Integer,ContentObject> |
requestContentObjectMatchTable
Hashtable to match requests to ContentObjects. |
| Fields inherited from class com.vodafone360.people.engine.BaseEngine |
|---|
mActiveUiRequest, mCurrentTimeout, mEngineId, mEventCallback |
| Constructor Summary | |
|---|---|
ContentEngine(BaseEngine.IEngineEventCallback eventCallback,
DatabaseHelper dbHelper)
Constructor for the ContentEngine. |
|
| Method Summary | |
|---|---|
DatabaseHelper |
getDatabaseHelper()
Getter for the local instance of DatabaseHelper. |
long |
getNextRunTime()
Determines the next RunTime of this Engine It first processes the in-queue and then look. |
void |
onCreate()
Empty implementation without function at the moment. |
void |
onDestroy()
Empty implementation without function at the moment. |
protected void |
onRequestComplete()
Empty implementation without function at the moment. |
protected void |
onTimeoutEvent()
Empty implementation without function at the moment. |
protected void |
processCommsResponse(ResponseQueue.Response resp)
Processes the response Finds the matching contentobject for the repsonse using the id of the response and sets its status to done. |
void |
processContentObject(ContentObject co)
Processes one ContentObject. |
void |
processContentObjects(java.util.List<ContentObject> list)
Iterates over the ContentObject list and processes every element. |
private void |
processQueue()
Processes the main queue and splits it into the download and upload queues. |
protected void |
processUiRequest(ServiceUiRequest requestId,
java.lang.Object data)
Empty implementation of abstract method from BaseEngine. |
void |
run()
run method of this engine iterates over the downloadqueue, makes requests out of ContentObjects and puts them into QueueManager queue. |
| Methods inherited from class com.vodafone360.people.engine.BaseEngine |
|---|
addUiRequestToQueue, clearTimeout, completeUiRequest, completeUiRequest, deactivateEngine, emptyUiRequestQueue, engineId, genericHandleResponseType, getCurrentTimeout, isCommsResponseOutstanding, isDeactivated, isUiRequestOutstanding, onCommsInMessage, onReset, processCommsInQueue, processTimeout, processUiQueue, setReqId, setTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private FiFoQueue mUnprocessedQueue
private FiFoQueue mDownloadQueue
private FiFoQueue mUploadQueue
private DatabaseHelper mDbHelper
private java.util.Hashtable<java.lang.Integer,ContentObject> requestContentObjectMatchTable
| Constructor Detail |
|---|
public ContentEngine(BaseEngine.IEngineEventCallback eventCallback,
DatabaseHelper dbHelper)
eventCallback - IEngineEventCallback for calling the constructor of
the super classdbHelper - Instance of DatabaseHelper| Method Detail |
|---|
public final DatabaseHelper getDatabaseHelper()
public final void processContentObject(ContentObject co)
co - ContentObject to be processedpublic final void processContentObjects(java.util.List<ContentObject> list)
list - List with ContentObjects which are to be processedprivate void processQueue()
public final long getNextRunTime()
getNextRunTime in class BaseEnginepublic void onCreate()
onCreate in class BaseEnginepublic void onDestroy()
onDestroy in class BaseEngineprotected void onRequestComplete()
onRequestComplete in class BaseEngineprotected void onTimeoutEvent()
onTimeoutEvent in class BaseEngineprotected final void processCommsResponse(ResponseQueue.Response resp)
processCommsResponse in class BaseEngineresp - Response object that has been processed
protected void processUiRequest(ServiceUiRequest requestId,
java.lang.Object data)
processUiRequest in class BaseEnginerequestId - The UI request IDdata - Request data (object type is request specific)public final void run()
run in class BaseEngine
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
JavaDoc