Search in sources :

Example 1 with BlockchainIdentity

use of com.jd.blockchain.ledger.BlockchainIdentity in project jdchain-core by blockchain-jd-com.

the class ContractLedgerQueryService method getUserEventAccounts.

@Override
public BlockchainIdentity[] getUserEventAccounts(int fromIndex, int count) {
    EventAccountSet eventAccountSet = ledgerQuery.getLedgerEventSet().getEventAccountSet();
    QueryArgs queryArgs = QueryUtils.calFromIndexAndCountDescend(fromIndex, count, (int) eventAccountSet.getTotal());
    SkippingIterator<BlockchainIdentity> it = eventAccountSet.identityIterator();
    it.skip(queryArgs.getFrom());
    return it.next(queryArgs.getCount(), BlockchainIdentity.class);
}
Also used : QueryArgs(utils.query.QueryArgs) BlockchainIdentity(com.jd.blockchain.ledger.BlockchainIdentity) EventAccountSet(com.jd.blockchain.ledger.core.EventAccountSet)

Example 2 with BlockchainIdentity

use of com.jd.blockchain.ledger.BlockchainIdentity in project jdchain-core by blockchain-jd-com.

the class UncommittedLedgerQueryService method getUserEventAccounts.

@Override
public BlockchainIdentity[] getUserEventAccounts(int fromIndex, int count) {
    EventAccountSet eventAccountSet = transactionContext.getEventSet().getEventAccountSet();
    QueryArgs queryArgs = QueryUtils.calFromIndexAndCountDescend(fromIndex, count, (int) eventAccountSet.getTotal());
    SkippingIterator<BlockchainIdentity> it = eventAccountSet.identityIterator();
    it.skip(queryArgs.getFrom());
    return it.next(queryArgs.getCount(), BlockchainIdentity.class);
}
Also used : QueryArgs(utils.query.QueryArgs) BlockchainIdentity(com.jd.blockchain.ledger.BlockchainIdentity) EventAccountSet(com.jd.blockchain.ledger.core.EventAccountSet)

Example 3 with BlockchainIdentity

use of com.jd.blockchain.ledger.BlockchainIdentity in project jdchain-core by blockchain-jd-com.

the class UncommittedLedgerQueryService method getContractAccounts.

@Override
public BlockchainIdentity[] getContractAccounts(int fromIndex, int count) {
    ContractAccountSet contractAccountSet = transactionContext.getDataset().getContractAccountSet();
    QueryArgs queryArgs = QueryUtils.calFromIndexAndCountDescend(fromIndex, count, (int) contractAccountSet.getTotal());
    SkippingIterator<BlockchainIdentity> it = contractAccountSet.identityIterator();
    it.skip(queryArgs.getFrom());
    return it.next(queryArgs.getCount(), BlockchainIdentity.class);
}
Also used : QueryArgs(utils.query.QueryArgs) BlockchainIdentity(com.jd.blockchain.ledger.BlockchainIdentity) ContractAccountSet(com.jd.blockchain.ledger.core.ContractAccountSet)

Example 4 with BlockchainIdentity

use of com.jd.blockchain.ledger.BlockchainIdentity in project jdchain-core by blockchain-jd-com.

the class UncommittedLedgerQueryService method getDataAccounts.

@Override
public BlockchainIdentity[] getDataAccounts(int fromIndex, int count) {
    DataAccountSet dataAccountSet = transactionContext.getDataset().getDataAccountSet();
    QueryArgs queryArgs = QueryUtils.calFromIndexAndCountDescend(fromIndex, count, (int) dataAccountSet.getTotal());
    SkippingIterator<BlockchainIdentity> it = dataAccountSet.identityIterator();
    it.skip(queryArgs.getFrom());
    return it.next(queryArgs.getCount(), BlockchainIdentity.class);
}
Also used : QueryArgs(utils.query.QueryArgs) BlockchainIdentity(com.jd.blockchain.ledger.BlockchainIdentity) DataAccountSet(com.jd.blockchain.ledger.core.DataAccountSet)

Example 5 with BlockchainIdentity

use of com.jd.blockchain.ledger.BlockchainIdentity in project jdchain-core by blockchain-jd-com.

the class ContractLedgerQueryService method getContractAccounts.

@Override
public BlockchainIdentity[] getContractAccounts(int fromIndex, int count) {
    ContractAccountSet contractAccountSet = ledgerQuery.getContractAccountset();
    QueryArgs queryArgs = QueryUtils.calFromIndexAndCountDescend(fromIndex, count, (int) contractAccountSet.getTotal());
    SkippingIterator<BlockchainIdentity> it = contractAccountSet.identityIterator();
    it.skip(queryArgs.getFrom());
    return it.next(queryArgs.getCount(), BlockchainIdentity.class);
}
Also used : QueryArgs(utils.query.QueryArgs) BlockchainIdentity(com.jd.blockchain.ledger.BlockchainIdentity) ContractAccountSet(com.jd.blockchain.ledger.core.ContractAccountSet)

Aggregations

BlockchainIdentity (com.jd.blockchain.ledger.BlockchainIdentity)17 QueryArgs (utils.query.QueryArgs)12 LedgerBlock (com.jd.blockchain.ledger.LedgerBlock)4 LedgerQuery (com.jd.blockchain.ledger.core.LedgerQuery)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 ContractAccountSet (com.jd.blockchain.ledger.core.ContractAccountSet)3 DataAccountSet (com.jd.blockchain.ledger.core.DataAccountSet)3 EventAccountSet (com.jd.blockchain.ledger.core.EventAccountSet)3 UserAccountSet (com.jd.blockchain.ledger.core.UserAccountSet)3 ContractInfo (com.jd.blockchain.ledger.ContractInfo)2 DataAccountInfo (com.jd.blockchain.ledger.DataAccountInfo)2 SecurityPolicy (com.jd.blockchain.ledger.SecurityPolicy)2 UserInfo (com.jd.blockchain.ledger.UserInfo)2 Bytes (utils.Bytes)2 Transaction (com.jd.blockchain.gateway.service.search.Transaction)1 AccountDataPermission (com.jd.blockchain.ledger.AccountDataPermission)1 IllegalTransactionException (com.jd.blockchain.ledger.IllegalTransactionException)1 LedgerTransaction (com.jd.blockchain.ledger.LedgerTransaction)1 DataAccount (com.jd.blockchain.ledger.core.DataAccount)1 DataAccountSetEditor (com.jd.blockchain.ledger.core.DataAccountSetEditor)1