public class VerificationRequester extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
VerificationRequester.VerifyTask
Inner class for doing requests to validation server.
|
Modifier and Type | Field and Description |
---|---|
private ExecutorCompletionService<VerificationResponse> |
completionService |
Constructor and Description |
---|
VerificationRequester()
Sets up thread pool for validation requests.
|
Modifier and Type | Method and Description |
---|---|
protected VerificationRequester.VerifyTask |
createTask(String userAgent,
String url,
int maxRetries) |
VerificationResponse |
fetch(List<String> urls,
String userAgent)
Deprecated.
Use
fetch(List, String, int) with an explicit
maxRetries argument instead. |
VerificationResponse |
fetch(List<String> urls,
String userAgent,
int maxRetries)
Fires off a validation request to each url in the list, returning the first one
that is not
ResponseStatus.REPLAYED_REQUEST |
private final ExecutorCompletionService<VerificationResponse> completionService
public VerificationRequester()
@Deprecated public VerificationResponse fetch(List<String> urls, String userAgent) throws YubicoVerificationException
fetch(List, String, int)
with an explicit
maxRetries
argument instead.fetch(urls, userAgent, 5)
.YubicoVerificationException
public VerificationResponse fetch(List<String> urls, String userAgent, int maxRetries) throws YubicoVerificationException
ResponseStatus.REPLAYED_REQUEST
urls
- a list of validation urls to be contacteduserAgent
- userAgent to send in request, if null one will be generatedmaxRetries
- maximum number of retries in the case of network errors. Must not be negative.VerificationResponse
object from the first server response that is not
ResponseStatus.REPLAYED_REQUEST
YubicoVerificationException
- if validation fails on all urlsprotected VerificationRequester.VerifyTask createTask(String userAgent, String url, int maxRetries)
Copyright © 2020 Yubico AB. All Rights Reserved.