Default implementation

The default implementation renumbers wait list entries in a wait list. The wait list entry position is incremented or decremented if there is an insertion or removal or allocation or expiry of an entry in the list.

When creating a new wait list entry system increments the position by 1 for all the wait list entries in an 'open' state with a position higher than or equal to the position of the entry to be added to the wait list.

When a wait list entry is canceled or expired, system decrements the position by 1 for all wait list entries in an 'Open' state with a position higher than the position of the entry being removed or expired from the wait list.

The usage of this implementation in operations Create/Modify/Cancel/Expire/Allocate a Wait List Entry in a Wait List has been explained below with example.

Create Wait List Entry: When creating a new wait list entry, if a wait list requires renumbering then system calls wait list renumbering API. Wait list renumbering API increments the position by 1 for all 'Open' state wait list entries with a position higher than or equal to the position of the entry to be added to the wait list. After renumbering the existing wait list entries, system adds the client (i.e. a wait list entry) to the wait list as per the specified position.

For example, if there are 10 clients waiting for a resource with position from 1 to 10. If a new wait list entry to be created at position 5. System will first try to empty the position 5 by incrementing position by 1 for all entries which are greater than or equal to 5 by using wait list renumbering API and then insert the new record with position 5.

Cancel/Expire/Allocate a Wait List Entry: After cancelling/Expiring/Allocating a wait list entry, if a wait list requires renumbering then system calls wait list renumbering API. The wait list renumbering API decrements the position by 1 for all 'Open' state wait list entries with a position higher than the position of the removed entry from the wait list.

For example, if there are 10 clients waiting for a resource with position from 1 to 10.If a wait list entry (i.e. a client) at position 5 is removed from the wait list, then system will decrement position by 1 for all entries which are having the position greater than 5 by using wait list renumbering API.

Update Wait List Entry: In case of update wait list entry, system first checks whether there is change in the position. If yes then check whether position renumbering is required. If renumbering is required, then system calls wait list renumbering API to reshuffle the wait list entries position.

For example, if there are 10 clients waiting for a resource with position from 1 to 10. When modifying the wait list entry at position 6, if user changed the position value from 6 to 8 then system first decrements the position by 1 for all 'Open' state wait list entries with a position higher than the original position (i.e.6) and then increment the position by 1 for all 'Open' state wait list entries with a position higher than or equal to the newly specified position (i.e.8). This creates an empty block so that our modified wait list entry goes and gets placed there.

Note: For more information, on how to provide a compliant implementation for an interface, see the section 'How to provider a compliant implementation for an interface that is marked as an extension point within the framework' in Cúram Provider ManagementCúram Provider Management Developers Guide.