3.4.5.1.1.3 Processing Details

If the Type field of the request body does not contain one of the listed values, the server MUST fail the request with status code 400 and set x-ecs-request-error to ECS_E_SYNC_INVALID_SESSION_TYPE, as specified in section 2.2.2.28.

The server MUST look up all Sessions in SessionList where Session.Client_ID matches ClientID in the request. If the number of Sessions found is greater than or equal to an implementation-specific value<8>, the server MUST set x-ecs-request-error to ECS_E_SYNC_TOO_MANY_SESSIONS, as specified in section 2.2.2.28.

The Server MUST search for the Session object in SessionList where Session.Client_ID matches with the ClientID in the request.

If Session is not found, the server MUST create a new Session and initialize the following values:

  • SessionLocationURL MUST be set to an implementation-specific URL that provides access to this session.

  • SessionId MUST be set to an implementation-specific string that identifies the session.

  • Client_ID MUST be set to ClientID in the request.

  • SessionType MUST be set to Type in the request.

The server MUST insert the Session in SessionList and the server MUST set the HTTP status code to 201.

If Session is found and Session.SessionType matches with Type in the request, the server MUST set the HTTP status code to 200.

If Session is found and SessionType does not match with Type in the request, the server MUST create a new session and set the values as specified above.

If a session is found and Session.SessionType is 0x03 (Upload with full enumeration) or 0x04 (Download with full enumeration), the server MUST set x-ecs-request-error to ECS_E_SYNC_SESSION_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 a session is found and in the following conditions, the server MUST create a new Session object:

  • Session.SessionType is 0x01 (Upload) and Type in the request is 0x03 (Upload with full enumeration).

  • Session.SessionType is 0x02 (Download) and Type in the request is 0x04 (Download with full enumeration).

  • Session.SessionType is 0x01 (Upload) or 0x03 (Upload with full enumeration) and Type in the request is 0x02 (Download) or 0x04 (Download with full enumeration).

  • Session.SessionType is 0x02 (Download) or 0x04 (Download with full enumeration) and Type in the request is 0x01 (Upload) or 0x03 (Upload with full enumeration).

The server MUST initialize the Session object with the following values:

  • SessionLocationURL MUST be set to an implementation-specific URL that provides access to this session.

  • SessionId MUST be set to Session.SessionId.

  • Client_ID MUST be set to ClientID in the request.

  • SessionType MUST be set to Type in the request.

The server MUST set the HTTP status code to 200 and MUST send the response to the client.