public class UserAgentImpl extends Object implements UserAgent, ProviderScanner
| Constructor and Description |
|---|
UserAgentImpl() |
| Modifier and Type | Method and Description |
|---|---|
static StringBuilder |
buildUnsupportedMessage(Map<Provider,List<String>> unmetRequirements) |
static void |
describeUnmetRequirements(Map<Provider,List<String>> unmetRequirements,
StringBuilder destination) |
Provider |
findCompatibleProvider()
Scans the
Provider implementations, checks their requirements
and tries to find one that will work, preferring the one named by the
userAgentProvider property, if it was set. |
Provider |
findCompatibleProvider(String userAgentProvider)
Scans the
Provider implementations, checks their requirements
and tries to find one that will work, preferring the one whose
name was provided. |
Map<Provider,List<String>> |
getUnmetProviderRequirements()
Determines unmet requirements (if any) for each available
Provider implementation. |
boolean |
hasCompatibleProvider()
Calls
ProviderScanner.findCompatibleProvider() and
returns whether a compatible Provider was found. |
boolean |
hasCompatibleProvider(String userAgentProvider)
Calls
ProviderScanner.findCompatibleProvider(String) and
returns whether a compatible Provider was found. |
AuthorizationResponse |
requestAuthorizationCode(URI authorizationEndpoint,
URI redirectUri) |
public Provider findCompatibleProvider()
ProviderScannerProvider implementations, checks their requirements
and tries to find one that will work, preferring the one named by the
userAgentProvider property, if it was set.findCompatibleProvider in interface ProviderScannerProvider that was deemed compatible;
null if no compatible providers were found.public Provider findCompatibleProvider(String userAgentProvider)
ProviderScannerProvider implementations, checks their requirements
and tries to find one that will work, preferring the one whose
name was provided.findCompatibleProvider in interface ProviderScanneruserAgentProvider - the name of the preferred provider or
null if there's no preferenceProvider that was deemed compatible;
null if no compatible providers were found.public Map<Provider,List<String>> getUnmetProviderRequirements()
ProviderScannerProvider implementation.getUnmetProviderRequirements in interface ProviderScannerProvider instances to their list of unmet requirements.
If a Provider had all its requirements met, it will not be part of the map.
An empty map means all providers are compatible.public boolean hasCompatibleProvider()
ProviderScannerProviderScanner.findCompatibleProvider() and
returns whether a compatible Provider was found.hasCompatibleProvider in interface ProviderScannertrue if a compatible provider was found;
false otherwise.public boolean hasCompatibleProvider(String userAgentProvider)
ProviderScannerProviderScanner.findCompatibleProvider(String) and
returns whether a compatible Provider was found.hasCompatibleProvider in interface ProviderScanneruserAgentProvider - the name of the preferred provider or
null if there's no preferencetrue if a compatible provider was found;
false otherwise.public AuthorizationResponse requestAuthorizationCode(URI authorizationEndpoint, URI redirectUri) throws AuthorizationException
requestAuthorizationCode in interface UserAgentAuthorizationExceptionpublic static StringBuilder buildUnsupportedMessage(Map<Provider,List<String>> unmetRequirements)
public static void describeUnmetRequirements(Map<Provider,List<String>> unmetRequirements, StringBuilder destination)
Copyright © 2018. All rights reserved.