added environment variables for uri's
This commit is contained in:
@@ -9,16 +9,15 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import ch.unisg.executorbase.executor.application.port.out.ExecutionFinishedEventPort;
|
||||
import ch.unisg.executorbase.executor.domain.ExecutionFinishedEvent;
|
||||
|
||||
public class ExecutionFinishedEventAdapter implements ExecutionFinishedEventPort {
|
||||
|
||||
// TODO url doesn't get mapped bc no autowiring
|
||||
@Value("${roster.url}")
|
||||
String server = "http://localhost:8082";
|
||||
String server = System.getenv("roster_uri") == null ?
|
||||
"http://localhost:8082" : System.getenv("roster_uri");
|
||||
|
||||
|
||||
Logger logger = Logger.getLogger(ExecutionFinishedEventAdapter.class.getName());
|
||||
|
||||
|
@@ -23,9 +23,8 @@ import org.json.JSONObject;
|
||||
@Primary
|
||||
public class GetAssignmentAdapter implements GetAssignmentPort {
|
||||
|
||||
// TODO Not working for now bc it doesn't get autowired
|
||||
@Value("${roster.url}")
|
||||
String server = "http://127.0.0.1:8082";
|
||||
String server = System.getenv("roster_uri") == null ?
|
||||
"http://localhost:8082" : System.getenv("roster_uri");
|
||||
|
||||
Logger logger = Logger.getLogger(GetAssignmentAdapter.class.getName());
|
||||
|
||||
|
@@ -22,9 +22,8 @@ import ch.unisg.executorbase.executor.domain.ExecutorType;
|
||||
@Primary
|
||||
public class NotifyExecutorPoolAdapter implements NotifyExecutorPoolPort {
|
||||
|
||||
// TODO Not working for now bc it doesn't get autowired
|
||||
@Value("${executor.pool.url}")
|
||||
String server = "http://127.0.0.1:8083";
|
||||
String server = System.getenv("executor_pool_uri") == null ?
|
||||
"http://localhost:8083" : System.getenv("executor_pool_uri");
|
||||
|
||||
Logger logger = Logger.getLogger(NotifyExecutorPoolAdapter.class.getName());
|
||||
|
||||
@@ -35,6 +34,8 @@ public class NotifyExecutorPoolAdapter implements NotifyExecutorPoolPort {
|
||||
@Override
|
||||
public boolean notifyExecutorPool(ExecutorURI executorURI, ExecutorType executorType) {
|
||||
|
||||
System.out.println(server);
|
||||
|
||||
String body = new JSONObject()
|
||||
.put("executorTaskType", executorType)
|
||||
.put("executorUri", executorURI.getValue())
|
||||
|
Reference in New Issue
Block a user