/* Function   : versionDownloadingTimer
 * Description: timer, expiration of which means stopping downloading the best
 *              pool version in VERSION_DOWNLOADING state and passing to
 *              BACKUP state
 */
void
ReplicatorStateMachine::versionDownloadingTimer( )
{
    dprintf( D_ALWAYS, 
			"ReplicatorStateMachine::versionDownloadingTimer started\n" );
    utilCancelTimer(m_versionDownloadingTimerId);
    dprintf( D_FULLDEBUG, "ReplicatorStateMachine::versionDownloadingTimer "
			"cancelling version downloading timer\n" );
    utilClearList( m_versionsList );
    
	checkVersionSynchronization( );	

	m_state = BACKUP;
}
// releasing the dynamic memory and assigning initial values to all the data
// members of the base class
void
AbstractReplicatorStateMachine::finalize()
{
	dprintf( D_ALWAYS, "AbstractReplicatorStateMachine::finalize started\n" );
   	m_state             = VERSION_REQUESTING;
   	m_connectionTimeout = DEFAULT_SEND_COMMAND_TIMEOUT;

    utilClearList( m_replicationDaemonsList );
    m_transfererPath = "";

    //utilCancelReaper(m_downloadReaperId);
    //utilCancelReaper(m_uploadReaperId);
	// upon finalizing and/or reinitialiing the existing transferer processes
	// must be killed, otherwise we will temporarily deny creation of new
	// downloading transferers till the older ones are over
    killTransferers( );
}