Class MondrianOlap4jConnection.Helper

  • Enclosing class:
    MondrianOlap4jConnection

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

      Constructors 
      Constructor Description
      Helper()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) OlapException createException​(java.lang.String msg)  
      (package private) OlapException createException​(java.lang.String msg, java.lang.Throwable cause)
      Creates an exception with a given cause.
      (package private) OlapException createException​(Cell context, java.lang.String msg)
      Creates an exception in the context of a particular Cell.
      (package private) OlapException createException​(Cell context, java.lang.String msg, java.lang.Throwable cause)
      Creates an exception in the context of a particular Cell and with a given cause.
      OlapException toOlapException​(java.sql.SQLException e)
      Converts a SQLException to an OlapException.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Helper

        Helper()
    • Method Detail

      • createException

        OlapException createException​(java.lang.String msg)
      • createException

        OlapException createException​(Cell context,
                                      java.lang.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,
                                      java.lang.String msg,
                                      java.lang.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​(java.lang.String msg,
                                      java.lang.Throwable cause)
        Creates an exception with a given cause.
        Parameters:
        msg - Message
        cause - Causing exception
        Returns:
        New exception
      • toOlapException

        public OlapException toOlapException​(java.sql.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