Skip to content
Snippets Groups Projects
Commit d0536e7e authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix WotRequirements response bean (add certifications)

parent 0215175c
Branches
Tags
No related merge requests found
Pipeline #9540 passed
...@@ -20,6 +20,9 @@ public class WotRequirements implements Serializable { ...@@ -20,6 +20,9 @@ public class WotRequirements implements Serializable {
private Boolean isSentry; private Boolean isSentry;
private Boolean wasMember; private Boolean wasMember;
private Certification[] certifications;
public String getPubkey() { public String getPubkey() {
return pubkey; return pubkey;
} }
...@@ -92,11 +95,11 @@ public class WotRequirements implements Serializable { ...@@ -92,11 +95,11 @@ public class WotRequirements implements Serializable {
this.outdistanced = outdistanced; this.outdistanced = outdistanced;
} }
public Boolean getSentry() { public Boolean getIsSentry() {
return isSentry; return isSentry;
} }
public void setSentry(Boolean sentry) { public void setIsSentry(Boolean sentry) {
isSentry = sentry; isSentry = sentry;
} }
...@@ -108,6 +111,15 @@ public class WotRequirements implements Serializable { ...@@ -108,6 +111,15 @@ public class WotRequirements implements Serializable {
this.wasMember = wasMember; this.wasMember = wasMember;
} }
public Certification[] getCertifications() {
return certifications;
}
public void setCertifications(Certification[] certifications) {
this.certifications = certifications;
}
public static class Meta implements Serializable { public static class Meta implements Serializable {
private String timestamp; private String timestamp;
...@@ -119,4 +131,52 @@ public class WotRequirements implements Serializable { ...@@ -119,4 +131,52 @@ public class WotRequirements implements Serializable {
this.timestamp = timestamp; this.timestamp = timestamp;
} }
} }
public static class Certification implements Serializable {
private long timestamp;
private String from;
private String to;
private String sig;
private long expiresIn;
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getSig() {
return sig;
}
public void setSig(String sig) {
this.sig = sig;
}
public long getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(long expiresIn) {
this.expiresIn = expiresIn;
}
}
} }
\ No newline at end of file
...@@ -33,6 +33,7 @@ import org.duniter.core.client.model.bma.*; ...@@ -33,6 +33,7 @@ import org.duniter.core.client.model.bma.*;
import org.duniter.core.client.model.local.*; import org.duniter.core.client.model.local.*;
import org.duniter.core.client.service.ServiceLocator; import org.duniter.core.client.service.ServiceLocator;
import org.duniter.core.client.service.exception.HttpBadRequestException; import org.duniter.core.client.service.exception.HttpBadRequestException;
import org.duniter.core.client.service.exception.HttpNotFoundException;
import org.duniter.core.client.service.local.CurrencyService; import org.duniter.core.client.service.local.CurrencyService;
import org.duniter.core.exception.TechnicalException; import org.duniter.core.exception.TechnicalException;
import org.duniter.core.service.CryptoService; import org.duniter.core.service.CryptoService;
...@@ -193,7 +194,7 @@ public class WotRemoteServiceImpl extends BaseRemoteServiceImpl implements WotRe ...@@ -193,7 +194,7 @@ public class WotRemoteServiceImpl extends BaseRemoteServiceImpl implements WotRe
try { try {
WotRequirementsResponse response = httpService.executeRequest(peer, String.format(URL_REQUIREMENT, pubKey), WotRequirementsResponse.class); WotRequirementsResponse response = httpService.executeRequest(peer, String.format(URL_REQUIREMENT, pubKey), WotRequirementsResponse.class);
return ImmutableList.copyOf(response.getIdentities()); return ImmutableList.copyOf(response.getIdentities());
} catch (HttpBadRequestException e) { } catch (HttpBadRequestException | HttpNotFoundException e) {
log.debug(String.format("Unable to get memberships for {%.8s}", pubKey)); log.debug(String.format("Unable to get memberships for {%.8s}", pubKey));
return null; return null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment