public abstract class ServerConnectionEventHandler extends Object
PaymentChannelServerListener
Constructor and Description |
---|
ServerConnectionEventHandler() |
Modifier and Type | Method and Description |
---|---|
abstract void |
channelClosed(PaymentChannelCloseException.CloseReason reason)
Called when the channel was closed for some reason.
|
abstract void |
channelOpen(Sha256Hash channelId)
Triggered when the channel is opened and application messages/payments can begin
|
protected void |
closeChannel()
Closes the channel with the client (will generate a
channelClosed(PaymentChannelCloseException.CloseReason) event) |
abstract void |
paymentIncrease(BigInteger by,
BigInteger to)
Called when the payment in this channel was successfully incremented by the client
|
protected final void closeChannel()
Closes the channel with the client (will generate a
channelClosed(PaymentChannelCloseException.CloseReason)
event)
Note that this does NOT actually broadcast the most recent payment transaction, which will be triggered
automatically when the channel times out by the StoredPaymentChannelServerStates
, or manually by calling
StoredPaymentChannelServerStates.closeChannel(StoredServerChannel)
with the channel returned by
StoredPaymentChannelServerStates.getChannel(com.google.bitcoin.core.Sha256Hash)
with the id provided in
channelOpen(com.google.bitcoin.core.Sha256Hash)
public abstract void channelOpen(Sha256Hash channelId)
channelId
- A unique identifier which represents this channel (actually the hash of the multisig contract)public abstract void paymentIncrease(BigInteger by, BigInteger to)
by
- The increase in total paymentto
- The new total payment to us (not including fees which may be required to claim the payment)public abstract void channelClosed(PaymentChannelCloseException.CloseReason reason)
Called when the channel was closed for some reason. May be called without a call to
channelOpen(Sha256Hash)
.
Note that the same channel can be reopened at any point before it expires if the client reconnects and requests it.
Copyright © 2014. All rights reserved.