Package com.exonum.binding.service
Class AbstractService
- java.lang.Object
-
- com.exonum.binding.service.AbstractService
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractService(short id, java.lang.String name, TransactionConverter transactionConverter)Creates an AbstractService.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TransactionconvertToTransaction(RawTransaction rawTransaction)Converts an Exonum raw transaction to an executable transaction of this service.protected abstract SchemacreateDataSchema(View view)Creates a data schema of this service.shortgetId()Returns the id of the service.java.lang.StringgetName()Returns the name of the service.java.util.List<com.exonum.binding.common.hash.HashCode>getStateHashes(Snapshot snapshot)Returns a list of root hashes of all Merkelized tables defined by this service, as of the given snapshot of the blockchain state.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.exonum.binding.service.Service
afterCommit, createPublicApiHandlers, initialize
-
-
-
-
Constructor Detail
-
AbstractService
protected AbstractService(short id, java.lang.String name, TransactionConverter transactionConverter)Creates an AbstractService.- Parameters:
id- an id of the servicename- a name of the servicetransactionConverter- a transaction converter that is aware of all transactions of this service
-
-
Method Detail
-
getId
public short getId()
Description copied from interface:ServiceReturns the id of the service.
-
getName
public java.lang.String getName()
Description copied from interface:ServiceReturns the name of the service.
-
convertToTransaction
public Transaction convertToTransaction(RawTransaction rawTransaction)
Description copied from interface:ServiceConverts an Exonum raw transaction to an executable transaction of this service.- Specified by:
convertToTransactionin interfaceService- Parameters:
rawTransaction- a raw transaction to be converted- Returns:
- an executable transaction
-
getStateHashes
public java.util.List<com.exonum.binding.common.hash.HashCode> getStateHashes(Snapshot snapshot)
Description copied from interface:ServiceReturns a list of root hashes of all Merkelized tables defined by this service, as of the given snapshot of the blockchain state. If the service doesn't have any Merkelized tables, returns an empty list.The core uses this list to aggregate hashes of tables defined by all services into a single Merkelized meta-map. The hash of this meta-map is considered the hash of the entire blockchain state and is recorded as such in blocks and Precommit messages.
- Specified by:
getStateHashesin interfaceService- Parameters:
snapshot- a snapshot of the blockchain state. Not valid after this method returns- See Also:
ProofListIndexProxy.getRootHash(),ProofMapIndexProxy.getRootHash()
-
-