class DefaultMetadataSyncService implements MetadataSyncService {

    @Override
    public MetadataSyncParams getParamsFromMap( Map<String, List<String>> parameters )
    {
        List<String> versionName = getVersionsFromParams( parameters );
        MetadataImportParams importParams = new MetadataImportParams();
        importParams.setMetadataSyncImport( true );
        MetadataSyncParams syncParams = new MetadataSyncParams();
        syncParams.setImportParams( importParams );
        String versionNameStr = versionName.get( 0 );

        if ( StringUtils.isNotEmpty( versionNameStr ) )
        {
            MetadataVersion version;

            try
            {
                version = metadataVersionDelegate.getRemoteMetadataVersion( versionNameStr );
            }
            catch ( MetadataVersionServiceException e )
            {
                throw new MetadataSyncServiceException( e.getMessage(), e );
            }

            if ( version == null )
            {
                throw new MetadataSyncServiceException(
                    "The MetadataVersion could not be fetched from the remote server for the versionName: " +
                        versionNameStr );
            }

            syncParams.setVersion( version );
        }

        syncParams.setParameters( parameters );

        return syncParams;
    }

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

}