package be.iminds.jfed.gts_highlevel;

import be.iminds.ilabt.jfed.lowlevel.JFedException;
import be.iminds.ilabt.jfed.lowlevel.api.GtsRest;
import be.iminds.ilabt.jfed.lowlevel.api.RestApi;
import be.iminds.ilabt.jfed.lowlevel.connection.HttpConnection;

import java.util.List;

/**
 * User: twalcari
 * Date: 9/23/2015
 * Time: 11:14
 */
public class GtsServiceImpl implements GtsService {
    private final GtsRest gtsRest;

    public GtsServiceImpl(GtsRest gtsRest) {
        this.gtsRest = gtsRest;
    }

    @Override
    public RestApi.RestReply<String> login(HttpConnection con) throws JFedException {
        return gtsRest.login(con);
    }

    @Override
    public RestApi.RestReply<String> queryUser(HttpConnection con, String gtsAuthenticationToken, String login) throws JFedException {
        return gtsRest.queryUser(con, gtsAuthenticationToken, login);
    }

    @Override
    public RestApi.RestReply<String> queryUsers(HttpConnection con, String gtsAuthenticationToken) throws JFedException {
        return gtsRest.queryUsers(con, gtsAuthenticationToken);
    }

    @Override
    public RestApi.RestReply<String> queryProject(HttpConnection con, String gtsAuthenticationToken, String id) throws JFedException {
        return gtsRest.queryProject(con, gtsAuthenticationToken, id);
    }

    @Override
    public RestApi.RestReply<String> queryProjects(HttpConnection con, String gtsAuthenticationToken) throws JFedException {
        return gtsRest.queryProjects(con, gtsAuthenticationToken);
    }

    @Override

    public RestApi.RestReply<String> addProject(HttpConnection con, String gtsAuthenticationToken, String projectName, String vpnUserName, String vpnPassword, List<String> users, String icon) throws JFedException {
        return gtsRest.addProject(con, gtsAuthenticationToken, projectName, vpnUserName, vpnPassword, users, icon);
    }

    @Override

    public RestApi.RestReply<String> updateProject(HttpConnection con, String gtsAuthenticationToken, String projectName, String vpnUserName, String vpnPassword, List<String> users, String icon) throws JFedException {
        return gtsRest.updateProject(con, gtsAuthenticationToken, projectName, vpnUserName, vpnPassword, users, icon);
    }

    @Override
    public RestApi.RestReply<String> removeProject(HttpConnection con, String gtsAuthenticationToken, String project) throws JFedException {
        return gtsRest.removeProject(con, gtsAuthenticationToken, project);
    }

    @Override
    public RestApi.RestReply<String> queryRCA(HttpConnection con, String gtsAuthenticationToken, String id) throws JFedException {
        return gtsRest.queryRCA(con, gtsAuthenticationToken, id);
    }

    @Override
    public RestApi.RestReply<String> queryRCAs(HttpConnection con, String gtsAuthenticationToken) throws JFedException {
        return gtsRest.queryRCAs(con, gtsAuthenticationToken);
    }

    @Override
    public RestApi.RestReply<String> queryType(HttpConnection con, String gtsAuthenticationToken, String project, String type) throws JFedException {
        return gtsRest.queryType(con, gtsAuthenticationToken, project, type);
    }

    @Override
    public RestApi.RestReply<String> queryTypes(HttpConnection con, String gtsAuthenticationToken, String project) throws JFedException {
        return gtsRest.queryTypes(con, gtsAuthenticationToken, project);
    }

    @Override
    public RestApi.RestReply<String> addType(HttpConnection con, String gtsAuthenticationToken, String project, String script) throws JFedException {
        return gtsRest.addType(con, gtsAuthenticationToken, project, script);
    }

    @Override
    public RestApi.RestReply<String> removeType(HttpConnection con, String gtsAuthenticationToken, String project, String type) throws JFedException {
        return gtsRest.removeType(con, gtsAuthenticationToken, project, type);
    }

    @Override
    public RestApi.RestReply<String> queryLdapResources(HttpConnection con, String gtsAuthenticationToken, String ldap, String project) throws JFedException {
        return gtsRest.queryLdapResources(con, gtsAuthenticationToken, ldap, project);
    }

    @Override
    public RestApi.RestReply<String> queryReservations(HttpConnection con, String gtsAuthenticationToken, String project) throws JFedException {
        return gtsRest.queryReservations(con, gtsAuthenticationToken, project);
    }

    @Override
    public RestApi.RestReply<String> queryProjectResources(HttpConnection con, String gtsAuthenticationToken, String project) throws JFedException {
        return gtsRest.queryProjectResources(con, gtsAuthenticationToken, project);
    }

    @Override
    public RestApi.RestReply<String> queryAllResources(HttpConnection con, String gtsAuthenticationToken) throws JFedException {
        return gtsRest.queryAllResources(con, gtsAuthenticationToken);
    }

    @Override
    public RestApi.RestReply<String> queryResource(HttpConnection con, String gtsAuthenticationToken, String id) throws JFedException {
        return gtsRest.queryResource(con, gtsAuthenticationToken, id);
    }

    @Override
    public RestApi.RestReply<String> reserveResource(HttpConnection con, String gtsAuthenticationToken, String id, String project) throws JFedException {
        return gtsRest.reserveResource(con, gtsAuthenticationToken, id, project);
    }

    @Override
    public RestApi.RestReply<String> reserveType(HttpConnection con, String gtsAuthenticationToken, String type, String project) throws JFedException {
        return gtsRest.reserveType(con, gtsAuthenticationToken, type, project);
    }

    @Override
    public RestApi.RestReply<String> activateReservation(HttpConnection con, String gtsAuthenticationToken, String id) throws JFedException {
        return gtsRest.activateReservation(con, gtsAuthenticationToken, id);
    }

    @Override
    public RestApi.RestReply<String> deactivateReservation(HttpConnection con, String gtsAuthenticationToken, String id) throws JFedException {
        return gtsRest.deactivateReservation(con, gtsAuthenticationToken, id);
    }

    @Override
    public RestApi.RestReply<String> releaseReservation(HttpConnection con, String gtsAuthenticationToken, String id) throws JFedException {
        return gtsRest.releaseReservation(con, gtsAuthenticationToken, id);
    }
}
