Search in sources :

Example 1 with UpCheckResource

use of com.quorum.tessera.api.common.UpCheckResource in project tessera by ConsenSys.

the class Q2TRestApp method getSingletons.

@Override
public Set<Object> getSingletons() {
    TransactionResource transactionResource = new TransactionResource(transactionManager, privacyGroupManager);
    TransactionResource3 transactionResource3 = new TransactionResource3(transactionManager, privacyGroupManager);
    TransactionResource4 transactionResource4 = new TransactionResource4(transactionManager, privacyGroupManager);
    RawTransactionResource rawTransactionResource = new RawTransactionResource(transactionManager);
    EncodedPayloadResource encodedPayloadResource = new EncodedPayloadResource(encodedPayloadManager, transactionManager);
    final UpCheckResource upCheckResource = new UpCheckResource();
    final PrivacyGroupResource privacyGroupResource = new PrivacyGroupResource(privacyGroupManager);
    final Config config = ConfigFactory.create().getConfig();
    if (config.getClientMode() == ClientMode.ORION) {
        final BesuTransactionResource besuResource = new BesuTransactionResource(transactionManager, privacyGroupManager);
        return Set.of(besuResource, rawTransactionResource, privacyGroupResource, upCheckResource);
    }
    return Set.of(transactionResource, rawTransactionResource, encodedPayloadResource, privacyGroupResource, upCheckResource, transactionResource3, transactionResource4);
}
Also used : UpCheckResource(com.quorum.tessera.api.common.UpCheckResource) RawTransactionResource(com.quorum.tessera.api.common.RawTransactionResource) Config(com.quorum.tessera.config.Config) RawTransactionResource(com.quorum.tessera.api.common.RawTransactionResource)

Example 2 with UpCheckResource

use of com.quorum.tessera.api.common.UpCheckResource in project tessera by ConsenSys.

the class ThirdPartyRestApp method getSingletons.

@Override
public Set<Object> getSingletons() {
    final RawTransactionResource rawTransactionResource = new RawTransactionResource(transactionManager);
    final PartyInfoResource partyInfoResource = new PartyInfoResource(discovery);
    final KeyResource keyResource = new KeyResource();
    final UpCheckResource upCheckResource = new UpCheckResource();
    return Set.of(rawTransactionResource, partyInfoResource, keyResource, upCheckResource);
}
Also used : UpCheckResource(com.quorum.tessera.api.common.UpCheckResource) RawTransactionResource(com.quorum.tessera.api.common.RawTransactionResource)

Example 3 with UpCheckResource

use of com.quorum.tessera.api.common.UpCheckResource in project tessera by ConsenSys.

the class P2PRestApp method getSingletons.

@Override
public Set<Object> getSingletons() {
    RuntimeContext runtimeContext = RuntimeContext.getInstance();
    List<URI> peers = runtimeContext.getPeers();
    LOGGER.debug("Found configured peers {}", peers);
    peers.stream().map(NodeUri::create).map(NodeUri::asURI).peek(u -> LOGGER.debug("Adding {} to party store", u)).forEach(partyStore::store);
    final PartyInfoResource partyInfoResource = new PartyInfoResource(discovery, partyInfoParser, runtimeContext.getP2pClient(), enclave, runtimeContext.isRemoteKeyValidation());
    final IPWhitelistFilter iPWhitelistFilter = new IPWhitelistFilter();
    final TransactionResource transactionResource = new TransactionResource(transactionManager, batchResendManager, legacyResendManager);
    final UpCheckResource upCheckResource = new UpCheckResource();
    final PrivacyGroupResource privacyGroupResource = new PrivacyGroupResource(privacyGroupManager);
    if (runtimeContext.isRecoveryMode()) {
        final RecoveryResource recoveryResource = new RecoveryResource(transactionManager, batchResendManager);
        return Set.of(partyInfoResource, iPWhitelistFilter, recoveryResource, upCheckResource);
    }
    return Set.of(partyInfoResource, iPWhitelistFilter, transactionResource, privacyGroupResource, upCheckResource);
}
Also used : PartyInfoParser(com.quorum.tessera.p2p.partyinfo.PartyInfoParser) AppType(com.quorum.tessera.config.AppType) Logger(org.slf4j.Logger) TransactionManager(com.quorum.tessera.transaction.TransactionManager) LoggerFactory(org.slf4j.LoggerFactory) BatchResendManager(com.quorum.tessera.recovery.workflow.BatchResendManager) Set(java.util.Set) PrivacyGroupManager(com.quorum.tessera.privacygroup.PrivacyGroupManager) NodeUri(com.quorum.tessera.discovery.NodeUri) PartyStore(com.quorum.tessera.p2p.partyinfo.PartyStore) Objects(java.util.Objects) Discovery(com.quorum.tessera.discovery.Discovery) ApplicationPath(jakarta.ws.rs.ApplicationPath) List(java.util.List) Stream(java.util.stream.Stream) UpCheckResource(com.quorum.tessera.api.common.UpCheckResource) GlobalFilter(com.quorum.tessera.api.filter.GlobalFilter) RuntimeContext(com.quorum.tessera.context.RuntimeContext) Enclave(com.quorum.tessera.enclave.Enclave) URI(java.net.URI) LegacyResendManager(com.quorum.tessera.recovery.workflow.LegacyResendManager) Collectors.toSet(java.util.stream.Collectors.toSet) IPWhitelistFilter(com.quorum.tessera.api.filter.IPWhitelistFilter) TesseraRestApplication(com.quorum.tessera.app.TesseraRestApplication) UpCheckResource(com.quorum.tessera.api.common.UpCheckResource) IPWhitelistFilter(com.quorum.tessera.api.filter.IPWhitelistFilter) NodeUri(com.quorum.tessera.discovery.NodeUri) RuntimeContext(com.quorum.tessera.context.RuntimeContext) URI(java.net.URI)

Aggregations

UpCheckResource (com.quorum.tessera.api.common.UpCheckResource)3 RawTransactionResource (com.quorum.tessera.api.common.RawTransactionResource)2 GlobalFilter (com.quorum.tessera.api.filter.GlobalFilter)1 IPWhitelistFilter (com.quorum.tessera.api.filter.IPWhitelistFilter)1 TesseraRestApplication (com.quorum.tessera.app.TesseraRestApplication)1 AppType (com.quorum.tessera.config.AppType)1 Config (com.quorum.tessera.config.Config)1 RuntimeContext (com.quorum.tessera.context.RuntimeContext)1 Discovery (com.quorum.tessera.discovery.Discovery)1 NodeUri (com.quorum.tessera.discovery.NodeUri)1 Enclave (com.quorum.tessera.enclave.Enclave)1 PartyInfoParser (com.quorum.tessera.p2p.partyinfo.PartyInfoParser)1 PartyStore (com.quorum.tessera.p2p.partyinfo.PartyStore)1 PrivacyGroupManager (com.quorum.tessera.privacygroup.PrivacyGroupManager)1 BatchResendManager (com.quorum.tessera.recovery.workflow.BatchResendManager)1 LegacyResendManager (com.quorum.tessera.recovery.workflow.LegacyResendManager)1 TransactionManager (com.quorum.tessera.transaction.TransactionManager)1 ApplicationPath (jakarta.ws.rs.ApplicationPath)1 URI (java.net.URI)1 List (java.util.List)1