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 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 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

      • sanitize

        public static String sanitize​(String inStr)
        Cleans any unwanted ISO control characters from the input string by reformatting them into their %add format.
        Parameters:
        inStr - string that might contain the delimiter
        Returns:
        The string with any ISO characters reformatted for db ops
      • escape

        public static String escape​(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 String format​(List<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:
        ClassCastException - Thrown if any processed item in the list is not a string object.
      • format

        public static String format​(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:
        ClassCastException - Thrown if any processed item in the list is not a string object.
      • format

        public static String format​(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).