Package com.iplanet.services.cdm
Class ClientDetectionDefaultImpl
- java.lang.Object
-
- com.iplanet.services.cdm.ClientDetectionDefaultImpl
-
- All Implemented Interfaces:
ClientDetectionInterface
public class ClientDetectionDefaultImpl extends Object implements ClientDetectionInterface
TheClientDetectionInterfaceinterface 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected static Debugdebugprotected static DefaultClientTypesManagerdefCTM
-
Constructor Summary
Constructors Constructor Description ClientDetectionDefaultImpl()Creates a client detection default implementation instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetClientType(jakarta.servlet.http.HttpServletRequest request)This is the method used by the interface to set the client-type.protected booleanuserAgentCheck(String httpUA, String clientUA)This method contains the algorithm used to compare theHTTPServletRequestuser-agent versus theClientuser-agent.
-
-
-
Field Detail
-
debug
protected static Debug debug
-
defCTM
protected static DefaultClientTypesManager defCTM
-
-
Method Detail
-
getClientType
public String getClientType(jakarta.servlet.http.HttpServletRequest request) throws ClientDetectionException
This is the method used by the interface to set the client-type.ClientDetectionDefaultImplcurrently 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- Specified by:
getClientTypein interfaceClientDetectionInterface- Parameters:
request- The calling object passes in theHTTPServletRequest.- Returns:
- The string corresponding to the client type.
- Throws:
ClientDetectionException- if a default client type cannot be found
-
userAgentCheck
protected boolean userAgentCheck(String httpUA, String clientUA)
This method contains the algorithm used to compare theHTTPServletRequestuser-agent versus theClientuser-agent.- Parameters:
httpUA- The HTTPServletRequest user-agentclientUA- The Client userAgent- Returns:
- True or false if they match
-
-