public class TransactionServiceImpl extends java.lang.Object implements TransactionService
TransactionService. It uses the repository interfaces. It works for the
different low level implementations like Vertx and Okhttp.| Constructor and Description |
|---|
TransactionServiceImpl(RepositoryFactory repositoryFactory)
The constructor
|
| Modifier and Type | Method and Description |
|---|---|
io.reactivex.Observable<Transaction> |
announce(Listener listener,
SignedTransaction signedTransaction)
This method announces a transaction while waiting for being completed by listing to the
/completed web socket.
|
io.reactivex.Observable<AggregateTransaction> |
announceAggregateBonded(Listener listener,
SignedTransaction signedAggregateTransaction)
This method announces an aggregate bonded transaction while waiting for being added by listing
to the /aggregateBondedAdded web socket.
|
io.reactivex.Observable<AggregateTransaction> |
announceHashLockAggregateBonded(Listener listener,
SignedTransaction signedHashLockTransaction,
SignedTransaction signedAggregateTransaction)
This method announces an a hash lock transaction followed by a aggregate bonded transaction
while waiting for being completed by listing to the /completed and /aggregateBondedAdded web
socket.
|
io.reactivex.Observable<java.util.List<Transaction>> |
resolveAliases(java.util.List<java.lang.String> transactionHashes)
This method loads all transactions with the given hashes from the catapult server where all the
aliases have been resolved.
|
public TransactionServiceImpl(RepositoryFactory repositoryFactory)
repositoryFactory - the RepositoryFactory with the catapult server connection.public io.reactivex.Observable<Transaction> announce(Listener listener, SignedTransaction signedTransaction)
TransactionServiceTransactionStatusException is raised.
Steps:
1) It announces the transaction to the TransactionRepository
2) It calls the Listener's completed method waiting for the transaction to be
completed.
3) It class the Listener's status method waiting for an error to occurred.
announce in interface TransactionServicelistener - the web socket listener used to detect completed transaction or status errors
coming from the catapult server.signedTransaction - the signed transaction to be announced.TransactionStatusException if the transaction has failed.public io.reactivex.Observable<AggregateTransaction> announceAggregateBonded(Listener listener, SignedTransaction signedAggregateTransaction)
TransactionServiceTransactionStatusException is raised.
Steps:
1) It announceAggregateBonded the transaction to the TransactionRepository
2) It calls the Listener's aggregateBondedAdded method waiting for the transaction
to be completed.
3) It class the Listener's status method waiting for an error to occurred.
announceAggregateBonded in interface TransactionServicelistener - the web socket listener used to detect aggregateBondedAdded transaction or
status errors coming from the catapult server.signedAggregateTransaction - the signed aggregate bonded transaction to be announced.TransactionStatusException if the transaction has failed.public io.reactivex.Observable<AggregateTransaction> announceHashLockAggregateBonded(Listener listener, SignedTransaction signedHashLockTransaction, SignedTransaction signedAggregateTransaction)
TransactionServiceTransactionStatusException is raised.announceHashLockAggregateBonded in interface TransactionServicelistener - the web socket listener used to detect completed, aggregateBondedAdded
transaction or status errors coming from the catapult server.signedHashLockTransaction - the signed hash lock transactionsignedAggregateTransaction - the signed aggregate bonded transaction that will be
announced after the signed hash lock transaction is completedTransactionStatusException if any transaction has failed.public io.reactivex.Observable<java.util.List<Transaction>> resolveAliases(java.util.List<java.lang.String> transactionHashes)
TransactionServiceFor example, if a TransferTransaction's recipient was 'customerone' NamespaceId, this method will return the same TransferTransaction where the recipient
is the real Address.
Similarly, if MosaicMetadataTransaction was announced using the NamespaceId
alias of the mosaic, the returned MosaicMetadataTransaction will reference the real
MosaicId.
All the UnresolvedMosaicId and UnresolvedAddress in the returned transaction
should be instances of MosaicId and Address
resolveAliases in interface TransactionServicetransactionHashes - the transaction hashes of all the transaction that you want to load
and resolve.Observable list of Transaction where all the aliases have been
resolved.