Package mondrian.xmla

Class Rowset

    • Field Detail

      • LOGGER

        protected static final org.apache.log4j.Logger LOGGER
      • deep

        protected final boolean deep
    • Constructor Detail

      • Rowset

        Rowset​(RowsetDefinition definition,
               XmlaRequest request,
               XmlaHandler handler)
        Creates a Rowset.

        The exceptions thrown in this constructor are not produced during the execution of an XMLA request and so can be ordinary exceptions and not XmlaException (which are specifically for generating SOAP Fault xml).

    • Method Detail

      • setProperty

        protected void setProperty​(PropertyDefinition propertyDef,
                                   String value)
        Sets a property for this rowset. Called by the constructor for each supplied property.

        A derived class should override this method and intercept each property it supports. Any property it does not support, it should forward to the base class method, which will probably throw an error.

      • needConnection

        protected boolean needConnection()
      • makeCondition

        <E> Util.Functor1<Boolean,​E> makeCondition​(RowsetDefinition.Column column)
        Creates a condition functor based on the restrictions on a given metadata column specified in an XMLA request.

        A condition is a Util.Functor1 whose return type is boolean. Restrictions are used in each Rowset's discovery request. If there is no restriction then the passes method always returns true.

        It is known at the beginning of a populate(XmlaResponse, org.olap4j.OlapConnection, java.util.List) method whether the restriction is not specified (null), a single value (String) or an array of values (String[]). So, creating the conditions just once at the beginning is faster than having to determine the restriction status each time it is needed.

        Type Parameters:
        E - Element type, e.g. Catalog or Level
        Parameters:
        column - Metadata column
        Returns:
        Condition functor
      • makeCondition

        <E,​V> Util.Functor1<Boolean,​E> makeCondition​(Util.Functor1<V,​? super E> getter,
                                                                 RowsetDefinition.Column column)
        Creates a condition functor using an accessor.

        The accessor gets a particular property of the element in question for the column restrictions to act upon.

        Type Parameters:
        E - Element type, e.g. Catalog or Level
        V - Value type; often String, since many restrictions work on the name or unique name of elements
        Parameters:
        getter - Attribute accessor
        column - Metadata column
        Returns:
        Condition functor
      • getRestrictionValueAsString

        String getRestrictionValueAsString​(RowsetDefinition.Column column)
        Returns the restriction if it is a String, or null otherwise. Does not attempt two determine if the restriction is an array of Strings if all members of the array have the same value (in which case one could return, again, simply a single String).
      • getRestrictionValueAsInt

        int getRestrictionValueAsInt​(RowsetDefinition.Column column)
        Returns a column's restriction as an int if it exists, -1 otherwise.
      • isRestricted

        protected boolean isRestricted​(RowsetDefinition.Column column)
        Returns true if there is a restriction for the given column definition.