Search in sources :

Example 6 with Order

use of io.nem.symbol.sdk.openapi.vertx.model.Order 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 7 with Order

use of io.nem.symbol.sdk.openapi.vertx.model.Order 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)

Example 8 with Order

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

the class SecretLockRepositoryVertxImpl method search.

@Override
public Observable<Page<SecretLockInfo>> search(SecretLockSearchCriteria criteria) {
    String address = toDto(criteria.getAddress());
    Integer pageSize = criteria.getPageSize();
    Integer pageNumber = criteria.getPageNumber();
    String offset = criteria.getOffset();
    String secret = criteria.getSecret();
    Order order = toDto(criteria.getOrder());
    Consumer<Handler<AsyncResult<SecretLockPage>>> handlerConsumer = (h) -> getClient().searchSecretLock(address, secret, pageSize, pageNumber, offset, order, h);
    return this.call(handlerConsumer, this::toPage);
}
Also used : Order(io.nem.symbol.sdk.openapi.vertx.model.Order) MapperUtils(io.nem.symbol.core.utils.MapperUtils) SecretLockInfo(io.nem.symbol.sdk.model.transaction.SecretLockInfo) ApiClient(io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient) LockHashAlgorithm(io.nem.symbol.sdk.model.transaction.LockHashAlgorithm) LockStatus(io.nem.symbol.sdk.model.transaction.LockStatus) SecretLockEntryDTO(io.nem.symbol.sdk.openapi.vertx.model.SecretLockEntryDTO) MosaicId(io.nem.symbol.sdk.model.mosaic.MosaicId) Collectors(java.util.stream.Collectors) SecretLockRoutesApiImpl(io.nem.symbol.sdk.openapi.vertx.api.SecretLockRoutesApiImpl) Consumer(java.util.function.Consumer) SecretLockSearchCriteria(io.nem.symbol.sdk.api.SecretLockSearchCriteria) SecretLockInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.SecretLockInfoDTO) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) SecretLockPage(io.nem.symbol.sdk.openapi.vertx.model.SecretLockPage) ObjectUtils(org.apache.commons.lang3.ObjectUtils) MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) SecretLockRoutesApi(io.nem.symbol.sdk.openapi.vertx.api.SecretLockRoutesApi) Observable(io.reactivex.Observable) SecretLockRepository(io.nem.symbol.sdk.api.SecretLockRepository) AsyncResult(io.vertx.core.AsyncResult) Handler(io.vertx.core.Handler) Page(io.nem.symbol.sdk.api.Page) Handler(io.vertx.core.Handler) SecretLockPage(io.nem.symbol.sdk.openapi.vertx.model.SecretLockPage)

Example 9 with Order

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

the class HashLockRepositoryVertxImpl method search.

@Override
public Observable<Page<HashLockInfo>> search(HashLockSearchCriteria 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<HashLockPage>>> handlerConsumer = (h) -> getClient().searchHashLock(address, pageSize, pageNumber, offset, order, h);
    return this.call(handlerConsumer, this::toPage);
}
Also used : Order(io.nem.symbol.sdk.openapi.vertx.model.Order) MapperUtils(io.nem.symbol.core.utils.MapperUtils) ApiClient(io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient) HashLockPage(io.nem.symbol.sdk.openapi.vertx.model.HashLockPage) HashLockRepository(io.nem.symbol.sdk.api.HashLockRepository) HashLockRoutesApi(io.nem.symbol.sdk.openapi.vertx.api.HashLockRoutesApi) LockStatus(io.nem.symbol.sdk.model.transaction.LockStatus) HashLockSearchCriteria(io.nem.symbol.sdk.api.HashLockSearchCriteria) HashLockRoutesApiImpl(io.nem.symbol.sdk.openapi.vertx.api.HashLockRoutesApiImpl) Collectors(java.util.stream.Collectors) HashLockInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.HashLockInfoDTO) HashLockEntryDTO(io.nem.symbol.sdk.openapi.vertx.model.HashLockEntryDTO) Consumer(java.util.function.Consumer) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) ObjectUtils(org.apache.commons.lang3.ObjectUtils) MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) HashLockInfo(io.nem.symbol.sdk.model.transaction.HashLockInfo) Observable(io.reactivex.Observable) AsyncResult(io.vertx.core.AsyncResult) Handler(io.vertx.core.Handler) Page(io.nem.symbol.sdk.api.Page) HashLockPage(io.nem.symbol.sdk.openapi.vertx.model.HashLockPage) Handler(io.vertx.core.Handler)

Example 10 with Order

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

the class RestrictionMosaicRepositoryVertxImpl method search.

