Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • clients/cesium-grp/cesium-plus-pod
  • clients/java/duniter4j
  • ji_emme/duniter4j
  • dvermd/cesium-plus-pod
  • okayotanoka/cesium-plus-pod
  • pokapow/cesium-plus-pod
  • pini-gh/cesium-plus-pod
7 results
Show changes
Showing
with 688 additions and 790 deletions
package org.duniter.elasticsearch.dao;
package org.duniter.core.client.model.bma;
/*-
* #%L
* Duniter4j :: ElasticSearch Core plugin
* Duniter4j :: Core Client API
* %%
* Copyright (C) 2014 - 2017 EIS
* Copyright (C) 2014 - 2021 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
......@@ -22,17 +22,25 @@ package org.duniter.elasticsearch.dao;
* #L%
*/
import org.elasticsearch.common.xcontent.XContentBuilder;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import java.util.Map;
import java.io.Serializable;
/**
* Created by blavenie on 30/03/17.
*/
@Data
@FieldNameConstants
public class WotPendingMembership implements Serializable {
private static final long serialVersionUID = 1L;
public interface TypeDao<T extends TypeDao> {
private String pubkey;
private String uid;
private String version;
private String currency;
private String membership;
private Integer blockNumber;
private String blockHash;
private Boolean written;
XContentBuilder createTypeMapping();
String getType();
}
package org.duniter.core.client.dao;
package org.duniter.core.client.model.bma;
/*
* #%L
......@@ -22,16 +22,16 @@ package org.duniter.core.client.dao;
* #L%
*/
import org.duniter.core.client.model.local.Peer;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import java.util.List;
import java.io.Serializable;
/**
* Created by blavenie on 29/12/15.
*/
public interface PeerDao extends EntityDao<String, Peer> {
@Data
@FieldNameConstants
public class WotPendingMemberships implements Serializable {
private static final long serialVersionUID = -5631089862725952431L;
List<Peer> getPeersByCurrencyId(String currencyId);
private WotPendingMembership[] memberships;
boolean isExists(String currencyId, String peerId);
}
package org.duniter.core.client.model.elasticsearch;
package org.duniter.core.client.model.bma;
/*
/*-
* #%L
* Duniter4j :: Core Client API
* %%
* Copyright (C) 2014 - 2016 EIS
* Copyright (C) 2014 - 2021 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
......@@ -16,7 +16,7 @@ package org.duniter.core.client.model.elasticsearch;
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
......@@ -24,45 +24,47 @@ package org.duniter.core.client.model.elasticsearch;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonSetter;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
/**
* Created by blavenie on 01/03/16.
*/
public class RecordComment extends Record {
public static final String PROPERTY_MESSAGE="message";
public static final String PROPERTY_RECORD="record";
public static final String PROPERTY_REPLY_TO="replyTo";
public static final String PROPERTY_REPLY_TO_JSON="reply_to";
import java.io.Serializable;
private String message;
private String record;
private String replyTo;
@Data
@FieldNameConstants
public class WotRequirements implements Serializable {
private static final long serialVersionUID = 1L;
public String getMessage() {
return message;
}
private String pubkey;
private String uid;
private String sig;
private Meta meta;
private String revocation_sig;
private Boolean revoked;
private Long revoked_on;
private Boolean expired;
private Boolean outdistanced;
private Boolean isSentry;
private Boolean wasMember;
public void setMessage(String message) {
this.message = message;
}
private Long membershipPendingExpiresIn;
public String getRecord() {
return record;
}
private Long membershipExpiresIn;
public void setRecord(String record) {
this.record = record;
}
private Certification[] certifications;
@JsonGetter(PROPERTY_REPLY_TO_JSON)
public String getReplyTo() {
return replyTo;
}
@Data
@FieldNameConstants
public static class Meta implements Serializable {
private String timestamp;
}
@JsonSetter(PROPERTY_REPLY_TO_JSON)
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
@Data
@FieldNameConstants
public static class Certification implements Serializable {
private long timestamp;
private String from;
private String to;
private String sig;
private long expiresIn;
}
}
package org.duniter.core.client.model.elasticsearch;
package org.duniter.core.client.model.bma;
/*
* #%L
* Duniter4j :: Core Client API
* UCoin Java :: Core Client API
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
......@@ -22,14 +22,14 @@ package org.duniter.core.client.model.elasticsearch;
* #L%
*/
/**
* Created by blavenie on 31/03/16.
*/
public interface Protocol {
String VERSION = "1";
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import org.duniter.core.client.model.BaseIdentity;
String ES_API = "ELASTICSEARCH_API";
@Data
@FieldNameConstants
public class WotRequirementsResponse extends BaseIdentity {
private static final long serialVersionUID = -5631089862725952141L;
String CESIUM_PLUS_API = "CESIUM_PLUS_API";
private WotRequirements[] identities;
}
package org.duniter.core.client.model.bma;
/*
* #%L
* Duniter4j :: Core Client API
* %%
* Copyright (C) 2014 - 2017 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Joiner;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import java.io.Serializable;
/**
* Created by blavenie on 22/01/19.
*/
@Data
@FieldNameConstants
public class Ws2pHead implements Serializable {
public Integer version;
public String pubkey;
public String block;
public String ws2pid;
public String software;
public String softwareVersion;
public String powPrefix;
public String signature;
public AccessConfig privateConfig = new AccessConfig();
public AccessConfig publicConfig = new AccessConfig();
@Data
@FieldNameConstants
public static class AccessConfig {
public boolean useTor;
private String mode;
}
@Override
public String toString() {
return Joiner.on(':').skipNulls().join(new Object[]{
getPrefix(), "HEAD", version, pubkey, block, ws2pid, software, softwareVersion, powPrefix
});
}
@JsonIgnore
protected String getPrefix() {
StringBuilder sb = new StringBuilder();
sb.append("WS2P");
// Private access
if (getPrivateConfig() != null) {
sb.append("O");
if (getPrivateConfig().isUseTor()) {
sb.append("T");
} else {
sb.append("C");
}
if (getPrivateConfig().getMode() != null) {
switch (getPrivateConfig().getMode()) {
case "all":
sb.append("A");
break;
case "mixed":
sb.append("M");
break;
case "strict":
sb.append("S");
break;
}
}
}
// Public access
if (getPublicConfig() != null) {
sb.append("I");
if (getPublicConfig().isUseTor()) {
sb.append("T");
}
else {
sb.append("C");
}
}
return sb.toString();
}
}
\ No newline at end of file