Package com.exonum.binding.core.service
Interface ExecutionContext
public interface ExecutionContext
An execution context. The context provides access to the blockchain data
 for the executing service, and also contains the required information for the transaction
 execution.
 
The context is provided by the framework and users shouldn't create context instances manually except in tests.
- See Also:
- Transaction
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classExecutionContext.BuilderTransaction context builder.
- 
Method SummaryModifier and Type Method Description static ExecutionContext.Builderbuilder()Returns the builder of the transaction context.java.util.Optional<PublicKey>getAuthorPk()Returns public key of the transaction author; orOptional.empty()if no transaction message corresponds to this context.BlockchainDatagetBlockchainData()Returns the database access object allowing R/W operations.default PrefixedgetServiceData()Returns the prefixed database access for the executing service.intgetServiceId()Returns the numeric id of the service instance.java.lang.StringgetServiceName()Returns the name of the service instance.java.util.Optional<HashCode>getTransactionMessageHash()Returns SHA-256 hash of the transaction message that carried the payload of the transaction; orOptional.empty()if no message corresponds to this context.
- 
Method Details- 
getServiceDataReturns the prefixed database access for the executing service. Allows R/W operations.A shortcut for context.getBlockchainData().getExecutingServiceData().- See Also:
- getBlockchainData()
 
- 
getBlockchainDataBlockchainData getBlockchainData()Returns the database access object allowing R/W operations.- See Also:
- getServiceData()
 
- 
getTransactionMessageHashjava.util.Optional<HashCode> getTransactionMessageHash()Returns SHA-256 hash of the transaction message that carried the payload of the transaction; orOptional.empty()if no message corresponds to this context.Each transaction message is uniquely identified by its hash; the messages are persisted in the blockchain and can be fetched by this hash. 
- 
getAuthorPkjava.util.Optional<PublicKey> getAuthorPk()Returns public key of the transaction author; orOptional.empty()if no transaction message corresponds to this context.The corresponding transaction message, if any, is guaranteed to have a correct CryptoFunctions.ed25519()signature with this public key.
- 
getServiceNamejava.lang.String getServiceName()Returns the name of the service instance.- See Also:
- ServiceInstanceSpec.getName()
 
- 
getServiceIdint getServiceId()Returns the numeric id of the service instance.- See Also:
- ServiceInstanceSpec.getId()
 
- 
builderReturns the builder of the transaction context.
 
-