Class Utils


  • public class Utils
    extends Object
    • Field Detail

      • publisherTime

        public static final long publisherTime
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • getGlobalDescriptor

        public static Configuration getGlobalDescriptor()
        Returns:
        - The descriptor for the APM plugin. In this case the global configuration.
      • getCurrentTimeInMillis

        public static long getCurrentTimeInMillis()
      • getTerminalOP

        public static String getTerminalOP​(String[] cmd)
        This function will execute command in terminal and return output
      • isValidHostName

        public static Boolean isValidHostName​(String hostname)
        Validator function to ensure that the hostname is valid. Also, fails on empty String.
      • getHostName

        public static String getHostName​(EnvVars envVars)
        This function will get hostname
      • getValue

        public static <T> T getValue​(T value,
                                     T defaultValue)
        This function will get a value if value not found return defaultvalue
      • sendEvent

        public static boolean sendEvent​(IEvent event)
        This function will assembel Event details and call client
      • sendMetrics

        public static boolean sendMetrics​(HashMap<String,​Object> payload)
        This function will send metrics if Enable Metric is selected
      • replaceCapsWithUnderscore

        public static String replaceCapsWithUnderscore​(String project)