public class AccountLedger
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AccountLedger.Event
Account ledger listener events
|
static class |
AccountLedger.LedgerEntry
Ledger entry
|
static class |
AccountLedger.LedgerEvent
Ledger events
There must be a ledger event defined for each transaction (type,subtype) pair.
|
static interface |
AccountLedger.LedgerEventId |
static class |
AccountLedger.LedgerHolding
Ledger holdings
When adding a new holding, do not change the existing code assignments since
they are stored in the holding_type field of the account_ledger table.
|
Modifier and Type | Field and Description |
---|---|
static int |
trimKeep
Number of blocks to keep when trimming
|
Constructor and Description |
---|
AccountLedger() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addListener(Listener<AccountLedger.LedgerEntry> listener,
AccountLedger.Event eventType)
Add a listener
|
static void |
clearEntries()
Clear pending ledger entries
|
static void |
commitEntries()
Commit pending ledger entries
|
static java.util.List<AccountLedger.LedgerEntry> |
getEntries(long accountId,
AccountLedger.LedgerEvent event,
long eventId,
AccountLedger.LedgerHolding holding,
long holdingId,
int firstIndex,
int lastIndex)
Return the ledger entries sorted in descending insert order
|
static AccountLedger.LedgerEntry |
getEntry(long ledgerId)
Return a single entry identified by the ledger entry identifier
|
static void |
init()
Initialization
We don't do anything but we need to be called from Nxt.init() in order to
register our table
|
static AccountLedger.LedgerEventId |
newEventId(Block block) |
static AccountLedger.LedgerEventId |
newEventId(long eventId,
byte[] eventHash,
Chain chain) |
static AccountLedger.LedgerEventId |
newEventId(Transaction transaction) |
static boolean |
removeListener(Listener<AccountLedger.LedgerEntry> listener,
AccountLedger.Event eventType)
Remove a listener
|
public static void init()
public static boolean addListener(Listener<AccountLedger.LedgerEntry> listener, AccountLedger.Event eventType)
listener
- ListenereventType
- Event to listen forpublic static boolean removeListener(Listener<AccountLedger.LedgerEntry> listener, AccountLedger.Event eventType)
listener
- ListenereventType
- Event to listen forpublic static void commitEntries()
public static void clearEntries()
public static AccountLedger.LedgerEntry getEntry(long ledgerId)
ledgerId
- Ledger entry identifierpublic static java.util.List<AccountLedger.LedgerEntry> getEntries(long accountId, AccountLedger.LedgerEvent event, long eventId, AccountLedger.LedgerHolding holding, long holdingId, int firstIndex, int lastIndex)
accountId
- Account identifier or zero if no account identifierevent
- Ledger event or nulleventId
- Ledger event identifier or zero if no event identifierholding
- Ledger holding or nullholdingId
- Ledger holding identifier or zero if no holding identifierfirstIndex
- First matching entry index, inclusivelastIndex
- Last matching entry index, inclusivepublic static AccountLedger.LedgerEventId newEventId(long eventId, byte[] eventHash, Chain chain)
public static AccountLedger.LedgerEventId newEventId(Transaction transaction)
public static AccountLedger.LedgerEventId newEventId(Block block)