public abstract class SimpleBaseLNDLightningHandler extends BaseLNDLightningHandler
Modifier and Type | Field and Description |
---|---|
protected org.lightningj.lnd.wrapper.AsynchronousLndAPI |
asynchronousLndAPI |
protected boolean |
connected |
protected org.lightningj.lnd.wrapper.SynchronousLndAPI |
synchronousLndAPI |
listeners, log
Constructor and Description |
---|
SimpleBaseLNDLightningHandler() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Method to close the LND connections and release underlying resources.
|
void |
connect(LightningHandlerContext context)
Method to open up a connection to the configured LND node.
|
protected org.lightningj.lnd.wrapper.AsynchronousLndAPI |
getAsyncAPI()
Method to get the asynchronous lnd api from lightningj.
|
protected abstract java.lang.String |
getHost()
Method that should return the hostname of IP address of the LND node to connect to.
|
protected abstract java.lang.String |
getMacaroonPath()
The path to the macaroon file that is used to authenticate to the LND node.
|
protected abstract int |
getPort()
Method that should return the port number of the LND node to connect to.
|
protected org.lightningj.lnd.wrapper.SynchronousLndAPI |
getSyncAPI()
Method to get the synchronous lnd api from lightningj.
|
protected abstract java.lang.String |
getTLSCertPath()
The path to the LND tls certificate to trust, securing the communication to the LND node.
|
boolean |
isConnected()
Method to check if handler is connected to node.
|
checkConnection, clearCache, generateInvoice, getLndHelper, getNodeInfo, getNodeInfoFromConfiguration, getSupportedCurrencyCode, listenToInvoices, lookupInvoice, registerListener, unregisterListener
protected org.lightningj.lnd.wrapper.AsynchronousLndAPI asynchronousLndAPI
protected org.lightningj.lnd.wrapper.SynchronousLndAPI synchronousLndAPI
protected boolean connected
public void connect(LightningHandlerContext context) throws java.io.IOException, InternalErrorException
context
- the last context by the payment handler, containing the indicies of the last invoices processed.java.io.IOException
- if communication problems occurred with underlying node.InternalErrorException
- if internal problems occurred opening up a connection with LND node.public void close() throws java.io.IOException, InternalErrorException
java.io.IOException
- if communication problems occurred with underlying node.InternalErrorException
- if internal problems occurred closing the connections with lightning node.public boolean isConnected() throws java.io.IOException, InternalErrorException
java.io.IOException
- if communication problems occurred with underlying node.InternalErrorException
- if internal problems occurred checking connection status.protected org.lightningj.lnd.wrapper.AsynchronousLndAPI getAsyncAPI() throws java.io.IOException, InternalErrorException
getAsyncAPI
in class BaseLNDLightningHandler
java.io.IOException
- if communication problems occurred with underlying node.InternalErrorException
- if internal problems occurred with LND node.protected org.lightningj.lnd.wrapper.SynchronousLndAPI getSyncAPI() throws java.io.IOException, InternalErrorException
getSyncAPI
in class BaseLNDLightningHandler
java.io.IOException
- if communication problems occurred with underlying node.InternalErrorException
- if internal problems occurred with LND node.protected abstract java.lang.String getHost() throws InternalErrorException
InternalErrorException
- if problems occurred getting the configuration information.protected abstract int getPort() throws InternalErrorException
InternalErrorException
- if problems occurred getting the configuration information.protected abstract java.lang.String getTLSCertPath() throws InternalErrorException
InternalErrorException
- if problems occurred getting the configuration information.protected abstract java.lang.String getMacaroonPath() throws InternalErrorException
InternalErrorException
- if problems occurred getting the configuration information.