diff --git a/src/main/java/io/github/chronosx88/JGUN/nodes/GunSuperPeer.java b/src/main/java/io/github/chronosx88/JGUN/nodes/GunSuperPeer.java index 5651634..75c70bc 100644 --- a/src/main/java/io/github/chronosx88/JGUN/nodes/GunSuperPeer.java +++ b/src/main/java/io/github/chronosx88/JGUN/nodes/GunSuperPeer.java @@ -2,7 +2,7 @@ package io.github.chronosx88.JGUN.nodes; import io.github.chronosx88.JGUN.Dispatcher; import io.github.chronosx88.JGUN.Dup; -import io.github.chronosx88.JGUN.storageBackends.InMemoryGraph; +import io.github.chronosx88.JGUN.storageBackends.StorageBackend; import org.java_websocket.WebSocket; import org.java_websocket.handshake.ClientHandshake; import org.java_websocket.server.WebSocketServer; @@ -12,13 +12,14 @@ import java.net.InetSocketAddress; public class GunSuperPeer extends WebSocketServer implements Peer { private Dup dup = new Dup(); - private InMemoryGraph graph = new InMemoryGraph(); + private StorageBackend graph; private Dispatcher dispatcher; - public GunSuperPeer(int port) { + public GunSuperPeer(int port, StorageBackend storageBackend) { super(new InetSocketAddress(port)); setReuseAddr(true); dispatcher = new Dispatcher(graph, this, dup); + this.graph = storageBackend; } @Override