mondrian.xmla
Class XmlaHandler

java.lang.Object
  extended by mondrian.xmla.XmlaHandler

public class XmlaHandler
extends Object

An XmlaHandler responds to XML for Analysis (XML/A) requests.

Since:
27 April, 2003
Author:
jhyde, Gang Chen
 

Nested Class Summary
(package private) static class XmlaHandler.CellColumnHandler
          Callback to handle one column, representing the combination of a level and a property (e.g.
(package private) static class XmlaHandler.Column
           
(package private) static class XmlaHandler.ColumnHandler
           
static interface XmlaHandler.ConnectionFactory
           
(package private) static class XmlaHandler.MDDataSet
           
(package private) static class XmlaHandler.MDDataSet_Multidimensional
           
(package private) static class XmlaHandler.MDDataSet_Tabular
           
(package private) static class XmlaHandler.MemberColumnHandler
          Callback to handle one column, representing the combination of a level and a property (e.g.
(package private) static class XmlaHandler.TabularRowSet
           
(package private) static class XmlaHandler.ValueInfo
          Takes a DataType String (null, Integer, Numeric or non-null) and Value Object (Integer, Double, String, other) and canonicalizes them to XSD data type and corresponding object.
static interface XmlaHandler.XmlaExtra
          Extra support for XMLA server.
 
Field Summary
(package private)  XmlaHandler.ConnectionFactory connectionFactory
           
static String XSD_BOOLEAN
           
static String XSD_BYTE
           
static byte XSD_BYTE_MAX_INCLUSIVE
           
static byte XSD_BYTE_MIN_INCLUSIVE
           
static String XSD_DECIMAL
           
static String XSD_DOUBLE
           
static String XSD_INT
           
static int XSD_INT_MAX_INCLUSIVE
           
static int XSD_INT_MIN_INCLUSIVE
           
static String XSD_INTEGER
           
static String XSD_LONG
           
static long XSD_LONG_MAX_INCLUSIVE
           
static long XSD_LONG_MIN_INCLUSIVE
           
static String XSD_SHORT
           
static short XSD_SHORT_MAX_INCLUSIVE
           
static short XSD_SHORT_MIN_INCLUSIVE
           
static String XSD_STRING
           
static String XSD_UNSIGNED_INT
           
 
Constructor Summary
XmlaHandler(XmlaHandler.ConnectionFactory connectionFactory, String prefix)
          Creates an XmlaHandler.
 
Method Summary
 DataSourcesConfig.Catalog getCatalog(DataSourcesConfig.DataSource ds, boolean required, String catalogName)
          Returns the DataSourcesConfig.Catalog associated with the catalog name that is part of the request properties or null if there is no catalog with that name.
 DataSourcesConfig.Catalog getCatalog(DataSourcesConfig.DataSource ds, String catalogName)
          Get the DataSourcesConfig.Catalog with the given catalog name from the DataSource's catalogs if there is a match and otherwise return null.
protected  OlapConnection getConnection(String catalog, String schema, String role)
          Gets a Connection given a catalog (and implicitly the catalog's data source) and the name of a user role.
protected  OlapConnection getConnection(String catalog, String schema, String role, Properties props)
          Gets a Connection given a catalog (and implicitly the catalog's data source) and the name of a user role.
 OlapConnection getConnection(XmlaRequest request)
           
static XmlaHandler.XmlaExtra getExtra(OlapConnection connection)
           
static boolean isValidXsdInt(long l)
           
static void main(String[] args)
           
 void process(XmlaRequest request, XmlaResponse response)
          Processes a request.
(package private) static void writeDatasetXmlSchema(SaxWriter writer, mondrian.xmla.XmlaHandler.SetType settype)
          Computes the XML Schema for a dataset.
(package private) static void writeEmptyDatasetXmlSchema(SaxWriter writer, mondrian.xmla.XmlaHandler.SetType setType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionFactory

final XmlaHandler.ConnectionFactory connectionFactory

XSD_BOOLEAN

public static final String XSD_BOOLEAN
See Also:
Constant Field Values

XSD_STRING

public static final String XSD_STRING
See Also:
Constant Field Values

XSD_UNSIGNED_INT

public static final String XSD_UNSIGNED_INT
See Also:
Constant Field Values

XSD_BYTE

public static final String XSD_BYTE
See Also:
Constant Field Values

XSD_BYTE_MAX_INCLUSIVE

public static final byte XSD_BYTE_MAX_INCLUSIVE
See Also:
Constant Field Values

XSD_BYTE_MIN_INCLUSIVE

public static final byte XSD_BYTE_MIN_INCLUSIVE
See Also:
Constant Field Values

XSD_SHORT

public static final String XSD_SHORT
See Also:
Constant Field Values

XSD_SHORT_MAX_INCLUSIVE

public static final short XSD_SHORT_MAX_INCLUSIVE
See Also:
Constant Field Values

XSD_SHORT_MIN_INCLUSIVE

public static final short XSD_SHORT_MIN_INCLUSIVE
See Also:
Constant Field Values

XSD_INT

public static final String XSD_INT
See Also:
Constant Field Values

XSD_INT_MAX_INCLUSIVE

public static final int XSD_INT_MAX_INCLUSIVE
See Also:
Constant Field Values

XSD_INT_MIN_INCLUSIVE

public static final int XSD_INT_MIN_INCLUSIVE
See Also:
Constant Field Values

XSD_LONG

public static final String XSD_LONG
See Also:
Constant Field Values

XSD_LONG_MAX_INCLUSIVE

public static final long XSD_LONG_MAX_INCLUSIVE
See Also:
Constant Field Values

XSD_LONG_MIN_INCLUSIVE

public static final long XSD_LONG_MIN_INCLUSIVE
See Also:
Constant Field Values

XSD_DOUBLE

public static final String XSD_DOUBLE
See Also:
Constant Field Values

XSD_DECIMAL

public static final String XSD_DECIMAL
See Also:
Constant Field Values

XSD_INTEGER

public static final String XSD_INTEGER
See Also:
Constant Field Values
Constructor Detail

XmlaHandler

public XmlaHandler(XmlaHandler.ConnectionFactory connectionFactory,
                   String prefix)
Creates an XmlaHandler.

Parameters:
connectionFactory - Connection factory
prefix - XML Namespace. Typical value is "xmla", but a value of "cxmla" works around an Internet Explorer 7 bug
Method Detail

getExtra

public static XmlaHandler.XmlaExtra getExtra(OlapConnection connection)

getConnection

public OlapConnection getConnection(XmlaRequest request)

isValidXsdInt

public static boolean isValidXsdInt(long l)

process

public void process(XmlaRequest request,
                    XmlaResponse response)
             throws XmlaException
Processes a request.

Throws:
XmlaException - on error
Parameters:
request - XML request, for example, "".
response - Destination for response

writeDatasetXmlSchema

static void writeDatasetXmlSchema(SaxWriter writer,
                                  mondrian.xmla.XmlaHandler.SetType settype)
Computes the XML Schema for a dataset.

Parameters:
writer - SAX writer
settype - rowset or dataset?
See Also:
RowsetDefinition.writeRowsetXmlSchema(SaxWriter)

writeEmptyDatasetXmlSchema

static void writeEmptyDatasetXmlSchema(SaxWriter writer,
                                       mondrian.xmla.XmlaHandler.SetType setType)

getConnection

protected OlapConnection getConnection(String catalog,
                                       String schema,
                                       String role)
                                throws XmlaException
Gets a Connection given a catalog (and implicitly the catalog's data source) and the name of a user role.

If you want to pass in a role object, and you are making the call within the same JVM (i.e. not RPC), register the role using MondrianServer.getLockBox() and pass in the moniker for the generated lock box entry. The server will retrieve the role from the moniker.

Throws:
XmlaException - If error occurs
Parameters:
catalog - Catalog name
schema - Schema name
role - User role name
Returns:
Connection

getConnection

protected OlapConnection getConnection(String catalog,
                                       String schema,
                                       String role,
                                       Properties props)
                                throws XmlaException
Gets a Connection given a catalog (and implicitly the catalog's data source) and the name of a user role.

If you want to pass in a role object, and you are making the call within the same JVM (i.e. not RPC), register the role using MondrianServer.getLockBox() and pass in the moniker for the generated lock box entry. The server will retrieve the role from the moniker.

Throws:
XmlaException - If error occurs
Parameters:
catalog - Catalog name
schema - Schema name
role - User role name
props - Properties to pass down to the native driver.
Returns:
Connection

getCatalog

public DataSourcesConfig.Catalog getCatalog(DataSourcesConfig.DataSource ds,
                                            String catalogName)
Get the DataSourcesConfig.Catalog with the given catalog name from the DataSource's catalogs if there is a match and otherwise return null.

Parameters:
ds - DataSource
catalogName - Catalog name
Returns:
DataSourcesConfig.Catalog or null

getCatalog

public DataSourcesConfig.Catalog getCatalog(DataSourcesConfig.DataSource ds,
                                            boolean required,
                                            String catalogName)
                                     throws XmlaException
Returns the DataSourcesConfig.Catalog associated with the catalog name that is part of the request properties or null if there is no catalog with that name.

Throws:
XmlaException - If error occurs
Parameters:
ds - DataSource
required - Whether to throw an error if catalog name is not specified
catalogName -
Returns:
DataSourcesConfig Catalog or null

main

public static void main(String[] args)

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads