m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/fetcher
diff options
context:
space:
mode:
authorMagdalena GrodziƄska <mag.grodzinska@gmail.com>2020-01-15 22:24:14 +0100
committerGitHub <noreply@github.com>2020-01-15 22:24:14 +0100
commit105655c78f7d817f99a04b77e4df6a39835997a5 (patch)
tree2bcff8189bd23818bb06eb209ca4258bca01207d /src/main/java/pl/edu/mimuw/cloudatlas/fetcher
parent97f644e3a983c6a24d26cb04b57b96a42afaa089 (diff)
parenta998cf78297233efe4886ade4f9d440244836353 (diff)
Merge pull request #124 from m-chrzan/initial_contact
Add initial contact to self with flag
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/fetcher')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/fetcher/Fetcher.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/fetcher/Fetcher.java b/src/main/java/pl/edu/mimuw/cloudatlas/fetcher/Fetcher.java
index 2b8d033..096e4e3 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/fetcher/Fetcher.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/fetcher/Fetcher.java
@@ -1,7 +1,11 @@
package pl.edu.mimuw.cloudatlas.fetcher;
+import pl.edu.mimuw.cloudatlas.agent.EventBus;
+import pl.edu.mimuw.cloudatlas.agent.messages.UpdateAttributesMessage;
import pl.edu.mimuw.cloudatlas.api.Api;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
@@ -98,7 +102,8 @@ public class Fetcher {
System.out.println(System.getProperty("user.dir"));
String fallbackContactsString = System.getProperty("fallback_contacts");
- System.out.println(fallbackContactsString);
+ String ownAddr = System.getProperty("own_addr");
+
try {
initializeApiStub();
initializePythonProcess();
@@ -108,6 +113,9 @@ public class Fetcher {
Set<String> fallbackContacts = new HashSet<String>();
api.setFallbackContacts(ClientController.parseContactsString(fallbackContactsString));
+ ValueContact initialContact = new ValueContact(new PathName(zonePath), InetAddress.getByName(ownAddr));
+ api.setAttributeValue(zonePath, "contacts", initialContact);
+
while((jsonAttribs = bufferRead.readLine()) != null) {
System.out.println(jsonAttribs);
System.out.flush();