3.1.4.5.1 Absolute Positioning

The first form of specifying position in a STAT structure–based table is called Absolute Positioning. The client specifies this type of positioning by setting any value in the field CurrentRec field other than MID_CURRENT. The server uses the following steps to identify the Current Position specified by the client:

  1. First, the server MUST determine the LCID that it supports that is closest to the LCID specified by SortLocale. The server MAY choose this closest LCID in any way.

  2. The server sorts the objects in the address book container specified by ContainerID by the sort type specified in the SortType field and the LCID specified in step 1 of section 3.1.4.5.2.

  3. The server identifies the number of objects in the sorted table. The server reports this in the TotalRecs field of the STAT structure.

  4. The server locates the object specified by the CurrentRec field. If the server cannot locate the object, the Current Position in the table is undefined. The server MUST support the special Minimal Entry ID MID_BEGINNING_OF_TABLE and MID_END_OF_TABLE, as specified in section 2.2.1.8.

  5. The server verifies that the object located in step 4 is in the container specified by the ContainerID field. If the server cannot verify this, the Current Position in the table is undefined.

  6. The server moves the Current Position by the number of rows specified by the absolute value of the Delta field of the STAT structure. If the value of Delta is negative, the Current Position is moved toward the beginning of the table. If the value of Delta is positive, the Current Position is moved toward the end of the table. A Delta with the value 0 results in no change to the Current Position.

  7. If applying the Delta as described in step 6 would move the Current Position to be before the first row of the table, the server sets the Current Position to the first row of the table and sets the CurrentRec to the Minimal Entry ID of the object that occupies the first row of the table.

  8. If applying the Delta as described in step 6 would move the Current Position to be after the end of the table, the server sets the Current Position to a location one row past the last valid row of the table and sets the CurrentRec to the value MID_END_OF_TABLE.

  9. The server sets the field CurrentRec to the Minimal Entry ID of the object occupying the row specified by the Current Position.

The server identifies the numeric row of the Current Position in the sorted table. This numeric row is 0-based. That is, the first valid row in the table has the numeric position 0. This is the Numeric Position of the Current Position of the table. The server reports this in the NumPos field of the STAT structure. The server MAY report an approximate value for the Numeric Position. Although the protocol places no boundary or requirements on the accuracy of the approximate value the server returns, it is recommended that implementations maximize the accuracy of the approximation to improve usability of the Exchange NSPI server for clients.