Class TraceRecordFormatter


  • public class TraceRecordFormatter
    extends Object
    This class is used to format the trace record.
    Version:
    1.0
    Author:
    Kannan Srinivasan
    • Constructor Detail

      • TraceRecordFormatter

        public TraceRecordFormatter()
    • Method Detail

      • createTraceRecord

        public static String createTraceRecord​(Object tid,
                                               Object origin,
                                               String message)
        Returns the formatted record, by accepting the simple string message, tid and originator, which can be written to OutputStream
        Parameters:
        tid - an Object value
        origin - an Object value
        message - a String value
        Returns:
        a String value
      • getTraceRecordScheme

        public static String getTraceRecordScheme()
        Returns the scheme used to format the record. This prints the different components (fields) of the trace and record and their order of occurrence.
        Returns:
        a String value
      • convertToString

        public static String convertToString​(byte[] byteArray)
        Helper method to convert a byte arror to string. This is typically used for printing Xids.
        Parameters:
        byteArray - a byte[] value
        Returns:
        a String value
      • convertXidArrayToString

        public static String convertXidArrayToString​(Xid[] xidArray)
        Converts an array of xids to string that can be printed. Its a helper method.
        Parameters:
        xidArray - a Xid[] value
        Returns:
        a String value
      • convertPropsToString

        public static String convertPropsToString​(Properties prop)
        Helper method to convert properties to string.
        Parameters:
        prop - a Properties value
        Returns:
        a String value