class RepositoriesModule extends AbstractModule {

    private final RepositoriesService repositoriesService;

    public RepositoriesModule(Environment env,
                              List<RepositoryPlugin> repoPlugins,
                              TransportService transportService,
                              ClusterService clusterService,
                              LogicalReplicationService logicalReplicationService,
                              RemoteClusters remoteClusters,
                              ThreadPool threadPool,
                              NamedXContentRegistry namedXContentRegistry,
                              LogicalReplicationSettings replicationSettings,
                              RecoverySettings recoverySettings) {
        Map<String, Repository.Factory> factories = new HashMap<>();
        factories.put(FsRepository.TYPE, new Repository.Factory() {

            @Override
            public TypeSettings settings() {
                return new TypeSettings(FsRepository.mandatorySettings(), FsRepository.optionalSettings());
            }

            @Override
            public Repository create(RepositoryMetadata metadata) throws Exception {
                return new FsRepository(metadata, env, namedXContentRegistry, clusterService, recoverySettings);
            }
        });
        factories.put(
            LogicalReplicationRepository.TYPE,
            new Repository.Factory() {
                @Override
                public Repository create(RepositoryMetadata metadata) throws Exception {<FILL_FUNCTION_BODY>}

                @Override
                public TypeSettings settings() {
                    return new TypeSettings(List.of(), List.of());
                }
            }
        );

        for (RepositoryPlugin repoPlugin : repoPlugins) {
            Map<String, Repository.Factory> newRepoTypes = repoPlugin.getRepositories(env, namedXContentRegistry, clusterService,
                recoverySettings);
            for (Map.Entry<String, Repository.Factory> entry : newRepoTypes.entrySet()) {
                if (factories.put(entry.getKey(), entry.getValue()) != null) {
                    throw new IllegalArgumentException("Repository type [" + entry.getKey() + "] is already registered");
                }
            }
        }

        Map<String, Repository.Factory> repositoryTypes = Collections.unmodifiableMap(factories);
        repositoriesService = new RepositoriesService(env.settings(), clusterService, transportService, repositoryTypes, threadPool);
    }

    @Override
    protected void configure() {
        Map<String, Repository.Factory> repositoryTypes = repositoriesService.typesRegistry();
        MapBinder<String, Repository.Factory> typesBinder = MapBinder.newMapBinder(binder(), String.class, Repository.Factory.class);
        repositoryTypes.forEach((k, v) -> typesBinder.addBinding(k).toInstance(v));

        MapBinder<String, TypeSettings> typeSettingsBinder = MapBinder.newMapBinder(
            binder(),
            String.class,
            TypeSettings.class);
        for (var e : repositoryTypes.entrySet()) {
            String repoScheme = e.getKey();
            var repoSettings = e.getValue().settings();
            typeSettingsBinder.addBinding(repoScheme).toInstance(repoSettings);
        }
    }

    public RepositoriesService repositoryService() {
        return repositoriesService;
    }
}

                    return new LogicalReplicationRepository(
                        clusterService,
                        logicalReplicationService,
                        remoteClusters,
                        metadata,
                        threadPool,
                        replicationSettings);
                
<methods>public non-sealed void <init>() ,public final synchronized void configure(org.elasticsearch.common.inject.Binder) <variables>org.elasticsearch.common.inject.Binder binder