Class TraceEventHelper


  • public class TraceEventHelper
    extends Object
    Helper class for TraceEvent
    • Constructor Detail

      • TraceEventHelper

        public TraceEventHelper()
    • Method Detail

      • filterPoolEvents

        public static List<TraceEvent> filterPoolEvents​(List<TraceEvent> data)
                                                 throws Exception
        Filter the pool events
        Parameters:
        data - The data
        Returns:
        The filtered events
        Throws:
        Exception - If an error occurs
      • poolManagedConnectionPools

        public static Map<String,​Set<String>> poolManagedConnectionPools​(List<TraceEvent> data)
                                                                        throws Exception
        Pool to Managed Connection Pools mapping
        Parameters:
        data - The data
        Returns:
        The mapping
        Throws:
        Exception - If an error occurs
      • getEvents

        public static List<TraceEvent> getEvents​(FileReader fr,
                                                 File directory)
                                          throws Exception
        Get the events
        Parameters:
        fr - The file reader
        directory - The directory
        Returns:
        The events
        Throws:
        Exception - If an error occurs
      • getStatus

        public static Map<String,​TraceEventStatus> getStatus​(Map<String,​List<TraceEvent>> input,
                                                                   boolean ignoreDelist,
                                                                   boolean ignoreTracking,
                                                                   boolean ignoreIncomplete)
        Get status
        Parameters:
        input - The input
        ignoreDelist - Should DELIST be ignored
        ignoreTracking - Should TRACKING be ignored
        ignoreIncomplete - Ignore incomplete traces
        Returns:
        The overall result
      • getStatus

        public static TraceEventStatus getStatus​(List<TraceEvent> data,
                                                 boolean ignoreDelist,
                                                 boolean ignoreTracking,
                                                 boolean ignoreIncomplete)
        Get status
        Parameters:
        data - The data
        ignoreDelist - Should DELIST be ignored
        ignoreTracking - Should TRACKING be ignored
        ignoreIncomplete - Ignore incomplete traces
        Returns:
        The status
      • isStartState

        public static boolean isStartState​(TraceEvent te)
        Is start state
        Parameters:
        te - The event
        Returns:
        The value
      • isEndState

        public static boolean isEndState​(TraceEvent te)
        Is end state
        Parameters:
        te - The event
        Returns:
        The value
      • isRed

        public static boolean isRed​(TraceEvent te)
        Is red
        Parameters:
        te - The event
        Returns:
        The value
      • isYellow

        public static boolean isYellow​(TraceEvent te)
        Is yellow
        Parameters:
        te - The event
        Returns:
        The value
      • getPoolData

        public static Map<String,​List<Interaction>> getPoolData​(List<TraceEvent> data,
                                                                      boolean ignoreDelist,
                                                                      boolean ignoreTracking,
                                                                      boolean ignoreIncomplete)
        Get the structured pool data
        Parameters:
        data - The data
        ignoreDelist - Should DELIST be ignored
        ignoreTracking - Should TRACKING be ignored
        ignoreIncomplete - Ignore incomplete traces
        Returns:
        The result
      • getConnectionListenerData

        public static Map<String,​List<Interaction>> getConnectionListenerData​(List<Interaction> data)
        Get a connection listener map
        Parameters:
        data - The data
        Returns:
        The result
      • hasException

        public static boolean hasException​(List<TraceEvent> events)
        Has an exception event
        Parameters:
        events - The events
        Returns:
        True if there is an exception
      • exceptionDescription

        public static String exceptionDescription​(String encoded)
        Get exception description
        Parameters:
        encoded - The encoded string
        Returns:
        The string
      • prettyPrint

        public static String prettyPrint​(TraceEvent te)
        Pretty print event
        Parameters:
        te - The event
        Returns:
        The string
      • getVersion

        public static TraceEvent getVersion​(List<TraceEvent> events)
        Get the version
        Parameters:
        events - The events
        Returns:
        The version information
      • getCCMStatus

        public static TraceEventStatus getCCMStatus​(List<TraceEvent> data,
                                                    boolean ignoreIncomplete)
        Get CCM pool status
        Parameters:
        data - The data
        ignoreIncomplete - Ignore incomplete stacks
        Returns:
        The status
      • getCCMPoolStatus

        public static TraceEventStatus getCCMPoolStatus​(List<TraceEvent> data,
                                                        boolean ignoreIncomplete)
        Get CCM pool status
        Parameters:
        data - The data
        ignoreIncomplete - Ignore incomplete stacks
        Returns:
        The status
      • getType

        public static TraceEvent getType​(List<TraceEvent> events,
                                         int... types)
        Get a specific event type
        Parameters:
        events - The events
        types - The types
        Returns:
        The first event type found; otherwise null if none
      • getType

        public static TraceEvent getType​(List<TraceEvent> events,
                                         String identifier,
                                         int... types)
        Get a specific event type
        Parameters:
        events - The events
        identifier - The connection listener
        types - The types
        Returns:
        The first event type found; otherwise null if none