Class MondrianServerImpl

    • Constructor Detail

      • MondrianServerImpl

        MondrianServerImpl​(MondrianServerRegistry registry,
                           Repository repository,
                           CatalogLocator catalogLocator)
        Creates a MondrianServerImpl.
        Parameters:
        registry - Registry of all servers in this JVM
        repository - Repository of catalogs and schemas
        catalogLocator - Catalog locator
    • Method Detail

      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • getId

        public int getId()
        Description copied from class: MondrianServer
        Returns an integer uniquely identifying this server within its JVM.
        Specified by:
        getId in class MondrianServer
        Returns:
        Server's unique identifier
      • getKeywords

        public java.util.List<java.lang.String> getKeywords()
        Description copied from class: MondrianServer
        Returns a list of MDX keywords.
        Specified by:
        getKeywords in class MondrianServer
        Returns:
        list of MDX keywords
      • getLockBox

        public LockBox getLockBox()
        Description copied from class: MondrianServer
        Returns the lock box that can be used to pass objects via their string key.
        Specified by:
        getLockBox in class MondrianServer
        Returns:
        Lock box for this server
      • getConnection

        public OlapConnection getConnection​(java.lang.String databaseName,
                                            java.lang.String catalogName,
                                            java.lang.String roleName)
                                     throws java.sql.SQLException
        Description copied from class: MondrianServer
        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.

        Specified by:
        getConnection in class MondrianServer
        Parameters:
        databaseName - Catalog name
        catalogName - Schema name
        roleName - User role name
        Returns:
        Connection
        Throws:
        java.sql.SQLException - If error occurs
      • getConnection

        public OlapConnection getConnection​(java.lang.String databaseName,
                                            java.lang.String catalogName,
                                            java.lang.String roleName,
                                            java.util.Properties props)
                                     throws java.sql.SQLException
        Description copied from class: MondrianServer
        Extended version of MondrianServer.getConnection(String, String, String) taking a list of properties to pass down to the native connection.

        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.

        Specified by:
        getConnection in interface XmlaHandler.ConnectionFactory
        Specified by:
        getConnection in class MondrianServer
        Parameters:
        databaseName - Catalog name
        catalogName - Schema name
        roleName - User role name
        props - Properties to pass down to the native driver.
        Returns:
        Connection
        Throws:
        java.sql.SQLException - If error occurs
      • getCatalogNames

        public java.util.List<java.lang.String> getCatalogNames​(RolapConnection connection)
        Description copied from interface: CatalogFinder
        Returns a list of catalogs.

        The catalog names occur in the natural order of the repository.

        Specified by:
        getCatalogNames in interface CatalogFinder
        Parameters:
        connection - Connection to mondrian we want the catalog children.
        Returns:
        List of catalogs
      • getDatabases

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getDatabases​(RolapConnection connection)
        Description copied from class: MondrianServer
        Returns a list of the databases in this server. One element per database, each element a map whose keys are the XMLA fields describing a data source: "DataSourceName", "DataSourceDescription", "URL", etc. Unrecognized fields are ignored.
        Specified by:
        getDatabases in class MondrianServer
        Parameters:
        connection - Connection
        Returns:
        List of data source definitions
      • shutdown

        public void shutdown()
        Description copied from class: MondrianServer
        Called when the server must terminate all background tasks and cleanup all potential memory leaks.
        Specified by:
        shutdown in class MondrianServer
      • addStatement

        public void addStatement​(Statement statement)
        Description copied from class: MondrianServer
        Called just after a statement has been created.
        Specified by:
        addStatement in class MondrianServer
        Parameters:
        statement - Statement
      • getRolapSchemas

        public java.util.Map<java.lang.String,​RolapSchema> getRolapSchemas​(RolapConnection connection,
                                                                                 java.lang.String catalogName)
        Description copied from interface: CatalogFinder
        Returns a list of (schema name, schema) pairs in a catalog of a particular name.

        The name of the schema may not be the same as the value returned by RolapSchema.getName(). In fact, a given schema may occur multiple times in the same catalog with different names.

        The schemas occur in the natural order of the repository.

        Specified by:
        getRolapSchemas in interface CatalogFinder
        Parameters:
        connection - Connection to mondrian
        catalogName - Name of catalog
        Returns:
        List of catalogs
      • getPreConfiguredDiscoverDatasourcesResponse

        public java.util.Map<java.lang.String,​java.lang.Object> getPreConfiguredDiscoverDatasourcesResponse()
        Description copied from interface: XmlaHandler.ConnectionFactory
        Returns a map of property name-value pairs with which to populate the response to the DISCOVER_DATASOURCES request.

        Properties correspond to the columns of that request: ""DataSourceName", et cetera.

        Returns null if there is no pre-configured response; in which case, the driver will have to connect to get a response.

        Specified by:
        getPreConfiguredDiscoverDatasourcesResponse in interface XmlaHandler.ConnectionFactory
        Returns:
        Column names and values for the DISCOVER_DATASOURCES response