3.1.7.17 Presence Maintenance

The presence maintenance process ensures that the local node publishes its presence record when valid, and strives to maintain the configured number of presence records in the graph.

A node performing presence maintenance MUST do the following:

  • If the local node currently has a presence record for its node ID in the graph database with its Deleted flag unset, but is no longer listening (as indicated by the IsListening flag), the node MUST delete the presence record for its node ID from the database, as specified in section 3.1.7.9.

  • If the local node currently does not have a presence record for its node ID in the graph database, or the record is expired, or the record has its Deleted flag set, but it is listening (as indicated by the IsListening flag) and either Max Presence Records is -1 or the application has forced publication (as indicated by the Force Publish Presence flag), the node MUST publish its presence record, as specified in section 3.1.7.4.

  • If Max Presence Records is not 0 or -1 and the Force Publish Presence flag is unset:

    • If the local node currently has a presence record in the graph database with the local node's node ID and with its Deleted flag unset, and the number of presence records in the graph database is greater than Max Presence Records + 10, the Presence Timer MUST be set to fire at a random delay between 30 seconds and 180 seconds. For more details, see section 3.1.6.9.

    • If the local node currently does not have a presence record containing its node ID in the graph database, or all such records have their Deleted flags set, and the number of presence recordsĀ  in the database is less than Max Presence Records, the Presence Timer MUST be set to fire at a random delay between 30 seconds and 180 seconds.