xrpld
Loading...
Searching...
No Matches
xrpl::InfoSub::Source Class Referenceabstract

Abstracts the source of subscription data. More...

#include <InfoSub.h>

Inheritance diagram for xrpl::InfoSub::Source:

Public Member Functions

virtual ~Source ()=default
virtual void subAccount (ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0
virtual void unsubAccount (ref isplistener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0
virtual void unsubAccountInternal (std::uint64_t uListener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0
virtual ErrorCodeI subAccountHistory (ref ispListener, AccountID const &account)=0
 subscribe an account's new transactions and retrieve the account's historical transactions
virtual void unsubAccountHistory (ref ispListener, AccountID const &account, bool historyOnly)=0
 unsubscribe an account's transactions
virtual void unsubAccountHistoryInternal (std::uint64_t uListener, AccountID const &account, bool historyOnly)=0
virtual bool subLedger (ref ispListener, json::Value &jvResult)=0
virtual bool unsubLedger (std::uint64_t uListener)=0
virtual bool subBookChanges (ref ispListener)=0
virtual bool unsubBookChanges (std::uint64_t uListener)=0
virtual bool subManifests (ref ispListener)=0
virtual bool unsubManifests (std::uint64_t uListener)=0
virtual void pubManifest (Manifest const &)=0
virtual bool subServer (ref ispListener, json::Value &jvResult, bool admin)=0
virtual bool unsubServer (std::uint64_t uListener)=0
virtual bool subBook (ref ispListener, Book const &)=0
virtual bool unsubBook (ref ispListener, Book const &)=0
 Remove a book subscription for a live subscriber.
virtual bool unsubBookInternal (std::uint64_t uListener, Book const &)=0
 Remove a book subscription during InfoSub teardown.
virtual bool subTransactions (ref ispListener)=0
virtual bool unsubTransactions (std::uint64_t uListener)=0
virtual bool subRTTransactions (ref ispListener)=0
virtual bool unsubRTTransactions (std::uint64_t uListener)=0
virtual bool subValidations (ref ispListener)=0
virtual bool unsubValidations (std::uint64_t uListener)=0
virtual bool subPeerStatus (ref ispListener)=0
virtual bool unsubPeerStatus (std::uint64_t uListener)=0
virtual void pubPeerStatus (std::function< json::Value(void)> const &)=0
virtual bool subConsensus (ref ispListener)=0
virtual bool unsubConsensus (std::uint64_t uListener)=0
virtual pointer findRpcSub (std::string const &strUrl)=0
virtual pointer addRpcSub (std::string const &strUrl, ref rspEntry)=0
virtual bool tryRemoveRpcSub (std::string const &strUrl)=0
virtual beast::Journal const & journal () const =0
 Journal used by InfoSub for diagnostics that occur after the owning subsystem (e.g.

Detailed Description

Abstracts the source of subscription data.

Definition at line 60 of file InfoSub.h.

Constructor & Destructor Documentation

◆ ~Source()

virtual xrpl::InfoSub::Source::~Source ( )
virtualdefault

Member Function Documentation

◆ subAccount()

virtual void xrpl::InfoSub::Source::subAccount ( ref ispListener,
hash_set< AccountID > const & vnaAccountIDs,
bool realTime )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubAccount()

virtual void xrpl::InfoSub::Source::unsubAccount ( ref isplistener,
hash_set< AccountID > const & vnaAccountIDs,
bool realTime )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubAccountInternal()

virtual void xrpl::InfoSub::Source::unsubAccountInternal ( std::uint64_t uListener,
hash_set< AccountID > const & vnaAccountIDs,
bool realTime )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subAccountHistory()

virtual ErrorCodeI xrpl::InfoSub::Source::subAccountHistory ( ref ispListener,
AccountID const & account )
pure virtual

subscribe an account's new transactions and retrieve the account's historical transactions

Returns
rpcSUCCESS if successful, otherwise an error code

Implemented in xrpl::NetworkOPsImp.

◆ unsubAccountHistory()

virtual void xrpl::InfoSub::Source::unsubAccountHistory ( ref ispListener,
AccountID const & account,
bool historyOnly )
pure virtual

unsubscribe an account's transactions

Parameters
historyOnlyif true, only stop historical transactions
Note
once a client receives enough historical transactions, it should unsubscribe with historyOnly == true to stop receiving more historical transactions. It will continue to receive new transactions.

Implemented in xrpl::NetworkOPsImp.

◆ unsubAccountHistoryInternal()

virtual void xrpl::InfoSub::Source::unsubAccountHistoryInternal ( std::uint64_t uListener,
AccountID const & account,
bool historyOnly )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subLedger()

virtual bool xrpl::InfoSub::Source::subLedger ( ref ispListener,
json::Value & jvResult )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubLedger()

virtual bool xrpl::InfoSub::Source::unsubLedger ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subBookChanges()

virtual bool xrpl::InfoSub::Source::subBookChanges ( ref ispListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubBookChanges()

virtual bool xrpl::InfoSub::Source::unsubBookChanges ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subManifests()

virtual bool xrpl::InfoSub::Source::subManifests ( ref ispListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubManifests()

virtual bool xrpl::InfoSub::Source::unsubManifests ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ pubManifest()

virtual void xrpl::InfoSub::Source::pubManifest ( Manifest const & )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subServer()

virtual bool xrpl::InfoSub::Source::subServer ( ref ispListener,
json::Value & jvResult,
bool admin )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubServer()

virtual bool xrpl::InfoSub::Source::unsubServer ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subBook()

virtual bool xrpl::InfoSub::Source::subBook ( ref ispListener,
Book const &  )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubBook()

virtual bool xrpl::InfoSub::Source::unsubBook ( ref ispListener,
Book const &  )
pure virtual

Remove a book subscription for a live subscriber.

Clears the book from the subscriber's own tracking set (InfoSub::bookSubscriptions_) and then removes the server-side entry from subBook_. Call this from RPC unsubscribe handlers.

Parameters
ispListenerThe subscriber requesting removal.
bookThe order book to unsubscribe from.
Returns
true if the entry was present and removed, false if the subscriber was not subscribed to book.
Note
Thread-safety: acquires subLock_ internally.
Do NOT call from ~InfoSub(). Use unsubBookInternal instead to avoid a redundant write-back to bookSubscriptions_ on a partially-destroyed object.

Implemented in xrpl::NetworkOPsImp.

◆ unsubBookInternal()

virtual bool xrpl::InfoSub::Source::unsubBookInternal ( std::uint64_t uListener,
Book const &  )
pure virtual

Remove a book subscription during InfoSub teardown.

Removes only the server-side entry from subBook_. Does NOT touch InfoSub::bookSubscriptions_ because the InfoSub is being destroyed. Called by ~InfoSub() for each book in bookSubscriptions_.

Parameters
uListenerThe sequence number of the subscriber being torn down.
bookThe order book entry to remove.
Returns
true if the entry was present and removed, false otherwise (e.g., already removed by a concurrent RPC unsubscribe).
Note
Thread-safety: acquires subLock_ internally.

Implemented in xrpl::NetworkOPsImp.

◆ subTransactions()

virtual bool xrpl::InfoSub::Source::subTransactions ( ref ispListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubTransactions()

virtual bool xrpl::InfoSub::Source::unsubTransactions ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subRTTransactions()

virtual bool xrpl::InfoSub::Source::subRTTransactions ( ref ispListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubRTTransactions()

virtual bool xrpl::InfoSub::Source::unsubRTTransactions ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subValidations()

virtual bool xrpl::InfoSub::Source::subValidations ( ref ispListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubValidations()

virtual bool xrpl::InfoSub::Source::unsubValidations ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subPeerStatus()

virtual bool xrpl::InfoSub::Source::subPeerStatus ( ref ispListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubPeerStatus()

virtual bool xrpl::InfoSub::Source::unsubPeerStatus ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ pubPeerStatus()

virtual void xrpl::InfoSub::Source::pubPeerStatus ( std::function< json::Value(void)> const & )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ subConsensus()

virtual bool xrpl::InfoSub::Source::subConsensus ( ref ispListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ unsubConsensus()

virtual bool xrpl::InfoSub::Source::unsubConsensus ( std::uint64_t uListener)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ findRpcSub()

virtual pointer xrpl::InfoSub::Source::findRpcSub ( std::string const & strUrl)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ addRpcSub()

virtual pointer xrpl::InfoSub::Source::addRpcSub ( std::string const & strUrl,
ref rspEntry )
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ tryRemoveRpcSub()

virtual bool xrpl::InfoSub::Source::tryRemoveRpcSub ( std::string const & strUrl)
pure virtual

Implemented in xrpl::NetworkOPsImp.

◆ journal()

virtual beast::Journal const & xrpl::InfoSub::Source::journal ( ) const
nodiscardpure virtual

Journal used by InfoSub for diagnostics that occur after the owning subsystem (e.g.

application-level Logs) is the only surviving sink — primarily destructor-time cleanup failures.

Implemented in xrpl::NetworkOPsImp.