Class AMClientDetector


  • public class AMClientDetector
    extends Object
    This is an utility to get the client type. This utility executes Client Detection Class provided in Client Detection Module Service and gets the client type. Default client type will be returned if there is no Client Detection Implementation provided
    • Constructor Detail

      • AMClientDetector

        public AMClientDetector()
        Constructs a AMClientDetector instance.
      • AMClientDetector

        public AMClientDetector​(String className)
        Applications can provide client detector implementation class
        Parameters:
        className - the name of the implementation class
      • AMClientDetector

        public AMClientDetector​(ClientDetectionInterface cd)
        Application provide custom detection class.
        Parameters:
        cd - class that implements ClientDetectionInterface.
    • Method Detail

      • getClientType

        public String getClientType​(jakarta.servlet.http.HttpServletRequest request)
        Returns the client type by executing client detector class provided in Client Detection Service.
        Parameters:
        request - HTTP Servlet Request.
        Returns:
        client type . Default client type will be returned if either the client detection is not enabled or the client detector class is not provided in cdm service. If it throws any exception by executing this class, this method will just return null .
      • isDetectionEnabled

        public boolean isDetectionEnabled()
        Returns true if the client detection is enabled.
        Returns:
        true if the client detection is enabled.
      • getClientTypesManagerInstance

        public static ClientTypesManager getClientTypesManagerInstance()
        Returns the ClientTypesManager Instance.
        Returns:
        the ClientTypesManager Instance.
      • isServicePassed

        public static boolean isServicePassed()
        Returns true if the client detection service is present or false if the client detection service is not present and the client attributes could not be retrieved.
        Returns:
        false if no Service is present. The default value is true.