mondrian.xmla
Class XmlaHandler

java.lang.Object
  extended by mondrian.xmla.XmlaHandler
All Implemented Interfaces:
XmlaConstants

public class XmlaHandler
extends Object
implements XmlaConstants

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

Since:
27 April, 2003
Version:
$Id: //open/mondrian-release/3.0/src/main/mondrian/xmla/XmlaHandler.java#2 $
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
           
(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.
 
Field Summary
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
           
 
Fields inherited from interface mondrian.xmla.XmlaConstants
CHH_AUTHORIZATION_CODE, CHH_AUTHORIZATION_FAULT_FS, CHH_CODE, CHH_FAULT_FS, CLIENT_FAULT_FC, CONTENT_DEFAULT, CONTEXT_ROLE, CONTEXT_ROLE_NAME, CONTEXT_XMLA_SESSION_ID, CONTEXT_XMLA_SESSION_STATE, CONTEXT_XMLA_SESSION_STATE_BEGIN, CONTEXT_XMLA_SESSION_STATE_END, CONTEXT_XMLA_SESSION_STATE_WITHIN, CPOSTA_CODE, CPOSTA_FAULT_FS, CPREA_CODE, CPREA_FAULT_FS, FAULT_ACTOR, FAULT_FC_PREFIX, FAULT_FS_PREFIX, FAULT_NS_PREFIX, HSB_ACCESS_DENIED_CODE, HSB_ACCESS_DENIED_FAULT_FS, HSB_BAD_COMMAND_CODE, HSB_BAD_COMMAND_FAULT_FS, HSB_BAD_METHOD_CODE, HSB_BAD_METHOD_FAULT_FS, HSB_BAD_METHOD_NS_CODE, HSB_BAD_METHOD_NS_FAULT_FS, HSB_BAD_NON_NULLABLE_COLUMN_CODE, HSB_BAD_NON_NULLABLE_COLUMN_FAULT_FS, HSB_BAD_PROPERTIES_CODE, HSB_BAD_PROPERTIES_FAULT_FS, HSB_BAD_PROPERTIES_LIST_CODE, HSB_BAD_PROPERTIES_LIST_FAULT_FS, HSB_BAD_REQUEST_TYPE_CODE, HSB_BAD_REQUEST_TYPE_FAULT_FS, HSB_BAD_RESTRICTION_LIST_CODE, HSB_BAD_RESTRICTION_LIST_FAULT_FS, HSB_BAD_RESTRICTION_TYPE_CODE, HSB_BAD_RESTRICTION_TYPE_FAULT_FS, HSB_BAD_RESTRICTION_VALUE_CODE, HSB_BAD_RESTRICTION_VALUE_FAULT_FS, HSB_BAD_RESTRICTIONS_CODE, HSB_BAD_RESTRICTIONS_FAULT_FS, HSB_BAD_SOAP_BODY_CODE, HSB_BAD_SOAP_BODY_FAULT_FS, HSB_BAD_STATEMENT_CODE, HSB_BAD_STATEMENT_FAULT_FS, HSB_CONNECTION_DATA_SOURCE_CODE, HSB_CONNECTION_DATA_SOURCE_FAULT_FS, HSB_DISCOVER_FORMAT_CODE, HSB_DISCOVER_FORMAT_FAULT_FS, HSB_DISCOVER_UNPARSE_CODE, HSB_DISCOVER_UNPARSE_FAULT_FS, HSB_DRILL_THROUGH_FORMAT_CODE, HSB_DRILL_THROUGH_FORMAT_FAULT_FS, HSB_DRILL_THROUGH_NOT_ALLOWED_CODE, HSB_DRILL_THROUGH_NOT_ALLOWED_FAULT_FS, HSB_DRILL_THROUGH_SQL_CODE, HSB_DRILL_THROUGH_SQL_FAULT_FS, HSB_DRILLDOWN_BAD_FIRST_ROWSET_CODE, HSB_DRILLDOWN_BAD_FIRST_ROWSET_FAULT_FS, HSB_DRILLDOWN_BAD_MAXROWS_CODE, HSB_DRILLDOWN_BAD_MAXROWS_FAULT_FS, HSB_DRILLDOWN_ERROR_CODE, HSB_DRILLDOWN_ERROR_FAULT_FS, HSB_EXECUTE_QUERY_CODE, HSB_EXECUTE_QUERY_FAULT_FS, HSB_EXECUTE_UNPARSE_CODE, HSB_EXECUTE_UNPARSE_FAULT_FS, HSB_PARSE_QUERY_CODE, HSB_PARSE_QUERY_FAULT_FS, HSB_PROCESS_CODE, HSB_PROCESS_FAULT_FS, HSB_UNKNOWN_CODE, HSB_UNKNOWN_FAULT_FS, HSB_UNSUPPORTED_OPERATION_CODE, HSB_UNSUPPORTED_OPERATION_FAULT_FS, HSH_BAD_SESSION_ID_CODE, HSH_BAD_SESSION_ID_FAULT_FS, HSH_MUST_UNDERSTAND_CODE, HSH_MUST_UNDERSTAND_FAULT_FS, HSH_UNKNOWN_CODE, HSH_UNKNOWN_FAULT_FS, METHOD_DISCOVER, METHOD_EXECUTE, MONDRIAN_NAMESPACE, MSM_UNKNOWN_CODE, MSM_UNKNOWN_FAULT_FS, MUST_UNDERSTAND_FAULT_FC, NS_SOAP_ENC_1_1, NS_SOAP_ENC_1_2, NS_SOAP_ENV_1_1, NS_SOAP_ENV_1_2, NS_SQL, NS_XMLA, NS_XMLA_EMPTY, NS_XMLA_EX, NS_XMLA_MDDATASET, NS_XMLA_ROWSET, NS_XSD, NS_XSI, SERVER_FAULT_FC, SOAP_MUST_UNDERSTAND_ATTR, SOAP_PREFIX, UNKNOWN_ERROR_CODE, UNKNOWN_ERROR_FAULT_FS, USM_DOM_FACTORY_CODE, USM_DOM_FACTORY_FAULT_FS, USM_DOM_PARSE_CODE, USM_DOM_PARSE_FAULT_FS, USM_DOM_PARSE_IO_CODE, USM_DOM_PARSE_IO_FAULT_FS, USM_REQUEST_INPUT_CODE, USM_REQUEST_INPUT_FAULT_FS, USM_REQUEST_STATE_CODE, USM_REQUEST_STATE_FAULT_FS, USM_UNKNOWN_CODE, USM_UNKNOWN_FAULT_FS, VERSION_MISSMATCH_FAULT_FC, XMLA_BEGIN_SESSION, XMLA_END_SESSION, XMLA_SESSION, XMLA_SESSION_ID
 
Constructor Summary
XmlaHandler(DataSourcesConfig.DataSources dataSources, CatalogLocator catalogLocator, String prefix)
          Creates an XmlaHandler.
 
Method Summary
 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.
 DataSourcesConfig.Catalog getCatalog(XmlaRequest request, DataSourcesConfig.DataSource ds, boolean required)
          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[] getCatalogs(XmlaRequest request, DataSourcesConfig.DataSource ds)
          Get array of DataSourcesConfig.Catalog returning only one entry if the catalog was specified as a property in the request or all catalogs associated with the Datasource if there was no catalog property.
protected  Connection getConnection(DataSourcesConfig.Catalog catalog, Role role, String roleName)
          Gets a Connection given a catalog (and implicitly the catalog's data source) and a user role.
 DataSourcesConfig.DataSource getDataSource(XmlaRequest request)
          Returns the DataSource associated with the request property or null if one was not specified.
 Map<String,DataSourcesConfig.DataSource> getDataSourceEntries()
           
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

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(DataSourcesConfig.DataSources dataSources,
                   CatalogLocator catalogLocator,
                   String prefix)
Creates an XmlaHandler.

Parameters:
dataSources - Data sources
catalogLocator - Catalog locator
prefix - XML Namespace. Typical value is "xmla", but a value of "cxmla" works around an Internet Explorer 7 bug
Method Detail

isValidXsdInt

public static boolean isValidXsdInt(long l)

getDataSourceEntries

public Map<String,DataSourcesConfig.DataSource> getDataSourceEntries()

process

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

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

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 Connection getConnection(DataSourcesConfig.Catalog catalog,
                                   Role role,
                                   String roleName)
                            throws XmlaException
Gets a Connection given a catalog (and implicitly the catalog's data source) and a user role.

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

getDataSource

public DataSourcesConfig.DataSource getDataSource(XmlaRequest request)
                                           throws XmlaException
Returns the DataSource associated with the request property or null if one was not specified.

Parameters:
request - Request
Returns:
DataSource for this request
Throws:
XmlaException - If error occurs

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

getCatalogs

public DataSourcesConfig.Catalog[] getCatalogs(XmlaRequest request,
                                               DataSourcesConfig.DataSource ds)
Get array of DataSourcesConfig.Catalog returning only one entry if the catalog was specified as a property in the request or all catalogs associated with the Datasource if there was no catalog property.

Parameters:
request - Request
ds - DataSource
Returns:
Array of DataSourcesConfig.Catalog

getCatalog

public DataSourcesConfig.Catalog getCatalog(XmlaRequest request,
                                            DataSourcesConfig.DataSource ds,
                                            boolean required)
                                     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.

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

main

public static void main(String[] args)

SourceForge.net_Logo