Package com.jedox.palojlib.main
Class Database
java.lang.Object
com.jedox.palojlib.main.CachedComponent
com.jedox.palojlib.main.Database
- All Implemented Interfaces:
IDatabase
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jedox.palojlib.interfaces.IDatabase
IDatabase.DatabaseType
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final String
protected LinkedHashMap<String,
Dimension> Fields inherited from class com.jedox.palojlib.main.CachedComponent
cacheTrustExpiry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCube
(String name, IDimension[] dimensions) Create a new cube with type normaladdCube
(String name, IDimension[] dimensions, ICube.CubeType type) Create a new cube with type normaladdCube
(String name, IDimension[] dimensions, ICube.CubeType type, ICube basesCube) Create a new cube with type normaladdDimension
(String name) Create a new dimension with type normaladdDimension
(String name, IDimension.DimensionType type) Create a new dimensionaddDimension
(String name, IDimension.DimensionType type, boolean generateDefaultSubsets) Create a new dimensionvoid
backup
(String backupPath, boolean show_system, boolean include_archive, boolean show_audit, boolean include_csv, String password) backup the database to disk.protected Cube
getCubeById
(int id) getCubeByName
(String name) Get a certain cube by it is name, return null if does not exist.ICube[]
getCubes()
Get the list of the cubes in the database including all types of cubes: normal,attribute,system, userinfo and gpu.ICube[]
getCubes
(IDimension dim) Get the list of the cubes which include the given dimension.database infoIDatabaseInfo
long
size of the Olap databaseprotected Dimension
getDimensionById
(int id) getDimensionByName
(String name) Get a certain dimension by it is name, return null if does not exist.Get the list of the dimensions in the database including all types of dimensionsint
getId()
Get the id of the databasegetLanguageByName
(String language) Element[]
getName()
public method from the interfacegetType()
Get the type of the databaseIDatabase.DatabaseType
void
removeCube
(ICube c) remove a certain cube, the cube will be moved depending on its id.void
remove a certain dimension, the dimension will be moved depending on its id.void
rename a database.void
clear any cached information if exists, the expiry trust time will not be affected.void
save()
save the database to diskvoid
setCacheTrustExpiries
(int databaseExpiry, int cubeExpiry, int dimensionExpiry) set the default cache trust time for the componentsMethods inherited from class com.jedox.palojlib.main.CachedComponent
endTrustTime, inTrustTime, setCacheTrustExpiry
-
Field Details
-
defaultExpiryDuration
public static final int defaultExpiryDuration- See Also:
-
dimensionsNameMap
-
defaultLanguage
- See Also:
-
-
Constructor Details
-
Database
protected Database(int contextId, int id, String name, IDatabase.DatabaseType type, String dimensionsNumber, String cubesNumber, String status, String token) throws PaloException, PaloJException - Throws:
PaloException
PaloJException
-
-
Method Details
-
getName
public method from the interface -
getType
Description copied from interface:IDatabase
Get the type of the databaseIDatabase.DatabaseType
-
addDimension
public IDimension addDimension(String name, IDimension.DimensionType type, boolean generateDefaultSubsets) throws PaloException, PaloJException Description copied from interface:IDatabase
Create a new dimension- Specified by:
addDimension
in interfaceIDatabase
- Parameters:
name
- name of the new dimensiontype
- 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 serverPaloJException
- exception from the library itself
-
addDimension
public IDimension addDimension(String name, IDimension.DimensionType type) throws PaloException, PaloJException Description copied from interface:IDatabase
Create a new dimension- Specified by:
addDimension
in interfaceIDatabase
- Parameters:
name
- name of the new dimensiontype
- type of the dimension (normal, user info)- Returns:
- the newly created dimension
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
addDimension
Description copied from interface:IDatabase
Create a new dimension with type normal- Specified by:
addDimension
in interfaceIDatabase
- Parameters:
name
- name of the new dimension- Returns:
- the newly created dimension
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getDimensions
Description copied from interface:IDatabase
Get the list of the dimensions in the database including all types of dimensions- Specified by:
getDimensions
in interfaceIDatabase
- Returns:
- list of the dimensions
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getDimensionByName
Description copied from interface:IDatabase
Get a certain dimension by it is name, return null if does not exist.- Specified by:
getDimensionByName
in interfaceIDatabase
- Parameters:
name
- name of the needed dimension- Returns:
- dimension
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
addCube
public ICube addCube(String name, IDimension[] dimensions, ICube.CubeType type) throws PaloException, PaloJException Description copied from interface:IDatabase
Create a new cube with type normal- Specified by:
addCube
in interfaceIDatabase
- Parameters:
name
- name of the new cubedimensions
- list of dimensionstype
- type of the cube (normal, user info)- Returns:
- the newly created cube
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
addCube
public ICube addCube(String name, IDimension[] dimensions, ICube.CubeType type, ICube basesCube) throws PaloException, PaloJException Description copied from interface:IDatabase
Create a new cube with type normal- Specified by:
addCube
in interfaceIDatabase
- Parameters:
name
- name of the new cube,dimensions
- list of dimensionstype
- 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 serverPaloJException
- exception from the library itself
-
addCube
Description copied from interface:IDatabase
Create a new cube with type normal- Specified by:
addCube
in interfaceIDatabase
- Parameters:
name
- name of the new cubedimensions
- list of dimensions- Returns:
- the newly created cube
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getCubes
Description copied from interface:IDatabase
Get the list of the cubes in the database including all types of cubes: normal,attribute,system, userinfo and gpu.- Specified by:
getCubes
in interfaceIDatabase
- Returns:
- list of the cubes
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getCubes
Description copied from interface:IDatabase
Get the list of the cubes which include the given dimension.- Specified by:
getCubes
in interfaceIDatabase
- Parameters:
dim
- dimension- Returns:
- list of the cubes
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getCubeByName
Description copied from interface:IDatabase
Get a certain cube by it is name, return null if does not exist.- Specified by:
getCubeByName
in interfaceIDatabase
- Parameters:
name
- name of the needed cube- Returns:
- cube
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
removeCube
Description copied from interface:IDatabase
remove a certain cube, the cube will be moved depending on its id.- Specified by:
removeCube
in interfaceIDatabase
- Parameters:
c
- cube to be removed- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
removeDimension
Description copied from interface:IDatabase
remove a certain dimension, the dimension will be moved depending on its id.- Specified by:
removeDimension
in interfaceIDatabase
- Parameters:
d
- dimension to be removed- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
save
Description copied from interface:IDatabase
save the database to disk- Specified by:
save
in interfaceIDatabase
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
backup
public void backup(String backupPath, boolean show_system, boolean include_archive, boolean show_audit, boolean include_csv, String password) throws PaloException, PaloJException Description copied from interface:IDatabase
backup the database to disk.- Specified by:
backup
in interfaceIDatabase
- 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 archiveinclude_archive
- nclude also archive filesshow_audit
- include also audit file to the archiveinclude_csv
- include also csv filespassword
- encrypt archive with password if set. (null if no encryption should be done)- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getId
public int getId()Description copied from interface:IDatabase
Get the id of the database -
rename
Description copied from interface:IDatabase
rename a database.- Specified by:
rename
in interfaceIDatabase
- Parameters:
name
- new database name- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
generateScript
- Specified by:
generateScript
in interfaceIDatabase
-
getScriptContext
- Specified by:
getScriptContext
in interfaceIDatabase
-
getDatabaseInfo
Description copied from interface:IDatabase
database infoIDatabaseInfo
- Specified by:
getDatabaseInfo
in interfaceIDatabase
- Returns:
- database info
-
getDatabaseMemorySize
public long getDatabaseMemorySize()Description copied from interface:IDatabase
size of the Olap database- Specified by:
getDatabaseMemorySize
in interfaceIDatabase
- Returns:
- number of Bytes
-
setCacheTrustExpiries
public void setCacheTrustExpiries(int databaseExpiry, int cubeExpiry, int dimensionExpiry) Description copied from interface:IDatabase
set the default cache trust time for the components- Specified by:
setCacheTrustExpiries
in interfaceIDatabase
- Parameters:
databaseExpiry
- time in ms in which database cache will be trustedcubeExpiry
- time in ms in which cube cache will be trusteddimensionExpiry
- time in ms in which dimension cache will be trusted
-
getDimensionById
- Throws:
PaloException
PaloJException
-
getCubeById
- Throws:
PaloException
PaloJException
-
resetCaches
public void resetCaches()Description copied from interface:IDatabase
clear any cached information if exists, the expiry trust time will not be affected.- Specified by:
resetCaches
in interfaceIDatabase
-
getLanguages
- Specified by:
getLanguages
in interfaceIDatabase
- Throws:
PaloException
PaloJException
-
getLanguageByName
- Specified by:
getLanguageByName
in interfaceIDatabase
- Throws:
PaloException
PaloJException
-