use of io.nem.symbol.sdk.openapi.vertx.model.Order in project nem2-sdk-java by nemtech.
the class MetadataRepositoryVertxImpl method search.
@Override
public Observable<Page<Metadata>> search(MetadataSearchCriteria criteria) {
String sourceAddress = toDto(criteria.getSourceAddress());
String targetAddress = toDto(criteria.getTargetAddress());
String scopedMetadataKey = toDto(criteria.getScopedMetadataKey());
String targetId = criteria.getTargetId();
MetadataTypeEnum metadataType = criteria.getMetadataType() == null ? null : MetadataTypeEnum.fromValue(criteria.getMetadataType().getValue());
String offset = criteria.getOffset();
Integer pageSize = criteria.getPageSize();
Integer pageNumber = criteria.getPageNumber();
Order order = toDto(criteria.getOrder());
Consumer<Handler<AsyncResult<MetadataPage>>> callback = handler -> getClient().searchMetadataEntries(sourceAddress, targetAddress, scopedMetadataKey, targetId, metadataType, pageSize, pageNumber, offset, order, handler);
return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(this::toMetadata).collect(Collectors.toList()))));
}
use of io.nem.symbol.sdk.openapi.vertx.model.Order in project nem2-sdk-java by nemtech.
the class AccountRepositoryVertxImpl method search.
@Override
public Observable<Page<AccountInfo>> search(AccountSearchCriteria criteria) {
Integer pageSize = criteria.getPageSize();
Integer pageNumber = criteria.getPageNumber();
String offset = criteria.getOffset();
Order order = toDto(criteria.getOrder());
AccountOrderByEnum orderBy = criteria.getOrderBy() == null ? null : AccountOrderByEnum.fromValue(criteria.getOrderBy().getValue());
String mosaicId = criteria.getMosaicId() == null ? null : criteria.getMosaicId().getIdAsHex();
Consumer<Handler<AsyncResult<AccountPage>>> callback = (handler) -> getClient().searchAccounts(pageSize, pageNumber, offset, order, orderBy, mosaicId, handler);
return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(this::toAccountInfo).collect(Collectors.toList()))));
}
use of io.nem.symbol.sdk.openapi.vertx.model.Order in project nem2-sdk-java by nemtech.
the class NamespaceRepositoryVertxImpl method search.
@Override
public Observable<Page<NamespaceInfo>> search(NamespaceSearchCriteria criteria) {
String ownerAddress = toDto(criteria.getOwnerAddress());
NamespaceRegistrationTypeEnum registrationType = criteria.getRegistrationType() == null ? null : NamespaceRegistrationTypeEnum.fromValue(criteria.getRegistrationType().getValue());
String level0 = criteria.getLevel0();
AliasTypeEnum aliasType = criteria.getAliasType() == null ? null : AliasTypeEnum.fromValue(criteria.getAliasType().getValue());
Integer pageSize = criteria.getPageSize();
Integer pageNumber = criteria.getPageNumber();
String offset = criteria.getOffset();
Order order = toDto(criteria.getOrder());
Consumer<Handler<AsyncResult<NamespacePage>>> callback = handler -> getClient().searchNamespaces(ownerAddress, registrationType, level0, aliasType, pageSize, pageNumber, offset, order, handler);
return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(this::toNamespaceInfo).collect(Collectors.toList()))));
}
use of io.nem.symbol.sdk.openapi.vertx.model.Order in project nem2-sdk-java by nemtech.
the class RestrictionAccountRepositoryVertxImpl method search.
@Override
public Observable<Page<AccountRestrictions>> search(AccountRestrictionSearchCriteria criteria) {
String address = toDto(criteria.getAddress());
Integer pageSize = criteria.getPageSize();
Integer pageNumber = criteria.getPageNumber();
String offset = criteria.getOffset();
Order order = toDto(criteria.getOrder());
Consumer<Handler<AsyncResult<AccountRestrictionsPage>>> handlerConsumer = (h) -> getClient().searchAccountRestrictions(address, pageSize, pageNumber, offset, order, h);
return this.call(handlerConsumer, this::toPage);
}
use of io.nem.symbol.sdk.openapi.vertx.model.Order in project nem2-sdk-java by nemtech.
the class ReceiptRepositoryVertxImpl method searchReceipts.
@Override
public Observable<Page<TransactionStatement>> searchReceipts(TransactionStatementSearchCriteria criteria) {
BigInteger height = criteria.getHeight();
BigInteger fromHeight = criteria.getFromHeight();
BigInteger toHeight = criteria.getToHeight();
List<ReceiptTypeEnum> receiptTypes = toDto(criteria.getReceiptTypes());
String recipientAddress = toDto(criteria.getRecipientAddress());
String senderAddress = toDto(criteria.getSenderAddress());
String targetAddress = toDto(criteria.getTargetAddress());
String artifactId = criteria.getArtifactId();
Integer pageSize = criteria.getPageSize();
Integer pageNumber = criteria.getPageNumber();
String offset = criteria.getOffset();
Order order = toDto(criteria.getOrder());
Consumer<Handler<AsyncResult<TransactionStatementPage>>> callback = (handler) -> getClient().searchReceipts(height, fromHeight, toHeight, receiptTypes, recipientAddress, senderAddress, targetAddress, artifactId, pageSize, pageNumber, offset, order, handler);
return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(mapper::createTransactionStatement).collect(Collectors.toList()))));
}
Aggregations