Package com.exonum.binding.core.service
Class BlockCommittedEventImpl
java.lang.Object
com.exonum.binding.core.service.BlockCommittedEventImpl
- All Implemented Interfaces:
BlockCommittedEvent
public abstract class BlockCommittedEventImpl extends java.lang.Object implements BlockCommittedEvent
-
Constructor Summary
Constructors Constructor Description BlockCommittedEventImpl()
-
Method Summary
Modifier and Type Method Description abstract long
getHeight()
Returns the current blockchain height, which is the height of the last committed block.abstract BlockchainData
getSnapshot()
Returns the current database snapshot for the executing service.abstract java.util.OptionalInt
getValidatorId()
If this node is a validator, returns its identifier.static BlockCommittedEventImpl
valueOf(BlockchainData snapshot, java.util.OptionalInt validatorId, long height)
Creates a new block committed event.
-
Constructor Details
-
BlockCommittedEventImpl
public BlockCommittedEventImpl()
-
-
Method Details
-
valueOf
public static BlockCommittedEventImpl valueOf(BlockchainData snapshot, java.util.OptionalInt validatorId, long height)Creates a new block committed event.- Parameters:
snapshot
- a snapshot of the blockchain statevalidatorId
- a validator id.OptionalInt.empty()
if this node is not a validatorheight
- the current blockchain height
-
getSnapshot
Description copied from interface:BlockCommittedEvent
Returns the current database snapshot for the executing service. It is immutable and represents the database state as of the block at the current height.- Specified by:
getSnapshot
in interfaceBlockCommittedEvent
-
getValidatorId
public abstract java.util.OptionalInt getValidatorId()Description copied from interface:BlockCommittedEvent
If this node is a validator, returns its identifier. If this node is an auditor, it will returnOptionalInt.empty()
.- Specified by:
getValidatorId
in interfaceBlockCommittedEvent
-
getHeight
public abstract long getHeight()Description copied from interface:BlockCommittedEvent
Returns the current blockchain height, which is the height of the last committed block.- Specified by:
getHeight
in interfaceBlockCommittedEvent
-