package sg.ncl.adapter.deterlab;

import org.springframework.boot.context.properties.ConfigurationProperties;

import static sg.ncl.adapter.deterlab.ConnectionProperties.PREFIX;

/**
 * Created by Te Ye
 */
@ConfigurationProperties(prefix = PREFIX)
public class ConnectionProperties {

    public static final String PREFIX = "ncl.deterlab.adapter";

    private String ip;
    private String port;
    private String userIp;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getJoinProjectNewUsers() {
        return "http://" + ip + ":" + port + "/joinProjectNewUsers";
    }

    public void setUserIp(String userIp) {
        this.userIp = userIp;
    }

    public String getJoinProject() {
        return "http://" + ip + ":" + port + "/joinProject";
    }

    public String getLogin() {
        return "http://" + ip + ":" + port + "/login";
    }
    

    public String getApplyProjectNewUsers() {
        return "http://" + ip + ":" + port + "/applyProjectNewUsers";
    }
    
    public String getCreateExperimentUri() {
        return "http://" + ip + ":" + port + "/createExperiment";
    }

    public String getUpdateCredentials() {
        return "http://" + ip + ":" + port + "/changePassword";
    }
}


@@ -395,35 +395,8 @@
 ort;
-%0A    private String userIp;
 %0A%0A  
@@ -766,88 +766,8 @@
  %7D%0A%0A
-    public void setUserIp(String userIp) %7B%0A        this.userIp = userIp;%0A    %7D%0A%0A
     
@@ -871,106 +871,8 @@
  %7D%0A%0A
-    public String getLogin() %7B%0A        return %22http://%22 + ip + %22:%22 + port + %22/login%22;%0A    %7D%0A    %0A%0A
     

refactor ConnectionProperties