# The Python IoTReplicator Class

> The IoTReplicator object manages the replication process interfacing with the IoTCommunicator on one side and with the database on the other.

> IoTReplicator(...) | Constructor: create an IoTReplicator instance
> connect(...) | Connect with an IoTCommunicator
> sync(agent_id, flags) | Perform synchronization with the server database
> clear(agent_id) | Delete data transmitted and acknowledged by the peer identified by `agent_id`
> clear_class(agent_id, class_name) | Delete data only from the specified class that has been transmitted and acknowledged by the peer identified by `agent_id`
> stop() | Stop the replicator
> enum_agents(callback_fn) | Enumerate the active connections for this replicator. Call the callback function for each connection. The function signature must be as follows:
>       def iot_enum_agents_callback(repl, comm):
>         pass
> destroy() | Destroy the underlying replicator object
> Properties:
> agent_id | The `agent_id` of the node
> level | The`level` of the node
> comm | The underlying IoTCommunicator for the node