001package org.gbif.api.util.iterables;
002
003import org.gbif.api.model.common.paging.PagingRequest;
004import org.gbif.api.model.common.paging.PagingResponse;
005import org.gbif.api.model.registry.Node;
006import org.gbif.api.service.registry.NodeService;
007
008/**
009 * Pages through all organizations optionally filtering by country.
010 */
011public class NodePager extends EntityPager<Node> {
012
013    private final NodeService service;
014
015    public NodePager(NodeService service, int pageSize) {
016        super(pageSize);
017        this.service = service;
018    }
019
020    @Override
021    PagingResponse<Node> nextPage(PagingRequest page) {
022        return service.list(page);
023    }
024
025}