Product DocsMenu

Coveo Platform 6.5 >
Developer Help > Open Connector API > Interfaces > ISaveRestorePersistentData Interface

ISaveRestorePersistentData Interface

The ISaveRestorePersistentData interface is useful when the connector must save data that has to be persisted. It only has two functions: SaveData and LoadData. For simple operations, this interface is less complicated to implement and use than the IHasPersistentData interface. On the other hand, it does not provide the same level of valid security on the data, as it does not implement the PreCommit, Commit and Rollback systems CES uses.

  • SaveData: Called to return an object that is persisted on a file. For example, the object can survive shutdowns. The object needs to be serializable.

  • LoadData: Called to receive the object that is stored using SaveData in parameter. 

[Serializable]
public class Info
{
// A string we want to save.
public string m_StartingAddress;
// Any other information to save.
}

private Info m_Save Info = null;

object ISaveRestorePersistentData.SaveData()
{
return m_SaveInfo;
}
//************************************************************************
/// <inheritDoc/>
//************************************************************************
void ISaveRestorePersistentData.RestoreData(object p_Data)
{
m_SaveInfo = (Info)p_Data;
}