3.4.5 Message Processing Events and Sequencing Rules
If x-ecs-partnershipID is not present in the request header, the server MUST set x-ecs-request-error to ECS_E_SYNC_REQUIRED_HTTP_HEADER_MISSING, as specified in section 2.2.2.28, and the HTTP status code to 400. The server MUST send the response to the client.
The server MUST obtain the share name, user folder, and user identifier from x-ecs-partnershipID in the request in an implementation-specific manner. If none of them are available on the server, the server MUST set x-ecs-request-error to ECS_E_SYNC_INVALID_PROTOCOL_FORMAT, as specified in section 2.2.2.28, and the HTTP status code to 400. The server MUST send the response to the client.
The server MUST look up ClientRequestsCount in ClientRequestsCountTable where ClientRequestsCount.UserId matches with the user identifier of the requesting user, obtained from x-ecs-partnershipID in the request.
If ClientRequestsCount.Count is greater than or equal to an implementation-specific value<7>, the server MUST set x-ecs-request-error to ECS_E_SYNC_SERVER_BUSY, as specified in section 2.2.2.28, and the HTTP status code to 503. The server MUST send the response to the client.
If the client is required to re-establish sync partnership with the server, the server MUST set x-ecs-request-error to ECS_E_DISCOVERY_NEEDED, as specified in section 2.2.2.28, and the HTTP status code to 403. The server MUST send the response to the client.
If access to the server is paused, the server MUST set x-ecs-request-error to ECS_E_ERROR_SYNC_SHARE_BLOCKED, as specified in section 2.2.2.28, and the HTTP status code to 503. The server MUST send the response to the client.
The server MUST increment ClientRequestsCount.Count by 1.
The server MUST continue to process the request. After sending the response to the client, the server MUST decrement ClientRequestsCount.Count by 1.
|
Resource |
Description |
|---|---|
|
Create Session |
The resource used to create a new session on the server. |
|
Sync Batch Parameters |
The resource used to retrieve or update synchronization batch parameters. |
|
Prepare Batch |
The resource used to send information to the server to prepare for the change batch. |
|
Upload Batch |
The resource used to commit a change batch on the server. |
|
Delete Session |
The resource used to delete a sync session on the server. |
|
Download Batch |
The resource used to receive a change batch from the server to the client. |
The responses to all the operations can result in the following status codes.
|
Status code |
Reason phrase |
Description |
|---|---|---|
|
200 |
OK |
Success. See individual methods on each resource in the subsequent sections for more details. |
|
201 |
Created |
Session created. |
|
400 |
Bad Request |
Batch is out of sequence, or the last batch has already been received. |
|
404 |
Not Found |
No session exists with the specified ID. |
|
500 |
|
Unexpected server error |
|
202 |
Accepted |
An asynchronous operation for retrieving the sync batch parameters has started. |
|
409 |
Conflict |
Batch already received. |