T - The type of objects which will be created from this task.D - A sub type of CrawlerUrlDTO which this task will use to
create the result objects.public abstract class AbstractRestTask<T,D extends CrawlerUrlDTO> extends AbstractUrlTask<T,D>
AbstractUrlTask which takes a
ConcurrentLinkedQueue of D and loads the URL with REST as
WebTarget.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Optional<java.lang.String> |
authKey |
protected static java.lang.String |
AUTHORIZATION_BEARER |
protected static java.lang.String |
ENCODING_GZIP |
protected static java.lang.String |
HEADER_ACCEPT_ENCODING |
protected static java.lang.String |
HEADER_AUTHORIZATION |
crawler, taskResults| Constructor and Description |
|---|
AbstractRestTask(MediathekReader aCrawler,
java.util.concurrent.ConcurrentLinkedQueue<D> aUrlToCrawlDTOs,
java.util.Optional<java.lang.String> aAuthKey) |
| Modifier and Type | Method and Description |
|---|---|
protected WebTarget |
createWebTarget(java.lang.String aUrl)
Creates a
WebTarget. |
protected void |
processElement(D aDTO)
In this method you have to use the element
D to create a object of
the return type T. |
protected abstract void |
processRestTarget(D aDTO,
WebTarget aTarget)
In this method you have to use the
WebTarget to create a object of
the return type T. |
getMaxElementsToProcesscompute, createNewOwnInstanceadapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnforkprotected static final java.lang.String ENCODING_GZIP
protected static final java.lang.String HEADER_ACCEPT_ENCODING
protected static final java.lang.String HEADER_AUTHORIZATION
protected static final java.lang.String AUTHORIZATION_BEARER
protected final transient java.util.Optional<java.lang.String> authKey
public AbstractRestTask(MediathekReader aCrawler, java.util.concurrent.ConcurrentLinkedQueue<D> aUrlToCrawlDTOs, java.util.Optional<java.lang.String> aAuthKey)
protected abstract void processRestTarget(D aDTO, WebTarget aTarget)
WebTarget to create a object of
the return type T. Add the results to
AbstractRecursivConverterTask.taskResults.aDTO - A DTO containing at least the URL of the given document.aTarget - The WebTarget.protected void processElement(D aDTO)
AbstractRecursivConverterTaskD to create a object of
the return type T. Add the results to AbstractRecursivConverterTask.taskResults.processElement in class AbstractUrlTask<T,D extends CrawlerUrlDTO>aDTO - A element to be processed.protected WebTarget createWebTarget(java.lang.String aUrl)
WebTarget.aUrl - the url.WebTarget to access the url.