Class ClientBuilder
java.lang.Object
org.mineskin.ClientBuilder
-
Method Summary
Modifier and TypeMethodDescriptionSet the API keySet the base URL for the APIbuild()Build the MineSkinClientstatic ClientBuildercreate()Create a new ClientBuildergenerateExecutor(Executor generateExecutor) Set the Executor for generate requestsgenerateQueueOptions(IQueueOptions queueOptions) Set the options for submitting queue jobs
defaults to 200ms interval and 1 concurrent request
For example:generateRequestScheduler(ScheduledExecutorService scheduledExecutor) Deprecated.getExecutor(Executor getExecutor) Set the Executor for get requestsgetQueueOptions(IQueueOptions queueOptions) Set the options for get requests, e.g. getting skins
defaults to 100ms interval and 5 concurrent requests
For example:getRequestScheduler(ScheduledExecutorService scheduledExecutor) Deprecated.usegetQueueOptions(IQueueOptions)insteadgson(com.google.gson.Gson gson) Set the Gson instancejobCheckOptions(IJobCheckOptions jobCheckOptions) Set the options for checking job status
defaults to 1000ms interval, 2000ms initial delay, and 10 max attempts
For example:jobCheckScheduler(ScheduledExecutorService scheduledExecutor) Deprecated.usejobCheckOptions(IJobCheckOptions)insteadrequestHandler(RequestHandlerConstructor requestHandlerConstructor) Set the constructor for the RequestHandlertimeout(int timeout) Set the timeoutSet the User-Agent
-
Method Details
-
create
Create a new ClientBuilder -
baseUrl
Set the base URL for the API- Parameters:
baseUrl- the base URL, e.g. "https://api.mineskin.org"
-
userAgent
Set the User-Agent -
apiKey
Set the API key -
timeout
Set the timeout -
gson
Set the Gson instance -
getExecutor
Set the Executor for get requests -
generateExecutor
Set the Executor for generate requests -
generateRequestScheduler
@Deprecated public ClientBuilder generateRequestScheduler(ScheduledExecutorService scheduledExecutor) Deprecated.usegenerateQueueOptions(IQueueOptions)insteadSet the ScheduledExecutorService for submitting queue jobs -
generateQueueOptions
Set the options for submitting queue jobs
defaults to 200ms interval and 1 concurrent request
For example:GenerateQueueOptions.create() .withInterval(200, TimeUnit.MILLISECONDS) .withConcurrency(2)- See Also:
-
getRequestScheduler
Deprecated.usegetQueueOptions(IQueueOptions)insteadSet the ScheduledExecutorService for get requests, e.g. getting skins -
getQueueOptions
Set the options for get requests, e.g. getting skins
defaults to 100ms interval and 5 concurrent requests
For example:GetQueueOptions.create() .withInterval(500, TimeUnit.MILLISECONDS)- See Also:
-
jobCheckScheduler
Deprecated.usejobCheckOptions(IJobCheckOptions)insteadSet the ScheduledExecutorService for checking job status -
jobCheckOptions
Set the options for checking job status
defaults to 1000ms interval, 2000ms initial delay, and 10 max attempts
For example:JobCheckOptions.create() .withInitialDelay(1000, TimeUnit.MILLISECONDS) .withInterval(RequestInterval.exponential()) .withMaxAttempts(50)- See Also:
-
requestHandler
Set the constructor for the RequestHandler -
build
Build the MineSkinClient
-
generateQueueOptions(IQueueOptions)instead