public FetcherIterator(Fetcher f, int pageSize) throws BrowseException { this.fetcher = f; fetcher.setPageSize(pageSize); currentPage = fetcher.getPage(); }
/** * Contructs a facade for accesing a browser. * * @param browser the browser to create the facade for */ public BrowserFacade(final IBrowser browser) { setService(browser); }
@Override public void fetchPrevious() throws BrowseException { fetcher.fetchPrevious(); }
public FetcherPageIterator(Fetcher f, int nextPageSize) throws BrowseException { this.fetcher = f; this.nextPageSize = nextPageSize; nextPage = fetcher.getPage(); }
@Override public void setPageSize(int pageSize) { this.fetcher.setPageSize(pageSize); }
@Override public void fetchFirst() throws BrowseException { fetcher.fetchFirst(); }
@Override public ResultPage fetchAndGetNextPage() throws BrowseException { return fetcher.fetchAndGetNextPage(); }
@Override public void fetchLast() throws BrowseException { fetcher.fetchLast(); }
@Override public void fetchNext(int skip) throws BrowseException { fetcher.fetchNext(skip); }
private ResultPage fetchInitialPageIfNecessary() throws BrowseException { ResultPage result = null; if (! initialized) { DataResponse resp = initialPageCallback.fetchPage(); cookie = resp.getCookie(); if (resp.getEstimatedCount()>=0) { this.count = resp.getEstimatedCount(); } initialized = true; result = new ResultPageImpl(resp.getPage()); } return result; }
@Override public void fetchFirst() throws BrowseException { fetch(Page.FIRST, 0); }
public FetcherImpl(IBrowser browser, InitialPageCallback initialPageCallback, Callable<Integer> counter) { this.browser = browser; this.counter = counter; this.initialPageCallback = initialPageCallback; this.pageSize = initialPageCallback.getPageSize(); }
@Override public Fetcher restoreFetcher(final Cookie cookie) { // log.info("OLD-BROWSE: restoreFetcher"); return new FetcherImpl(service, cookie); }
@Override public Fetcher aggregate(UUID uuid, Selection selection) throws NoSuchAggregationException, NoSuchFieldInRelationException, SuspendedAggregatingException { return aggregate(uuid, selection, true); }
@Override public void fetchNext() throws BrowseException { fetchNext(0); }
@Override public void fetchPrevious(int skip) throws BrowseException { fetcher.fetchPrevious(skip); }
@Override public ResultPage fetchAndGetNextPage() throws BrowseException { return fetch(Page.NEXT, 0); }
/** * Returns true iff initial page may match fetch request. * @param dir * @param limit * @param skip * @return */ private boolean initialPageMatchesFetchRequest(Page dir, int skip) { return pageSize==initialPageCallback.getPageSize() && skip==0 && (dir==Page.CURRENT || dir==Page.FIRST); }
@Override public void fetchNext(int skip) throws BrowseException { fetch(Page.NEXT, skip); }