Interface IDatabase

All Known Implementing Classes:
Database

public interface IDatabase
represent a database in olap server
Author:
khaddadin
  • Method Details

    • getId

      int getId()
      Get the id of the database
      Returns:
      the id
    • getName

      String getName()
      Get the name of the database
      Returns:
      the name of the database
    • getDatabaseInfo

      IDatabaseInfo getDatabaseInfo()
      database info IDatabaseInfo
      Returns:
      database info
    • getDatabaseMemorySize

      long getDatabaseMemorySize()
      size of the Olap database
      Returns:
      number of Bytes
    • getType

      Get the type of the database IDatabase.DatabaseType
      Returns:
      type of the database
    • getDimensions

      IDimension[] getDimensions() throws PaloException, PaloJException
      Get the list of the dimensions in the database including all types of dimensions
      Returns:
      list of the dimensions
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getCubes

      ICube[] getCubes() throws PaloException, PaloJException
      Get the list of the cubes in the database including all types of cubes: normal,attribute,system, userinfo and gpu.
      Returns:
      list of the cubes
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getCubes

      ICube[] getCubes(IDimension dim) throws PaloException, PaloJException
      Get the list of the cubes which include the given dimension.
      Parameters:
      dim - dimension
      Returns:
      list of the cubes
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • addDimension

      IDimension addDimension(String name) throws PaloException, PaloJException
      Create a new dimension with type normal
      Parameters:
      name - name of the new dimension
      Returns:
      the newly created dimension
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • addDimension

      Create a new dimension
      Parameters:
      name - name of the new dimension
      type - type of the dimension (normal, user info)
      Returns:
      the newly created dimension
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • addDimension

      default IDimension addDimension(String name, IDimension.DimensionType type, boolean generateDefaultSubsets) throws PaloException, PaloJException
      Create a new dimension
      Parameters:
      name - name of the new dimension
      type - type of the dimension (normal, user info)
      generateDefaultSubsets - If true the default subsets are generated for the dimension
      Returns:
      the newly created dimension
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • addCube

      ICube addCube(String name, IDimension[] dimensions) throws PaloException, PaloJException
      Create a new cube with type normal
      Parameters:
      name - name of the new cube
      dimensions - list of dimensions
      Returns:
      the newly created cube
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • addCube

      ICube addCube(String name, IDimension[] dimensions, ICube.CubeType type) throws PaloException, PaloJException
      Create a new cube with type normal
      Parameters:
      name - name of the new cube
      dimensions - list of dimensions
      type - type of the cube (normal, user info)
      Returns:
      the newly created cube
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • addCube

      default ICube addCube(String name, IDimension[] dimensions, ICube.CubeType type, ICube basesCube) throws PaloException, PaloJException
      Create a new cube with type normal
      Parameters:
      name - name of the new cube,
      dimensions - list of dimensions
      type - type of the cube (normal, user info)
      basesCube - the cube will be used as a base cube for the newly created cube.
      Returns:
      the newly created cube
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getDimensionByName

      IDimension getDimensionByName(String name) throws PaloException, PaloJException
      Get a certain dimension by it is name, return null if does not exist.
      Parameters:
      name - name of the needed dimension
      Returns:
      dimension
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getCubeByName

      ICube getCubeByName(String name) throws PaloException, PaloJException
      Get a certain cube by it is name, return null if does not exist.
      Parameters:
      name - name of the needed cube
      Returns:
      cube
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • removeCube

      void removeCube(ICube cube) throws PaloException, PaloJException
      remove a certain cube, the cube will be moved depending on its id.
      Parameters:
      cube - cube to be removed
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • removeDimension

      void removeDimension(IDimension dimension) throws PaloException, PaloJException
      remove a certain dimension, the dimension will be moved depending on its id.
      Parameters:
      dimension - dimension to be removed
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • save

      void save() throws PaloException, PaloJException
      save the database to disk
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • save

      @Deprecated default void save(boolean complete) throws PaloException, PaloJException
      Deprecated.
      This method is deprecated, use save() instead.
      save the database to disk.
      Parameters:
      complete - when true also all cubes data will be saved, otherwise false.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • backup

      @Deprecated default void backup(String backupPath) throws PaloException, PaloJException
      Deprecated.
      This method is deprecated, use backup(String, boolean, boolean, boolean, boolean, String) instead. Set show_system, include_archive and show_audit to false, set include_csv to true and pass null as password.
      backup the database to disk.
      Parameters:
      backupPath - Path to file with Zip extension where the backup of the database will be saved.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • backup

      void backup(String backupPath, boolean show_system, boolean include_archive, boolean show_audit, boolean include_csv, String password) throws PaloException, PaloJException
      backup the database to disk.
      Parameters:
      backupPath - Path to file with Zip extension where the backup of the database will be saved.
      show_system - include also System DB to the archive
      include_archive - nclude also archive files
      show_audit - include also audit file to the archive
      include_csv - include also csv files
      password - encrypt archive with password if set. (null if no encryption should be done)
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • rename

      void rename(String newname) throws PaloException, PaloJException
      rename a database.
      Parameters:
      newname - new database name
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • setCacheTrustExpiries

      void setCacheTrustExpiries(int databaseExpiry, int cubeExpiry, int dimensionExpiry)
      set the default cache trust time for the components
      Parameters:
      databaseExpiry - time in ms in which database cache will be trusted
      cubeExpiry - time in ms in which cube cache will be trusted
      dimensionExpiry - time in ms in which dimension cache will be trusted
    • resetCaches

      void resetCaches()
      clear any cached information if exists, the expiry trust time will not be affected.
    • getLanguages

      Element[] getLanguages() throws PaloException, PaloJException
      Throws:
      PaloException
      PaloJException
    • getLanguageByName

      Element getLanguageByName(String language) throws PaloException, PaloJException
      Throws:
      PaloException
      PaloJException
    • generateScript

      default String generateScript(IDatabaseScriptContext databaseScriptContext)
    • getScriptContext

      default IDatabaseScriptContext getScriptContext()