class DefaultMetadataSyncService implements MetadataSyncService {

    @Override
    public synchronized MetadataSyncSummary doMetadataSync( MetadataSyncParams syncParams )
        throws MetadataSyncServiceException, DhisVersionMismatchException
    {
        MetadataVersion version = getMetadataVersion( syncParams );

        setMetadataImportMode( syncParams, version );
        String metadataVersionSnapshot = getMetadataVersionSnapshot( version );

        if ( metadataSyncDelegate.shouldStopSync( metadataVersionSnapshot ) )
        {
            throw new DhisVersionMismatchException( "Metadata sync failed because your version of DHIS does not match the master version" );
        }

        saveMetadataVersionSnapshotLocally( version, metadataVersionSnapshot );
        MetadataSyncSummary metadataSyncSummary = metadataSyncImportHandler.importMetadata( syncParams, metadataVersionSnapshot );

        log.info( "Metadata Sync Summary: " + metadataSyncSummary );

        return metadataSyncSummary;
    }

    public  DefaultMetadataSyncService( MetadataVersionDelegate metadataVersionDelegate,
        MetadataVersionService metadataVersionService, MetadataSyncDelegate metadataSyncDelegate,
        MetadataSyncImportHandler metadataSyncImportHandler );

}