public abstract class TwitterPageableReader<E,C extends TwitterResponse & CursorSupport> extends TwitterReader
Modifier and Type | Class and Description |
---|---|
static class |
TwitterPageableReader.Direction |
DataEndpoint.State
Modifier and Type | Field and Description |
---|---|
static int |
FIRST_PAGE |
EOF
fieldLineage, recordLineage
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
TwitterPageableReader(String rateLimitResource,
String rateLimitKey,
String consumerKey,
String consumerSecret,
int pageSize) |
TwitterPageableReader(String rateLimitResource,
String rateLimitKey,
String consumerKey,
String consumerSecret,
String accessToken,
String accessTokenSecret,
int pageSize) |
TwitterPageableReader(String rateLimitResource,
String rateLimitKey,
TwitterProvider provider,
int pageSize) |
Modifier and Type | Method and Description |
---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException . |
protected abstract void |
addPageToBuffer(C list,
LinkedList<E> buffer) |
protected abstract void |
copyToRecord(E element,
Record record,
IEntityExpansionPolicy entityExpansionPolicy) |
TwitterPageableReader.Direction |
getDirection() |
long |
getPage() |
protected abstract C |
getPageImpl(long page,
int pageSize) |
int |
getPageSize() |
long |
getStartingOffset() |
void |
open()
Makes this endpoint ready for reading or writing.
|
protected Record |
readImpl()
Overridden by subclasses to read the next record from this
DataReader . |
TwitterPageableReader<E,C> |
setApiLimitPolicy(IApiLimitPolicy apiLimitPolicy) |
TwitterPageableReader<E,C> |
setDirection(TwitterPageableReader.Direction direction) |
TwitterPageableReader<E,C> |
setStartingOffset(long startingOffset) |
getApiLimitPolicy, getConverter, getEntityExpansionPolicy, getProvider, getRateLimit, getRateLimit, isRateLimitExceeded, onRateLimitExceeded, reloadRateLimit, setConverter, setEntityExpansionPolicy, setRateLimit, setRateLimit, setRateLimitExceeded
addLineage, available, getBufferSize, getNestedEndpoint, getNestedReader, getRootEndpoint, getRootReader, isExhausted, isLineageSupported, isSaveLineage, peek, pop, push, read, setSaveLineage, skip
close, decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toString
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public static final int FIRST_PAGE
public TwitterPageableReader(String rateLimitResource, String rateLimitKey, TwitterProvider provider, int pageSize)
public TwitterPageableReader(String rateLimitResource, String rateLimitKey, String consumerKey, String consumerSecret, int pageSize)
public int getPageSize()
public long getStartingOffset()
public TwitterPageableReader<E,C> setStartingOffset(long startingOffset)
public long getPage()
public TwitterPageableReader.Direction getDirection()
public TwitterPageableReader<E,C> setDirection(TwitterPageableReader.Direction direction)
public TwitterPageableReader<E,C> setApiLimitPolicy(IApiLimitPolicy apiLimitPolicy)
setApiLimitPolicy
in class TwitterReader
public void open() throws DataException
DataEndpoint
open
in class TwitterReader
DataException
protected abstract C getPageImpl(long page, int pageSize) throws Throwable
Throwable
protected abstract void addPageToBuffer(C list, LinkedList<E> buffer) throws Throwable
Throwable
protected abstract void copyToRecord(E element, Record record, IEntityExpansionPolicy entityExpansionPolicy) throws Throwable
Throwable
protected Record readImpl() throws Throwable
DataReader
DataReader
. The default
implementation of DataReader.read()
now insures that this method will not be called again after it returns
a null
.
If no record is available, null
will be returned.
readImpl
in class DataReader
Throwable
public DataException addExceptionProperties(DataException exception)
Endpoint
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in class TwitterReader
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.