Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
etlng::RegistryInterface Struct Referenceabstract

The interface for a registry that can dispatch transactions and objects to extensions. More...

#include <RegistryInterface.hpp>

Inheritance diagram for etlng::RegistryInterface:

Public Member Functions

virtual void dispatchInitialObjects (uint32_t seq, std::vector< model::Object > const &data, std::string lastKey)=0
 Dispatch initial objects.
 
virtual void dispatchInitialData (model::LedgerData const &data)=0
 Dispatch initial ledger data.
 
virtual void dispatch (model::LedgerData const &data)=0
 Dispatch an entire ledger diff.
 

Detailed Description

The interface for a registry that can dispatch transactions and objects to extensions.

This class defines the interface for dispatching data through to extensions.

Note
The registry itself consists of Extensions. Each extension must define at least one valid hook:
  • for ongoing ETL dispatch:
    • void onLedgerData(etlng::model::LedgerData const&)
    • void onTransaction(uint32_t, etlng::model::Transaction const&)
    • void onObject(uint32_t, etlng::model::Object const&)
  • for initial ledger load
    • void onInitialData(etlng::model::LedgerData const&)
    • void onInitialTransaction(uint32_t, etlng::model::Transaction const&)
  • for initial objects (called for each downloaded batch)
    • void onInitialObjects(uint32_t, std::vector<etlng::model::Object> const&, std::string)
    • void onInitialObject(uint32_t, etlng::model::Object const&)

When the registry dispatches (initial)data or objects, each of the above hooks will be called in order on each registered extension. This means that the order of execution is from left to right (hooks) and top to bottom (registered extensions).

If either onTransaction or onInitialTransaction are defined, the extension will have to additionally define a Specification. The specification lists transaction types to filter from the incoming data such that onTransaction and onInitialTransaction are only called for the transactions that are of interest for the given extension.

The specification is setup like so:

struct Ext {
using spec = etlng::model::Spec<
ripple::TxType::ttNFTOKEN_BURN,
ripple::TxType::ttNFTOKEN_ACCEPT_OFFER,
ripple::TxType::ttNFTOKEN_CREATE_OFFER,
ripple::TxType::ttNFTOKEN_CANCEL_OFFER,
ripple::TxType::ttNFTOKEN_MINT>;
static void
onInitialTransaction(uint32_t, etlng::model::Transaction const&);
};
A specification for the Registry.
Definition Models.hpp:52
Represents a single transaction on the ledger.
Definition Models.hpp:71

Member Function Documentation

◆ dispatch()

virtual void etlng::RegistryInterface::dispatch ( model::LedgerData const & data)
pure virtual

Dispatch an entire ledger diff.

This is used to dispatch incoming diffs through the extensions.

Parameters
dataThe data to dispatch

Implemented in etlng::impl::Registry< Ps >.

◆ dispatchInitialData()

virtual void etlng::RegistryInterface::dispatchInitialData ( model::LedgerData const & data)
pure virtual

Dispatch initial ledger data.

The transactions, header and edge keys are received during initial ledger load.

Parameters
dataThe data to dispatch

Implemented in etlng::impl::Registry< Ps >.

◆ dispatchInitialObjects()

virtual void etlng::RegistryInterface::dispatchInitialObjects ( uint32_t seq,
std::vector< model::Object > const & data,
std::string lastKey )
pure virtual

Dispatch initial objects.

These objects are received during initial ledger load.

Parameters
seqThe sequence
dataThe objects to dispatch
lastKeyThe predcessor of the first object in data if known; an empty string otherwise

Implemented in etlng::impl::Registry< Ps >.


The documentation for this struct was generated from the following file: