com.google.bitcoin.jni
Class NativePaymentChannelServerConnectionEventHandler

java.lang.Object
  extended by com.google.bitcoin.protocols.channels.ServerConnectionEventHandler
      extended by com.google.bitcoin.jni.NativePaymentChannelServerConnectionEventHandler

public class NativePaymentChannelServerConnectionEventHandler
extends ServerConnectionEventHandler

An event listener that relays events to a native C++ object. A pointer to that object is stored in this class using JNI on the native side, thus several instances of this can point to different actual native implementations.


Field Summary
 long ptr
           
 
Constructor Summary
NativePaymentChannelServerConnectionEventHandler()
           
 
Method Summary
 void channelClosed(PaymentChannelCloseException.CloseReason reason)
          Called when the channel was closed for some reason.
 void channelOpen(Sha256Hash channelId)
          Triggered when the channel is opened and application messages/payments can begin
 void paymentIncrease(BigInteger by, BigInteger to)
          Called when the payment in this channel was successfully incremented by the client
 
Methods inherited from class com.google.bitcoin.protocols.channels.ServerConnectionEventHandler
closeChannel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ptr

public long ptr
Constructor Detail

NativePaymentChannelServerConnectionEventHandler

public NativePaymentChannelServerConnectionEventHandler()
Method Detail

channelOpen

public void channelOpen(Sha256Hash channelId)
Description copied from class: ServerConnectionEventHandler
Triggered when the channel is opened and application messages/payments can begin

Specified by:
channelOpen in class ServerConnectionEventHandler
Parameters:
channelId - A unique identifier which represents this channel (actually the hash of the multisig contract)

paymentIncrease

public void paymentIncrease(BigInteger by,
                            BigInteger to)
Description copied from class: ServerConnectionEventHandler
Called when the payment in this channel was successfully incremented by the client

Specified by:
paymentIncrease in class ServerConnectionEventHandler
Parameters:
by - The increase in total payment
to - The new total payment to us (not including fees which may be required to claim the payment)

channelClosed

public void channelClosed(PaymentChannelCloseException.CloseReason reason)
Description copied from class: ServerConnectionEventHandler

Called when the channel was closed for some reason. May be called without a call to ServerConnectionEventHandler.channelOpen(Sha256Hash).

Note that the same channel can be reopened at any point before it expires if the client reconnects and requests it.

Specified by:
channelClosed in class ServerConnectionEventHandler


Copyright © 2014. All rights reserved.