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 intstatic final Stringprotected 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 dimensionvoidbackup(String backupPath, boolean show_system, boolean include_archive, boolean show_audit, boolean include_csv, String password) backup the database to disk.protected CubegetCubeById(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 infoIDatabaseInfoprotected DimensiongetDimensionById(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 dimensionsintgetId()Get the id of the databasegetLanguageByName(String language) Element[]getName()public method from the interfacegetType()Get the type of the databaseIDatabase.DatabaseTypevoidremoveCube(ICube c) remove a certain cube, the cube will be moved depending on its id.voidremove a certain dimension, the dimension will be moved depending on its id.voidrename a database.voidclear any cached information if exists, the expiry trust time will not be affected.voidsave()save the database to diskvoidsetCacheTrustExpiries(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:
PaloExceptionPaloJException
-
-
Method Details
-
getName
public method from the interface -
getType
Description copied from interface:IDatabaseGet the type of the databaseIDatabase.DatabaseType -
addDimension
public IDimension addDimension(String name, IDimension.DimensionType type, boolean generateDefaultSubsets) throws PaloException, PaloJException Description copied from interface:IDatabaseCreate a new dimension- Specified by:
addDimensionin 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:IDatabaseCreate a new dimension- Specified by:
addDimensionin 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:IDatabaseCreate a new dimension with type normal- Specified by:
addDimensionin 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:IDatabaseGet the list of the dimensions in the database including all types of dimensions- Specified by:
getDimensionsin interfaceIDatabase- Returns:
- list of the dimensions
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getDimensionByName
Description copied from interface:IDatabaseGet a certain dimension by it is name, return null if does not exist.- Specified by:
getDimensionByNamein 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:IDatabaseCreate a new cube with type normal- Specified by:
addCubein 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:IDatabaseCreate a new cube with type normal- Specified by:
addCubein 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:IDatabaseCreate a new cube with type normal- Specified by:
addCubein 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:IDatabaseGet the list of the cubes in the database including all types of cubes: normal,attribute,system, userinfo and gpu.- Specified by:
getCubesin interfaceIDatabase- Returns:
- list of the cubes
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getCubes
Description copied from interface:IDatabaseGet the list of the cubes which include the given dimension.- Specified by:
getCubesin 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:IDatabaseGet a certain cube by it is name, return null if does not exist.- Specified by:
getCubeByNamein 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:IDatabaseremove a certain cube, the cube will be moved depending on its id.- Specified by:
removeCubein interfaceIDatabase- Parameters:
c- cube to be removed- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
removeDimension
Description copied from interface:IDatabaseremove a certain dimension, the dimension will be moved depending on its id.- Specified by:
removeDimensionin interfaceIDatabase- Parameters:
d- dimension to be removed- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
save
Description copied from interface:IDatabasesave the database to disk- Specified by:
savein 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:IDatabasebackup the database to disk.- Specified by:
backupin 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:IDatabaseGet the id of the database -
rename
Description copied from interface:IDatabaserename a database.- Specified by:
renamein interfaceIDatabase- Parameters:
name- new database name- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
generateScript
- Specified by:
generateScriptin interfaceIDatabase
-
getScriptContext
- Specified by:
getScriptContextin interfaceIDatabase
-
getDatabaseInfo
Description copied from interface:IDatabasedatabase infoIDatabaseInfo- Specified by:
getDatabaseInfoin interfaceIDatabase- Returns:
- database info
-
setCacheTrustExpiries
public void setCacheTrustExpiries(int databaseExpiry, int cubeExpiry, int dimensionExpiry) Description copied from interface:IDatabaseset the default cache trust time for the components- Specified by:
setCacheTrustExpiriesin 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:
PaloExceptionPaloJException
-
getCubeById
- Throws:
PaloExceptionPaloJException
-
resetCaches
public void resetCaches()Description copied from interface:IDatabaseclear any cached information if exists, the expiry trust time will not be affected.- Specified by:
resetCachesin interfaceIDatabase
-
getLanguages
- Specified by:
getLanguagesin interfaceIDatabase- Throws:
PaloExceptionPaloJException
-
getLanguageByName
- Specified by:
getLanguageByNamein interfaceIDatabase- Throws:
PaloExceptionPaloJException
-