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/ResponderServer.java | |
| parent | f3d0bfd50bdde4f96dc8ee603a7093d68201f114 (diff) | |
| download | soen423-6654546671eea9f9becd32b3160a134802659cbc.zip | |
Replica2: restrict scope
Diffstat (limited to 'src/main/java/derms/replica/replica2/ResponderServer.java')
| -rw-r--r-- | src/main/java/derms/replica/replica2/ResponderServer.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/derms/replica/replica2/ResponderServer.java b/src/main/java/derms/replica/replica2/ResponderServer.java index d294924..bcd0a92 100644 --- a/src/main/java/derms/replica/replica2/ResponderServer.java +++ b/src/main/java/derms/replica/replica2/ResponderServer.java @@ -11,31 +11,31 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.logging.Logger; -public class ResponderServer { - public static final Duration timeout = Duration.ofSeconds(5); +class ResponderServer { + static final Duration timeout = Duration.ofSeconds(5); private City city; private Resources resources; private Servers servers; private Logger log; - public ResponderServer(City city, Resources resources, Servers servers) throws IOException { + ResponderServer(City city, Resources resources, Servers servers) throws IOException { this.city = city; this.resources = resources; this.servers = servers; this.log = DermsLogger.getLogger(this.getClass()); } - public ResponderServer() throws IOException { + ResponderServer() throws IOException { this(new City(), new Resources(), new Servers()); } - public void addResource(Resource r) { + void addResource(Resource r) { resources.add(r); log.info("Added resource "+r+" - success"); } - public void removeResource(ResourceID rid, int duration) throws NoSuchResourceException { + void removeResource(ResourceID rid, int duration) throws NoSuchResourceException { log.info("Remove duration "+duration+" from "+rid); try { Resource resource = resources.getByID(rid); @@ -62,7 +62,7 @@ public class ResponderServer { } } - public Resource[] listResourceAvailability(ResourceType rname) throws ServerCommunicationError { + Resource[] listResourceAvailability(ResourceType rname) throws ServerCommunicationError { log.info("Request for available "+rname); Collection<Resource> availableResources = ConcurrentHashMap.newKeySet(); ExecutorService pool = Executors.newFixedThreadPool(servers.size()); |