@Override
public Observable<Page<MosaicRestriction<?>>> search(MosaicRestrictionSearchCriteria criteria) {
    String mosaicId = criteria.getMosaicId() == null ? null : criteria.getMosaicId().getIdAsHex();
    MosaicRestrictionEntryTypeEnum entryType = criteria.getEntryType() == null ? null : MosaicRestrictionEntryTypeEnum.fromValue(criteria.getEntryType().getValue());
    String targetAddress = toDto(criteria.getTargetAddress());
    Integer pageSize = criteria.getPageSize();
    Integer pageNumber = criteria.getPageNumber();
    String offset = criteria.getOffset();
    Order order = toDto(criteria.getOrder());
    Consumer<Handler<AsyncResult<MosaicRestrictionsPage>>> callback = (h) -> getClient().searchMosaicRestrictions(mosaicId, entryType, targetAddress, pageSize, pageNumber, offset, order, h);
    return call(callback, page -> toPage(page.getPagination(), page.getData().stream().map(this::toMosaicRestriction).collect(Collectors.toList())));
}
Also used : BigInteger(java.math.BigInteger) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) MosaicAddressRestrictionEntryWrapperDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicAddressRestrictionEntryWrapperDTO) RestrictionMosaicRepository(io.nem.symbol.sdk.api.RestrictionMosaicRepository) RestrictionMosaicRoutesApi(io.nem.symbol.sdk.openapi.vertx.api.RestrictionMosaicRoutesApi) MosaicRestrictionEntryTypeEnum(io.nem.symbol.sdk.openapi.vertx.model.MosaicRestrictionEntryTypeEnum) MosaicRestrictionsPage(io.nem.symbol.sdk.openapi.vertx.model.MosaicRestrictionsPage) LinkedHashMap(java.util.LinkedHashMap) MosaicGlobalRestrictionEntryWrapperDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicGlobalRestrictionEntryWrapperDTO) MosaicRestrictionSearchCriteria(io.nem.symbol.sdk.api.MosaicRestrictionSearchCriteria) MosaicRestriction(io.nem.symbol.sdk.model.restriction.MosaicRestriction) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) MosaicRestrictionType(io.nem.symbol.sdk.model.transaction.MosaicRestrictionType) ObjectUtils(org.apache.commons.lang3.ObjectUtils) Map(java.util.Map) MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) MosaicGlobalRestrictionEntryRestrictionDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicGlobalRestrictionEntryRestrictionDTO) Observable(io.reactivex.Observable) BigInteger(java.math.BigInteger) AsyncResult(io.vertx.core.AsyncResult) MosaicGlobalRestrictionDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicGlobalRestrictionDTO) MapperUtils(io.nem.symbol.core.utils.MapperUtils) ApiClient(io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient) MosaicAddressRestrictionDTO(io.nem.symbol.sdk.openapi.vertx.model.MosaicAddressRestrictionDTO) RestrictionMosaicRoutesApiImpl(io.nem.symbol.sdk.openapi.vertx.api.RestrictionMosaicRoutesApiImpl) MosaicGlobalRestriction(io.nem.symbol.sdk.model.restriction.MosaicGlobalRestriction) MosaicRestrictionEntryType(io.nem.symbol.sdk.model.restriction.MosaicRestrictionEntryType) Collectors(java.util.stream.Collectors) Consumer(java.util.function.Consumer) MosaicGlobalRestrictionItem(io.nem.symbol.sdk.model.restriction.MosaicGlobalRestrictionItem) Handler(io.vertx.core.Handler) Page(io.nem.symbol.sdk.api.Page) MosaicAddressRestriction(io.nem.symbol.sdk.model.restriction.MosaicAddressRestriction) Handler(io.vertx.core.Handler) MosaicRestrictionEntryTypeEnum(io.nem.symbol.sdk.openapi.vertx.model.MosaicRestrictionEntryTypeEnum) MosaicRestrictionsPage(io.nem.symbol.sdk.openapi.vertx.model.MosaicRestrictionsPage)

Aggregations

Page (io.nem.symbol.sdk.api.Page)10 ApiClient (io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient)10 Order (io.nem.symbol.sdk.openapi.vertx.model.Order)10 Observable (io.reactivex.Observable)10 AsyncResult (io.vertx.core.AsyncResult)10 Handler (io.vertx.core.Handler)10 Consumer (java.util.function.Consumer)10 Collectors (java.util.stream.Collectors)10 MerkleStateInfo (io.nem.symbol.sdk.model.blockchain.MerkleStateInfo)7 ObjectUtils (org.apache.commons.lang3.ObjectUtils)7 MapperUtils (io.nem.symbol.core.utils.MapperUtils)6 List (java.util.List)5 BigInteger (java.math.BigInteger)4 ReceiptRepository (io.nem.symbol.sdk.api.ReceiptRepository)3 ResolutionStatementSearchCriteria (io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria)3 TransactionStatementSearchCriteria (io.nem.symbol.sdk.api.TransactionStatementSearchCriteria)3 Address (io.nem.symbol.sdk.model.account.Address)3 AddressResolutionStatement (io.nem.symbol.sdk.model.receipt.AddressResolutionStatement)3 MosaicResolutionStatement (io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement)3 ReceiptType (io.nem.symbol.sdk.model.receipt.ReceiptType)3