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 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 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 boolean |
removeListener(Listener<AccountLedger.LedgerEntry> listener,
AccountLedger.Event eventType)
Remove a listener
|
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 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, inclusive