Class MondrianOlap4jConnection.Helper

  • Enclosing class:
    MondrianOlap4jConnection

    static class MondrianOlap4jConnection.Helper
    extends Object
    Package-private helper class which encapsulates policies which are common throughout the driver. These policies include exception handling and factory methods.
    • Constructor Detail

      • Helper

        Helper()
    • Method Detail

      • createException

        OlapException createException​(Cell context,
                                      String msg)
        Creates an exception in the context of a particular Cell.
        Parameters:
        context - Cell context for exception
        msg - Message
        Returns:
        New exception
      • createException

        OlapException createException​(Cell context,
                                      String msg,
                                      Throwable cause)
        Creates an exception in the context of a particular Cell and with a given cause.
        Parameters:
        context - Cell context for exception
        msg - Message
        cause - Causing exception
        Returns:
        New exception
      • createException

        OlapException createException​(String msg,
                                      Throwable cause)
        Creates an exception with a given cause.
        Parameters:
        msg - Message
        cause - Causing exception
        Returns:
        New exception
      • toOlapException

        public OlapException toOlapException​(SQLException e)
        Converts a SQLException to an OlapException. Casts the exception if it is already an OlapException, wraps otherwise.

        This method is typically used as an adapter for SQLException instances coming from a base class, where derived interface declares that it throws the more specific OlapException.

        Parameters:
        e - Exception
        Returns:
        Exception as an OlapException