public final class FundingMonitor
extends java.lang.Object
NXT, ASSET and CURRENCY balances can be monitored. If a balance falls below the threshold, a transaction will be submitted to transfer units from the funding account to the monitored account. A transfer will remain pending if the number of blocks since the previous transfer transaction is less than the monitor interval.
Modifier and Type | Class and Description |
---|---|
static class |
FundingMonitor.MonitoredAccount
Monitored account
|
Modifier and Type | Field and Description |
---|---|
static long |
MIN_FUND_AMOUNT
Minimum monitor amount
|
static int |
MIN_FUND_INTERVAL
Minimum funding interval
|
static long |
MIN_FUND_THRESHOLD
Minimum monitor threshold
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Check if two monitors are equal
|
long |
getAccountId()
Return the fund account identifier
|
java.lang.String |
getAccountName()
Return the fund account name
|
static java.util.List<FundingMonitor> |
getAllMonitors()
Get all monitors
|
long |
getAmount()
Return the fund amount
|
long |
getHoldingId()
Return the holding identifier
|
HoldingType |
getHoldingType()
Return the monitor holding type
|
int |
getInterval()
Return the fund interval
|
static java.util.List<FundingMonitor.MonitoredAccount> |
getMonitoredAccounts(FundingMonitor monitor)
Get all monitored accounts for a single monitor
|
static java.util.List<FundingMonitor> |
getMonitors(Filter<FundingMonitor> filter)
Get monitors satisfying the supplied filter
|
java.lang.String |
getProperty()
Return the account property name
|
long |
getThreshold()
Return the fund threshold
|
int |
hashCode()
Return the hash code
|
static void |
shutdown()
Stop monitor processing
|
static boolean |
startMonitor(HoldingType holdingType,
long holdingId,
java.lang.String property,
long amount,
long threshold,
int interval,
java.lang.String secretPhrase)
Start the monitor
|
static int |
stopAllMonitors()
Stop all monitors
Pending fund transactions will still be processed
|
static boolean |
stopMonitor(HoldingType holdingType,
long holdingId,
java.lang.String property,
long accountId)
Stop monitor
Pending fund transactions will still be processed
|
public static final long MIN_FUND_AMOUNT
public static final long MIN_FUND_THRESHOLD
public static final int MIN_FUND_INTERVAL
public HoldingType getHoldingType()
public long getHoldingId()
public java.lang.String getProperty()
public long getAmount()
public long getThreshold()
public int getInterval()
public long getAccountId()
public java.lang.String getAccountName()
public static boolean startMonitor(HoldingType holdingType, long holdingId, java.lang.String property, long amount, long threshold, int interval, java.lang.String secretPhrase)
One or more funding parameters can be overridden in the account property value string: {"amount":"long","threshold":"long","interval":integer}
holdingType
- Holding typeholdingId
- Asset or currency identifier, ignored for NXT monitorproperty
- Account property nameamount
- Fund amountthreshold
- Fund thresholdinterval
- Fund intervalsecretPhrase
- Fund account secret phrasepublic static int stopAllMonitors()
public static boolean stopMonitor(HoldingType holdingType, long holdingId, java.lang.String property, long accountId)
holdingType
- Monitor holding typeholdingId
- Asset or currency identifier, ignored for NXT monitorproperty
- Account propertyaccountId
- Fund account identifierpublic static java.util.List<FundingMonitor> getMonitors(Filter<FundingMonitor> filter)
filter
- Monitor filterpublic static java.util.List<FundingMonitor> getAllMonitors()
public static java.util.List<FundingMonitor.MonitoredAccount> getMonitoredAccounts(FundingMonitor monitor)
monitor
- Monitorpublic static void shutdown()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Comparison object