summaryrefslogtreecommitdiffstats
path: root/src/main/java/derms/client/CoordinatorClient.java
blob: 40d8a9435d64cc85f51cb0238dcb545f0da7533a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package derms.client;

import derms.frontend.DERMSInterface;

import java.net.MalformedURLException;

public class CoordinatorClient {
    private final DERMSInterface server;
    private final String coordinatorID;

    public CoordinatorClient(String coordinatorID, String FEhost) throws MalformedURLException {
        this.server = Client.connectToServer(FEhost);
        this.coordinatorID = coordinatorID;
    }

    public String requestResource(String resourceID, int duration) {
        return server.requestResource(coordinatorID, resourceID, duration);
    }

    public String findResource(String resourceName) {
        return server.findResource(coordinatorID, resourceName);
    }

    public String returnResource(String resourceID) {
        return server.returnResource(coordinatorID, resourceID);
    }

    public String swapResource(String oldResourceID, String oldResourceType, String newResourceID, String newResourceType) {
        return server.swapResource(coordinatorID, oldResourceID, oldResourceType, newResourceID, newResourceType);
    }
}