
com.quorum.tessera.p2p.partyinfo.SimplePartyStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sync-jaxrs Show documentation
Show all versions of sync-jaxrs Show documentation
Tessera is a stateless Java system that is used to enable the encryption, decryption, and distribution of private transactions for Quorum.
package com.quorum.tessera.p2p.partyinfo;
import com.quorum.tessera.discovery.NodeUri;
import java.net.URI;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
import java.util.concurrent.ConcurrentSkipListSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
enum SimplePartyStore implements PartyStore {
INSTANCE;
private static final Logger LOGGER = LoggerFactory.getLogger(SimplePartyStore.class);
private final SortedSet parties = new ConcurrentSkipListSet<>();
@Override
public Set getParties() {
LOGGER.debug("Fetching parties {}", Objects.toString(parties));
return Set.copyOf(parties);
}
@Override
public PartyStore store(URI party) {
NodeUri nodeUri = NodeUri.create(party);
LOGGER.debug("Store {}", nodeUri.asURI());
parties.add(nodeUri.asURI());
return this;
}
@Override
public PartyStore remove(URI party) {
NodeUri nodeUri = NodeUri.create(party);
LOGGER.debug("Remove {}", nodeUri.asURI());
parties.remove(nodeUri.asURI());
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy