Search in sources :

Example 1 with ResolutionStatementPage

use of io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage in project nem2-sdk-java by nemtech.

the class ReceiptRepositoryVertxImpl method searchAddressResolutionStatements.

@Override
public Observable<Page<AddressResolutionStatement>> searchAddressResolutionStatements(ResolutionStatementSearchCriteria criteria) {
    BigInteger height = criteria.getHeight();
    Integer pageSize = criteria.getPageSize();
    Integer pageNumber = criteria.getPageNumber();
    String offset = criteria.getOffset();
    Order order = toDto(criteria.getOrder());
    Consumer<Handler<AsyncResult<ResolutionStatementPage>>> callback = (handler) -> getClient().searchAddressResolutionStatements(height, pageSize, pageNumber, offset, order, handler);
    return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(mapper::createAddressResolutionStatementFromDto).collect(Collectors.toList()))));
}
Also used : BigInteger(java.math.BigInteger) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) ApiClient(io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient) Collectors(java.util.stream.Collectors) TransactionStatementSearchCriteria(io.nem.symbol.sdk.api.TransactionStatementSearchCriteria) ReceiptType(io.nem.symbol.sdk.model.receipt.ReceiptType) TransactionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.TransactionStatementPage) ReceiptRepository(io.nem.symbol.sdk.api.ReceiptRepository) Consumer(java.util.function.Consumer) List(java.util.List) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) ReceiptRoutesApi(io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApi) TransactionStatement(io.nem.symbol.sdk.model.receipt.TransactionStatement) ResolutionStatementSearchCriteria(io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria) AddressResolutionStatement(io.nem.symbol.sdk.model.receipt.AddressResolutionStatement) MosaicResolutionStatement(io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement) ReceiptRoutesApiImpl(io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApiImpl) ResolutionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage) ReceiptTypeEnum(io.nem.symbol.sdk.openapi.vertx.model.ReceiptTypeEnum) Observable(io.reactivex.Observable) BigInteger(java.math.BigInteger) AsyncResult(io.vertx.core.AsyncResult) Handler(io.vertx.core.Handler) Page(io.nem.symbol.sdk.api.Page) BigInteger(java.math.BigInteger) Handler(io.vertx.core.Handler) ResolutionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage)

Example 2 with ResolutionStatementPage

use of io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage in project nem2-sdk-java by nemtech.

the class ReceiptRepositoryVertxImpl method searchMosaicResolutionStatements.

@Override
public Observable<Page<MosaicResolutionStatement>> searchMosaicResolutionStatements(ResolutionStatementSearchCriteria criteria) {
    BigInteger height = criteria.getHeight();
    Integer pageSize = criteria.getPageSize();
    Integer pageNumber = criteria.getPageNumber();
    String offset = criteria.getOffset();
    Order order = toDto(criteria.getOrder());
    Consumer<Handler<AsyncResult<ResolutionStatementPage>>> callback = (handler) -> getClient().searchMosaicResolutionStatements(height, pageSize, pageNumber, offset, order, handler);
    return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(mapper::createMosaicResolutionStatementFromDto).collect(Collectors.toList()))));
}
Also used : BigInteger(java.math.BigInteger) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) ApiClient(io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient) Collectors(java.util.stream.Collectors) TransactionStatementSearchCriteria(io.nem.symbol.sdk.api.TransactionStatementSearchCriteria) ReceiptType(io.nem.symbol.sdk.model.receipt.ReceiptType) TransactionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.TransactionStatementPage) ReceiptRepository(io.nem.symbol.sdk.api.ReceiptRepository) Consumer(java.util.function.Consumer) List(java.util.List) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) ReceiptRoutesApi(io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApi) TransactionStatement(io.nem.symbol.sdk.model.receipt.TransactionStatement) ResolutionStatementSearchCriteria(io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria) AddressResolutionStatement(io.nem.symbol.sdk.model.receipt.AddressResolutionStatement) MosaicResolutionStatement(io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement) ReceiptRoutesApiImpl(io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApiImpl) ResolutionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage) ReceiptTypeEnum(io.nem.symbol.sdk.openapi.vertx.model.ReceiptTypeEnum) Observable(io.reactivex.Observable) BigInteger(java.math.BigInteger) AsyncResult(io.vertx.core.AsyncResult) Handler(io.vertx.core.Handler) Page(io.nem.symbol.sdk.api.Page) BigInteger(java.math.BigInteger) Handler(io.vertx.core.Handler) ResolutionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage)

Aggregations

Page (io.nem.symbol.sdk.api.Page)2 ReceiptRepository (io.nem.symbol.sdk.api.ReceiptRepository)2 ResolutionStatementSearchCriteria (io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria)2 TransactionStatementSearchCriteria (io.nem.symbol.sdk.api.TransactionStatementSearchCriteria)2 AddressResolutionStatement (io.nem.symbol.sdk.model.receipt.AddressResolutionStatement)2 MosaicResolutionStatement (io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement)2 ReceiptType (io.nem.symbol.sdk.model.receipt.ReceiptType)2 TransactionStatement (io.nem.symbol.sdk.model.receipt.TransactionStatement)2 ReceiptRoutesApi (io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApi)2 ReceiptRoutesApiImpl (io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApiImpl)2 ApiClient (io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient)2 Order (io.nem.symbol.sdk.openapi.vertx.model.Order)2 ReceiptTypeEnum (io.nem.symbol.sdk.openapi.vertx.model.ReceiptTypeEnum)2 ResolutionStatementPage (io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage)2 TransactionStatementPage (io.nem.symbol.sdk.openapi.vertx.model.TransactionStatementPage)2 Observable (io.reactivex.Observable)2 AsyncResult (io.vertx.core.AsyncResult)2 Handler (io.vertx.core.Handler)2 BigInteger (java.math.BigInteger)2 List (java.util.List)2