diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-11-28 17:26:19 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-11-28 17:26:19 -0500 |
| commit | 6654546671eea9f9becd32b3160a134802659cbc (patch) | |
| tree | cefc60b322c4d2a2849bbec83682f379965ab48c /src/main/java/derms/replica/replica2/SwapResource.java | |
| parent | f3d0bfd50bdde4f96dc8ee603a7093d68201f114 (diff) | |
| download | soen423-6654546671eea9f9becd32b3160a134802659cbc.zip | |
Replica2: restrict scope
Diffstat (limited to 'src/main/java/derms/replica/replica2/SwapResource.java')
| -rw-r--r-- | src/main/java/derms/replica/replica2/SwapResource.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/derms/replica/replica2/SwapResource.java b/src/main/java/derms/replica/replica2/SwapResource.java index a3b88e8..bcdd222 100644 --- a/src/main/java/derms/replica/replica2/SwapResource.java +++ b/src/main/java/derms/replica/replica2/SwapResource.java @@ -8,22 +8,22 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.logging.Logger; -public class SwapResource { - public static final int port = 5560; - public static final int bufSize = 4096; +class SwapResource { + static final int port = 5560; + static final int bufSize = 4096; - public static class Client { + static class Client { private CoordinatorID cid; private ResourceID oldRID; private ResourceID newRID; - public Client(CoordinatorID cid, ResourceID oldRID, ResourceID newRID) { + Client(CoordinatorID cid, ResourceID oldRID, ResourceID newRID) { this.cid = cid; this.oldRID = oldRID; this.newRID = newRID; } - public Response sendRequest(InetAddress serverAddr) throws IOException { + Response sendRequest(InetAddress serverAddr) throws IOException { Request request = new Request(cid, oldRID, newRID); DatagramSocket sock; try { @@ -61,14 +61,14 @@ public class SwapResource { } } - public static class Server implements Runnable { + static class Server implements Runnable { private InetAddress localAddr; private Resources resources; private Servers servers; private ExecutorService pool; private Logger log; - public Server(InetAddress localAddr, Resources resources, Servers servers) throws IOException { + Server(InetAddress localAddr, Resources resources, Servers servers) throws IOException { this.localAddr = localAddr; this.resources = resources; this.servers = servers; @@ -224,16 +224,16 @@ public class SwapResource { } } - public static class Response implements Serializable { - public Status status; - public String message; + static class Response implements Serializable { + Status status; + String message; private Response(Status status, String message) { this.status = status; this.message = message; } - public enum Status { + enum Status { SUCCESS, FAILURE, NO_SUCH_RESOURCE, |