|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmondrian.xmla.Rowset
abstract class Rowset
Base class for an XML for Analysis schema rowset. A concrete derived class
should implement populateImpl(mondrian.xmla.XmlaResponse, org.olap4j.OlapConnection, java.util.List, calling addRow(mondrian.xmla.Rowset.Row, java.util.List for each row.
RowsetDefinition| Nested Class Summary | |
|---|---|
protected static class |
Rowset.Row
A set of name/value pairs, which can be output using addRow(mondrian.xmla.Rowset.Row, java.util.List. |
protected static class |
Rowset.XmlElement
Holder for non-scalar column values of a Rowset.Row. |
| Field Summary | |
|---|---|
protected boolean |
deep
|
protected Map<String,String> |
extraProperties
|
protected XmlaHandler |
handler
|
protected static org.apache.log4j.Logger |
LOGGER
|
protected Map<String,String> |
properties
|
protected XmlaRequest |
request
|
protected Map<String,Object> |
restrictions
|
protected RowsetDefinition |
rowsetDefinition
|
| Constructor Summary | |
|---|---|
Rowset(RowsetDefinition definition,
XmlaRequest request,
XmlaHandler handler)
Creates a Rowset. |
|
| Method Summary | ||
|---|---|---|
protected boolean |
addRow(Rowset.Row row,
List<Rowset.Row> rows)
Adds a Rowset.Row to a result, provided that it meets the necessary
criteria. |
|
protected Util.Functor1<Boolean,Catalog> |
catNameCond()
|
|
protected void |
emit(Rowset.Row row,
XmlaResponse response)
Emits a row for this rowset, reading fields from a Rowset.Row object. |
|
(package private) int |
getRestrictionValueAsInt(RowsetDefinition.Column column)
Returns a column's restriction as an int if it
exists, -1 otherwise. |
|
(package private) String |
getRestrictionValueAsString(RowsetDefinition.Column column)
Returns the restriction if it is a String, or null otherwise. |
|
protected boolean |
isRestricted(RowsetDefinition.Column column)
Returns true if there is a restriction for the given column definition. |
|
(package private)
|
makeCondition(RowsetDefinition.Column column)
Creates a condition functor based on the restrictions on a given metadata column specified in an XMLA request. |
|
(package private)
|
makeCondition(Util.Functor1<V,? super E> getter,
RowsetDefinition.Column column)
Creates a condition functor using an accessor. |
|
protected boolean |
needConnection()
|
|
protected
|
populate(Class<E> clazz,
List<Rowset.Row> rows,
Comparator<E> comparator)
Populates all of the values in an enumeration into a list of rows. |
|
void |
populate(XmlaResponse response,
OlapConnection connection,
List<Rowset.Row> rows)
Gathers the set of rows which match a given set of the criteria. |
|
protected abstract void |
populateImpl(XmlaResponse response,
OlapConnection connection,
List<Rowset.Row> rows)
Gathers the set of rows which match a given set of the criteria. |
|
protected ArrayList<RowsetDefinition.Column> |
pruneRestrictions(ArrayList<RowsetDefinition.Column> list)
|
|
protected void |
setProperty(PropertyDefinition propertyDef,
String value)
Sets a property for this rowset. |
|
void |
unparse(XmlaResponse response)
Writes the contents of this rowset as a series of SAX events. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger LOGGER
protected final RowsetDefinition rowsetDefinition
protected final Map<String,Object> restrictions
protected final Map<String,String> properties
protected final Map<String,String> extraProperties
protected final XmlaRequest request
protected final XmlaHandler handler
protected final boolean deep
| Constructor Detail |
|---|
Rowset(RowsetDefinition definition,
XmlaRequest request,
XmlaHandler handler)
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 |
|---|
protected ArrayList<RowsetDefinition.Column> pruneRestrictions(ArrayList<RowsetDefinition.Column> list)
protected void setProperty(PropertyDefinition propertyDef,
String value)
public final void unparse(XmlaResponse response)
throws XmlaException,
SQLException
XmlaException
SQLException
public final void populate(XmlaResponse response,
OlapConnection connection,
List<Rowset.Row> rows)
throws XmlaException
XmlaExceptionprotected boolean needConnection()
protected abstract void populateImpl(XmlaResponse response,
OlapConnection connection,
List<Rowset.Row> rows)
throws XmlaException,
SQLException
XmlaException
SQLException
protected final boolean addRow(Rowset.Row row,
List<Rowset.Row> rows)
throws XmlaException
Rowset.Row to a result, provided that it meets the necessary
criteria. Returns whether the row was added.
row - Rowrows - List of result rows
XmlaException
protected void emit(Rowset.Row row,
XmlaResponse response)
throws XmlaException,
SQLException
Rowset.Row object.
row - Rowresponse - XMLA response writer
XmlaException
SQLException
protected <E> void populate(Class<E> clazz,
List<Rowset.Row> rows,
Comparator<E> comparator)
throws XmlaException
XmlaException<E> Util.Functor1<Boolean,E> makeCondition(RowsetDefinition.Column column)
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.
E - Element type, e.g. Catalog or
Levelcolumn - Metadata column
<E,V> Util.Functor1<Boolean,E> makeCondition(Util.Functor1<V,? super E> getter,
RowsetDefinition.Column column)
The accessor gets a particular property of the element in question for the column restrictions to act upon.
E - Element type, e.g. Catalog or
LevelV - Value type; often String, since many restrictions
work on the name or unique name of elementsgetter - Attribute accessorcolumn - Metadata column
String getRestrictionValueAsString(RowsetDefinition.Column column)
int getRestrictionValueAsInt(RowsetDefinition.Column column)
int if it
exists, -1 otherwise.
protected boolean isRestricted(RowsetDefinition.Column column)
protected Util.Functor1<Boolean,Catalog> catNameCond()
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||