|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SyncListener
This class represents a generic Sync Listener, an object that listens to the synchronization of a repository. The synchronization is a sequence of events that occour in a certain order. There are three different phases:
Field Summary | |
---|---|
static int |
ACCESS_ERROR
|
static int |
BACKEND_AUTH_ERROR
|
static int |
BACKEND_ERROR
|
static int |
CANCELLED
|
static int |
CLIENT_ERROR
|
static int |
COMPRESSED_RESPONSE_ERROR
|
static int |
CONN_NOT_FOUND
|
static int |
CONNECTION_BLOCKED_BY_USER
|
static int |
DATA_NULL
|
static int |
DEVICE_FULL_ERROR
|
static int |
ERROR_RECEIVING_ITEMS
|
static int |
ERROR_SENDING_ITEMS
|
static int |
FORBIDDEN_ERROR
|
static int |
GENERIC_ERROR
|
static int |
ILLEGAL_ARGUMENT
|
static int |
INVALID_CREDENTIALS
|
static int |
ITEMS_NUMBER_UNKNOWN
Used when the messages to send or received is not know to the mail protocol subsystem |
static int |
READ_SERVER_RESPONSE_ERROR
|
static int |
SERVER_BUSY
|
static int |
SERVER_CONNECTION_REQUEST_ERROR
|
static int |
SERVER_ERROR
|
static int |
SERVER_READ_ERROR
|
static int |
SERVER_WRITE_ERROR
|
static int |
SMART_SLOW_SYNC_UNSUPPORTED
|
static int |
SUCCESS
|
static int |
URI_NOT_FOUND_ERROR
|
static int |
WRITE_SERVER_REQUEST_ERROR
|
Method Summary | |
---|---|
void |
dataReceived(java.lang.String date,
int size)
Invoked each time data is received from the server, with the timestamp and the size in bytes of the receive data. |
void |
endConnecting(int action)
Invoked at the end of the login phase. |
void |
endMapping()
Invoked at the end of the mapping phase |
void |
endReceiving()
Invoked at the end of the receiving phase |
void |
endSending()
Invoked when the mail protocol subsystem has finished to send message. |
void |
endSession(SyncReport report)
Invoked at the end of a session after the last message was exchanged (or an error occurred). |
void |
endSyncing()
Invoked at the end of the syncing phase |
void |
itemAddChunkSent(java.lang.String key,
java.lang.String parent,
int size)
Invoked when a chunk of a new item was sent |
void |
itemAddSendingEnded(java.lang.String key,
java.lang.String parent,
int size)
Invoked when the sending of a new item has terminated |
void |
itemAddSendingStarted(java.lang.String key,
java.lang.String parent,
int size)
Invoked when the sending of a new item has started |
void |
itemDeleted(java.lang.Object item)
Invoked each time a message is deleted |
void |
itemDeleteSent(java.lang.Object item)
Invoked each time an item deleted is sent to the server. |
void |
itemReceived(java.lang.Object item)
Invoked each time a message is received and stored successfully in the client. |
void |
itemReplaceChunkSent(java.lang.String key,
java.lang.String parent,
int size)
Invoked when a chunk of a replaced item was sent |
void |
itemReplaceSendingEnded(java.lang.String key,
java.lang.String parent,
int size)
Invoked when the sending of a replaced item has terminated |
void |
itemReplaceSendingStarted(java.lang.String key,
java.lang.String parent,
int size)
Invoked when the sending of a replaced item has started |
void |
itemUpdated(java.lang.Object item)
Invoked when an item changes on the other side. |
void |
itemUpdated(java.lang.Object item,
java.lang.Object update)
Invoked when an item changes on the other side. |
void |
startConnecting()
Invoked at the beginning of the login phase. |
void |
startMapping()
Invoked at the beginning of the mapping phase |
void |
startReceiving(int number)
Invoked when items are ready to be received from the server. |
void |
startSending(int numNewItems,
int numUpdItems,
int numDelItems)
Invoked before beginning to send items to the server. |
void |
startSession()
Invoked at the beginning of the session, before opening the connection with the server |
boolean |
startSyncing(int alertCode,
DevInf devInf)
Invoked at the beginning of the syncing phase |
void |
syncStarted(int alertCode)
Invoked when the sync starts |
Field Detail |
---|
static final int SUCCESS
static final int INVALID_CREDENTIALS
static final int FORBIDDEN_ERROR
static final int CONN_NOT_FOUND
static final int SERVER_READ_ERROR
static final int SERVER_WRITE_ERROR
static final int CLIENT_ERROR
static final int ACCESS_ERROR
static final int DATA_NULL
static final int ILLEGAL_ARGUMENT
static final int SERVER_ERROR
static final int SERVER_BUSY
static final int BACKEND_ERROR
static final int BACKEND_AUTH_ERROR
static final int URI_NOT_FOUND_ERROR
static final int READ_SERVER_RESPONSE_ERROR
static final int WRITE_SERVER_REQUEST_ERROR
static final int SERVER_CONNECTION_REQUEST_ERROR
static final int CONNECTION_BLOCKED_BY_USER
static final int SMART_SLOW_SYNC_UNSUPPORTED
static final int CANCELLED
static final int GENERIC_ERROR
static final int ERROR_SENDING_ITEMS
static final int ERROR_RECEIVING_ITEMS
static final int COMPRESSED_RESPONSE_ERROR
static final int DEVICE_FULL_ERROR
static final int ITEMS_NUMBER_UNKNOWN
Method Detail |
---|
void startSession()
void endSession(SyncReport report)
report
- this is a summary of what happened during the sync,
including the overall status.void startConnecting()
void endConnecting(int action)
action
- describes the action the server requires (this value is
repository dependent)void syncStarted(int alertCode)
alertCode
- is the code returned by the server at the end of the
connection phaseserverDevInf
- is thevoid endSyncing()
void startMapping()
void endMapping()
void startReceiving(int number)
number
- number of items that will be sent during the
session, if known, or ITEMS_NUMBER_UNKNOWN otherwise.void endReceiving()
void itemReceived(java.lang.Object item)
item
- is the new value receivedvoid itemDeleted(java.lang.Object item)
itemId
- is the id of the value being removedvoid itemUpdated(java.lang.Object item, java.lang.Object update)
item
- is the item that changedupdate
- is an encoding (client depending) of the updatevoid itemUpdated(java.lang.Object item)
item
- is the item that changedvoid dataReceived(java.lang.String date, int size)
date
- is the timestampsize
- is the number of bytes receivedvoid startSending(int numNewItems, int numUpdItems, int numDelItems)
numNewItems
- number of new items to be sentnumUpdItems
- number of updated items to be sentnumDelItems
- number of deleted items to be sentvoid itemAddSendingStarted(java.lang.String key, java.lang.String parent, int size)
key
- is the item keyparent
- is the item parentsize
- is the item size (total size, regardless of chunking)void itemAddSendingEnded(java.lang.String key, java.lang.String parent, int size)
key
- is the item keyparent
- is the item parentsize
- is the item size (total size, regardless of chunking)void itemAddChunkSent(java.lang.String key, java.lang.String parent, int size)
key
- is the item keyparent
- is the item parentsize
- is the item size (chunk size)void itemReplaceSendingStarted(java.lang.String key, java.lang.String parent, int size)
key
- is the item keyparent
- is the item parentsize
- is the item size (total size, regardless of chunking)void itemReplaceSendingEnded(java.lang.String key, java.lang.String parent, int size)
key
- is the item keyparent
- is the item parentsize
- is the item size (total size, regardless of chunking)void itemReplaceChunkSent(java.lang.String key, java.lang.String parent, int size)
key
- is the item keyparent
- is the item parentsize
- is the item size (chunk size)void itemDeleteSent(java.lang.Object item)
void endSending()
boolean startSyncing(int alertCode, DevInf devInf)
alertCode
- is the code returned by the server at the end of the
connection phaseserverDevInf
- is the server device info if they are provided by the
server. The server can send its dev inf if they changed or if the client
requested them (@see SyncManager.sync). This value may be null if the
server did not provide its device information.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |