|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.bitcoin.protocols.channels.ServerConnectionEventHandler
public abstract class ServerConnectionEventHandler
A connection-specific event handler that handles events generated by client connections on a
PaymentChannelServerListener
| Constructor Summary | |
|---|---|
ServerConnectionEventHandler()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServerConnectionEventHandler()
| Method Detail |
|---|
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||