package io.gatekeeper.node.service.replication;

import io.gatekeeper.configuration.Configuration;
import io.gatekeeper.configuration.data.replication.LocalReplicationConfiguration;
import io.gatekeeper.model.Endpoint;
import io.gatekeeper.node.service.ReplicationService;
import io.gatekeeper.node.service.replication.common.Node;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;

public class LocalReplicationService extends ReplicationService<LocalReplicationConfiguration> {

    public LocalReplicationService(Configuration configuration) {
        super(configuration);
    }

    @Override
    public CompletableFuture<Void> start() {
        return CompletableFuture.completedFuture(null);
    }

    @Override
    public CompletableFuture<Integer> countNodes() {
        return CompletableFuture.completedFuture(1);
    }

    @Override
    public CompletableFuture<List<Node>> fetchNodes() {
        return CompletableFuture.completedFuture(Collections.singletonList(new Node(
            "local",
            replicationConfiguration.rpcAddress,
            replicationConfiguration.rpcPort
        )));
    }

    @Override
    public void close() throws IOException {
        super.close();
    }
}

@@ -179,45 +179,8 @@
 on;%0A
-import io.gatekeeper.model.Endpoint;%0A
 impo
@@ -321,36 +321,8 @@
 on;%0A
-import java.util.ArrayList;%0A
 impo
@@ -374,31 +374,8 @@
 st;%0A
-import java.util.UUID;%0A
 impo

Clean up imports from local replication service