3.1.4.2 Opening an Existing Graph
When opening an existing graph, the application MUST supply the following information:
A graph ID to uniquely identify the graph to be opened. See Graph ID in section 3.1.1.
The Peer ID of the peer opening the graph. See Peer ID in section 3.1.1.
If the graph has been created with a graph security provider, the same graph security provider MUST be provided.
The application MAY also provide the following information:
An optional array of prioritized record types that will have precedence during synchronization.
The local node MUST do the following:
Assign the above values to Graph ID, Peer ID, GraphSecurityProvider, and Prioritized Record Types, respectively. (The latter MUST be assigned a null value if the application did not provide one.)
Create a local Node ID as a random 64-bit number.
Create the (empty) database. If the local node has a persisted database (see section 3.1.4.12), this persisted database SHOULD be loaded into the empty database. Each record in the persisted database MUST first be validated before inclusion in the database. For more details, see section 3.1.7.27. When loading a persisted database, the Presence, Signature, and Contact Records MUST NOT be included.
If a persistent database is loaded, the NeverConnected flag MUST be initialized to FALSE.
If a persistent database is not loaded, the NeverConnected flag MUST be initialized to TRUE.
If the local node has a persisted database (see section 3.1.4.12) accompanied by a persisted Peer Time Delta, the local node MUST use the persisted Peer Time Delta. Otherwise, it MUST set the Peer Time Delta to 0.
The Autorefresh Timer MUST be set to expire in 4 seconds.
If Defer Expiration is false, the Record Expiration Timer MUST be set to expire in 0 seconds.