public class ClientDetectionDefaultImpl extends Object implements ClientDetectionInterface
ClientDetectionInterface
interface needs to be implemented
by services and applications serving multiple clients, to determine the
client from which the request has originated. This interface detects the
client type from the client request.Modifier and Type | Field and Description |
---|---|
protected static Debug |
debug |
protected static DefaultClientTypesManager |
defCTM |
Constructor and Description |
---|
ClientDetectionDefaultImpl()
Creates a client detection default implementation instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getClientType(javax.servlet.http.HttpServletRequest request)
This is the method used by the interface to set the client-type.
|
protected boolean |
userAgentCheck(String httpUA,
String clientUA)
This method contains the algorithm used to compare the
HTTPServletRequest
user-agent versus the Client user-agent. |
protected static Debug debug
protected static DefaultClientTypesManager defCTM
public ClientDetectionDefaultImpl()
public String getClientType(javax.servlet.http.HttpServletRequest request) throws ClientDetectionException
ClientDetectionDefaultImpl
currently uses the following
algorithm.
if userAgent equals a known user-agent then compare userAgent length and store the longest match if clientType not found return the default clientType
getClientType
in interface ClientDetectionInterface
request
- The calling object passes in the
HTTPServletRequest
.ClientDetectionException
- if a default client type cannot be foundprotected boolean userAgentCheck(String httpUA, String clientUA)
HTTPServletRequest
user-agent versus the Client
user-agent.httpUA
- The HTTPServletRequest user-agentclientUA
- The Client userAgentCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.