public final class TelegramQuery extends APIQuery<TelegramQuery,Void>
generalRateLimiter, resourceValueuserAgent| Constructor and Description |
|---|
TelegramQuery(IXmlConverter xmlConverter,
IRateLimiter generalRateLimiter,
IRateLimiter scrapingRateLimiter,
IRateLimiter telegramRateLimiter,
IRateLimiter recruitmentTelegramRateLimiter,
String baseUrl,
String userAgent,
int apiVersion,
String clientKey,
String telegramId,
String secretKey,
String... nations)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
TelegramQuery |
addListeners(TelegramSentListener... newListeners)
Registers new telegram event listeners.
|
protected String |
buildURL()
Generates a String URL based on the supplied values.
|
long |
estimatedDuration()
The estimated time it will take to send all of this query's telegrams, in
milliseconds.
|
<T> T |
execute(Class<T> type)
Executes this query, returning any result.
|
protected IRateLimiter |
getRateLimiter()
Returns the rate limiter to use in the makeRequest()-function.
|
TelegramQuery |
isDryRun()
Sets this telegram query as a dry run, meaning no actual telegrams will
be sent.
|
TelegramQuery |
isRecruitment()
Ensures the telegram will be send as if it is a recruitment telegram.
|
protected String |
resourceString()
Gives the resource string of this Query, e.g.
|
protected <T> T |
translateResponse(InputStream response,
Class<T> type)
Translates the stream response to the object this Query wishes to return
via its execute() function.
|
protected void |
validateQueryParameters()
Validates the query parameters before executing the query.
|
closeInputStreamQuietly, execute, makeRequestpublic TelegramQuery(IXmlConverter xmlConverter, IRateLimiter generalRateLimiter, IRateLimiter scrapingRateLimiter, IRateLimiter telegramRateLimiter, IRateLimiter recruitmentTelegramRateLimiter, String baseUrl, String userAgent, int apiVersion, String clientKey, String telegramId, String secretKey, String... nations)
xmlConverter - generalRateLimiter - scrapingRateLimiter - telegramRateLimiter - recruitmentTelegramRateLimiter - baseUrl - userAgent - apiVersion - clientKey - the client keytelegramId - the telegram idsecretKey - the telegram's secret keynations - the nation(s) to send the telegram topublic TelegramQuery isDryRun()
public TelegramQuery isRecruitment()
public TelegramQuery addListeners(TelegramSentListener... newListeners)
newListeners - the listeners to registerprotected String resourceString()
APIQueryresourceString in class APIQuery<TelegramQuery,Void>protected void validateQueryParameters()
AbstractQueryvalidateQueryParameters in class APIQuery<TelegramQuery,Void>protected <T> T translateResponse(InputStream response, Class<T> type)
AbstractQuerytranslateResponse in class AbstractQuery<TelegramQuery,Void>T - type to parse toresponse - the response to translatetype - type to parse topublic long estimatedDuration()
public <T> T execute(Class<T> type)
AbstractQueryexecute in class APIQuery<TelegramQuery,Void>T - the type to returntype - the type to returnprotected String buildURL()
AbstractQuerybuildURL in class APIQuery<TelegramQuery,Void>protected IRateLimiter getRateLimiter()
APIQuerygetRateLimiter in class APIQuery<TelegramQuery,Void>Copyright © 2017. All rights reserved.