Class EventDatabaseConstants


  • public class EventDatabaseConstants
    extends EventConstants
    This class contains the constants and methods related to inserting events into the database
    Author:
    Sowmya Kumaraswamy
    • Field Detail

      • NAME_VAL_DELIM

        public static final char NAME_VAL_DELIM
        The 'parms' are added to a single column of the DB - the parm name and value are added as delimiter separated list of ' = ' strings
        See Also:
        Constant Field Values
      • MULTIPLE_VAL_DELIM

        public static final char MULTIPLE_VAL_DELIM
        The delimiter used to delimit multiple values of the same element that are appended and made the value of a single database column
        See Also:
        Constant Field Values
      • ATTRIB_DELIM

        public static final java.lang.String ATTRIB_DELIM
        The parser adds the value and attributes of an element to a single element of eventBlock and uses the ATTRIB_DELIM to separate these values
        See Also:
        Constant Field Values
      • DB_ATTRIB_DELIM

        public static final char DB_ATTRIB_DELIM
        The values and the corresponding attributes of an element are added to a single column of the table and delimited by DB_ATTRIB_DELIM
        See Also:
        Constant Field Values
      • VALUE_TRUNCATE_INDICATOR

        public static final java.lang.String VALUE_TRUNCATE_INDICATOR
        Multiple values of any xml element are appended into one value when inserted into the database - if the length of the appended string exceeds the column length, the value is appended with this pattern
        See Also:
        Constant Field Values
    • Constructor Detail

      • EventDatabaseConstants

        public EventDatabaseConstants()
    • Method Detail

      • escape

        public static java.lang.String escape​(java.lang.String inStr,
                                              char delimchar)
        This method is used to escape required values from strings that may contain those values. If the passed string contains the passed value then the character is reformatted into its %dd format.
        Parameters:
        inStr - string that might contain the delimiter
        delimchar - delimiter to escape
        Returns:
        The string with the delimiter escaped as in URLs
        See Also:
        DB_ATTRIB_DELIM, MULTIPLE_VAL_DELIM, DB_ATTRIB_DELIM, MULTIPLE_VAL_DELIM
      • format

        public static java.lang.String format​(java.util.List<java.lang.String> strings,
                                              int maxlen)
        This method is passed a list of strings and a maximum string size that must not be exceeded by the composite string.
        Parameters:
        strings - The list of String objects.
        maxlen - The maximum length of the composite string
        Returns:
        The composite string.
        Throws:
        java.lang.ClassCastException - Thrown if any processed item in the list is not a string object.
      • format

        public static java.lang.String format​(java.lang.String[] strings,
                                              int maxlen)
        This method is passed an array of strings and a maximum string size that must not be exceeded by the composite string.
        Parameters:
        strings - The list of String objects.
        maxlen - The maximum length of the composite string
        Returns:
        The composite string.
        Throws:
        java.lang.ClassCastException - Thrown if any processed item in the list is not a string object.
      • format

        public static java.lang.String format​(java.lang.String origString,
                                              int maxlen)
        This method is passed a string to be truncated to the maximum string size passed.
        Parameters:
        maxlen - The maximum length of the composite string
        origString - a String object.
        Returns:
        The string(truncated if necessary).