Package com.jedox.palojlib.main
Class Cube
java.lang.Object
com.jedox.palojlib.main.CachedComponent
com.jedox.palojlib.main.Cube
- All Implemented Interfaces:
ICube
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jedox.palojlib.interfaces.ICube
ICube.CellsExportType, ICube.CubeType, ICube.SplashMode
-
Field Summary
FieldsFields inherited from class com.jedox.palojlib.main.CachedComponent
cacheTrustExpiry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activateGpu
(boolean activate) activate and deactivate GPU acceleration for the cubevoid
activateRules
(IRule[] rules) activate a set of rules, the rules will be changed depending on their identifiers.void
addRule
(String definition, boolean activate, String externalIdentifier, String comment, boolean useIdentifier, double position, String source) add a rule to cube.boolean
check if the cube can store zero values (introduced in 6.5)protected boolean
protected boolean
void
clear()
clears completely the data in the cubevoid
clearCells
(IElement[][] area) empty cells in an area within a cubevoid
commitLock
(int lockId) commit/free a lock in the cubevoid
convert
(ICube.CubeType cubetype) Deprecated.void
copyCell
(IElement[] fromPath, IElement[] toPath, IElement[][] lockedPaths, boolean useRules, boolean wait) void
copyLikeCell
(IElement[] fromPath, IElement[] toPath, IElement[][] lockedPaths, Double likeValue, boolean useRules, boolean wait) void
deactivateRules
(IRule[] rules) deactivate a set of rules, the rules will be changed depending on their identifiers.long
get current Palo_CB Tokenlong
get current Palo_CC Tokenget the value of a single cell typically using cell/valuegetCellLoadContext
(ICube.SplashMode mode, int blockSize, boolean add, boolean eventProcessor) get a cell load context which is needed when writing cell valuesIElement[]
getCellPath
(String[] names) get the elements object that points to a cell path within the cubeICell[]
get the values of multiple cells typically using cell/valuesgetCellsExporter
(IElement[][] area, ICellExportContext context) Get an exporter to use later to export cells from an olap cubelong
getDimensionById
(int dimId) getDimensionByName
(String name) Get a specific dimension in this cubeint[]
int
Get a specific dimension index in this cubeGet the list of dimensions in this cube.getDimensions
(boolean withVirtualDimensions) Get the list of dimensions in this cube.IHold[]
getHolds()
int
getId()
Get the ID of the CubegetName()
Get the name of the cube.Get the number of cells, filled and empty ones.Number of cells storing empty values (introduced in 6.5)Get the number of filled cells in the cube.Number of cells storing zero values (introduced in 6.5)IRule[]
getRules()
get the list of the rules for this cubegetType()
Get the cube typeICube.CubeType
Boolean[]
check for multiple cell paths if there is a non-empty cellvoid
loadCell
(IElement[] path, Object value, ICellLoadContext context, IElement[][] lockedPaths) void
loadCells
(IElement[][] paths, Object[] values, ICellLoadContext context, IElement[][] lockedPaths) Deprecated.void
loadCells
(IElement[][] paths, Object[] values, ICellLoadContext context, IElement[][] lockedPaths, boolean useAudit) Write cells back in palo server.int
lock only an area in the cube, reading is still possible.int
lock the data in the cube, no reading is possible.modify
(IDimension[] dimensions) modify the given cubeparse a definition of the rulevoid
predictCell
(IElement[][] fromArea, IElement[] toPath, IElement[][] lockedPaths, boolean useRules, boolean wait) void
void
removeHolds
(IHold[] holds) void
remove all rules.void
removeRules
(IRule[] rules) remove a set of rules, the rules will be removed depending on their identifiers.void
rename a cubevoid
void
save()
Deprecated.void
updateRule
(int id, String definition, boolean activate, String externalIdentifier, String comment, boolean useIdentifier, double position, String source) update an existing rulevoid
update the template rules in this cubeMethods inherited from class com.jedox.palojlib.main.CachedComponent
endTrustTime, inTrustTime, setCacheTrustExpiry
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jedox.palojlib.interfaces.ICube
addRule, updateRule
-
Field Details
-
defaultExpiryDuration
public static final int defaultExpiryDuration- See Also:
-
-
Constructor Details
-
Cube
protected Cube(int contextId, int id, String name, Database database, CubeInfo info) throws PaloException, PaloJException - Throws:
PaloException
PaloJException
-
-
Method Details
-
getName
Description copied from interface:ICube
Get the name of the cube. -
getCubeInfo
- Specified by:
getCubeInfo
in interfaceICube
-
getCubeMemorySize
public long getCubeMemorySize()- Specified by:
getCubeMemorySize
in interfaceICube
-
getDimensions
Description copied from interface:ICube
Get the list of dimensions in this cube.- Specified by:
getDimensions
in interfaceICube
- Returns:
- list of dimensions
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getDimensions
public Dimension[] getDimensions(boolean withVirtualDimensions) throws PaloException, PaloJException Description copied from interface:ICube
Get the list of dimensions in this cube.- Specified by:
getDimensions
in interfaceICube
- Parameters:
withVirtualDimensions
- if yes return also all virtual dimension of the cube- Returns:
- list of dimensions of the cube
- Throws:
PaloException
PaloJException
-
getDimensionIndexByName
Description copied from interface:ICube
Get a specific dimension index in this cube- Specified by:
getDimensionIndexByName
in interfaceICube
- Parameters:
name
- name of the dimension- Returns:
- dimension, or -1 if it does not exists
- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
getCellPath
Description copied from interface:ICube
get the elements object that points to a cell path within the cube- Specified by:
getCellPath
in interfaceICube
- Parameters:
names
- the element names- Returns:
- element objects
- Throws:
PaloException
PaloJException
-
getNumberOfFilledCells
Description copied from interface:ICube
Get the number of filled cells in the cube.- Specified by:
getNumberOfFilledCells
in interfaceICube
- Returns:
- number of filled cells.
- Throws:
PaloException
- exception from OLAP server
-
getNumberOfCells
Description copied from interface:ICube
Get the number of cells, filled and empty ones.- Specified by:
getNumberOfCells
in interfaceICube
- Returns:
- overall number of possible cells in the cube
- Throws:
PaloException
- exception from OLAP server
-
getNumberOfZeroCells
Description copied from interface:ICube
Number of cells storing zero values (introduced in 6.5)- Specified by:
getNumberOfZeroCells
in interfaceICube
- Returns:
- Number of cells storing zero values
- Throws:
PaloException
- exception from OLAP server
-
getNumberOfEmptyCells
Description copied from interface:ICube
Number of cells storing empty values (introduced in 6.5)- Specified by:
getNumberOfEmptyCells
in interfaceICube
- Returns:
- Number of cells storing empty values
- Throws:
PaloException
- exception from OLAP server
-
canStoreZero
Description copied from interface:ICube
check if the cube can store zero values (introduced in 6.5)- Specified by:
canStoreZero
in interfaceICube
- Returns:
- true if zeros can stored.
- Throws:
PaloException
- exception from OLAP server
-
getType
Description copied from interface:ICube
Get the cube typeICube.CubeType
- Specified by:
getType
in interfaceICube
- Returns:
- cube type
- Throws:
PaloException
- exception from OLAP server
-
getDimensionIds
- Throws:
PaloException
-
clear
Description copied from interface:ICube
clears completely the data in the cube- Specified by:
clear
in interfaceICube
- Throws:
PaloException
- exception from OLAP server
-
clearCells
Description copied from interface:ICube
empty cells in an area within a cube- Specified by:
clearCells
in interfaceICube
- Parameters:
area
- Area contained from the cartesian product of the elements mentioned in each dimension. The dimensions in the array has the same order as in the cube. So, Element[0] refers to elements in the first dimension of the cube. If no elements are given for a certain dimension, then all elements will be used.- Throws:
PaloException
- exception from OLAP server
-
save
Deprecated.Description copied from interface:ICube
save the cube to the csv files.- Specified by:
save
in interfaceICube
- Throws:
PaloException
- exception from OLAP server
-
lockComplete
Description copied from interface:ICube
lock the data in the cube, no reading is possible.- Specified by:
lockComplete
in interfaceICube
- Returns:
- id of the locked cube area, needed to do the commit later
- Throws:
PaloException
- exception from OLAP server
-
lockArea
Description copied from interface:ICube
lock only an area in the cube, reading is still possible.- Specified by:
lockArea
in interfaceICube
- Parameters:
area
- cube area- Returns:
- id of the locked area, needed to do the commit later
- Throws:
PaloException
- exception from OLAP server
-
modify
Description copied from interface:ICube
modify the given cube -
commitLock
Description copied from interface:ICube
commit/free a lock in the cube- Specified by:
commitLock
in interfaceICube
- Parameters:
lockId
- id of the locked area in the cube- Throws:
PaloException
- exception from OLAP server
-
convert
Deprecated.Description copied from interface:ICube
convert cube type from normal to gpu or other vice versa.- Specified by:
convert
in interfaceICube
- Parameters:
cubetype
-ICube.CubeType
- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
activateGpu
Description copied from interface:ICube
activate and deactivate GPU acceleration for the cube- Specified by:
activateGpu
in interfaceICube
- Parameters:
activate
- : if true activate, if false deactivate- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
loadCells
@Deprecated public void loadCells(IElement[][] paths, Object[] values, ICellLoadContext context, IElement[][] lockedPaths) throws PaloJException, PaloException Deprecated.Description copied from interface:ICube
Write cells back in palo server.- Specified by:
loadCells
in interfaceICube
- Parameters:
paths
- each path specify cell coordinates.values
- each value is a cell valuecontext
- load contextICellLoadContext
lockedPaths
- paths where Splashing will not change them and their sources areas if they are consolidated.- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
loadCells
public void loadCells(IElement[][] paths, Object[] values, ICellLoadContext context, IElement[][] lockedPaths, boolean useAudit) throws PaloJException, PaloException Description copied from interface:ICube
Write cells back in palo server.- Specified by:
loadCells
in interfaceICube
- Parameters:
paths
- each path specify cell coordinates.values
- each value is a cell valuecontext
- load contextICellLoadContext
lockedPaths
- paths where Splashing will not change them and their sources areas if they are consolidated.useAudit
- If audit is enabled for the cube, save all performed bulk operations to it- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
loadCell
public void loadCell(IElement[] path, Object value, ICellLoadContext context, IElement[][] lockedPaths) throws PaloJException, PaloException - Specified by:
loadCell
in interfaceICube
- Parameters:
path
- path specify cell coordinates.value
- value is a cell valuecontext
- load contextICellLoadContext
lockedPaths
- paths where Splashing will not change them and their sources areas if they are consolidated.- Throws:
PaloJException
PaloException
-
getRules
Description copied from interface:ICube
get the list of the rules for this cube- Specified by:
getRules
in interfaceICube
- Returns:
- rules
IRule
- Throws:
PaloException
- exception from OLAP server
-
updateRuleTemplates
public void updateRuleTemplates()Description copied from interface:ICube
update the template rules in this cube- Specified by:
updateRuleTemplates
in interfaceICube
-
getDimensionByName
Description copied from interface:ICube
Get a specific dimension in this cube- Specified by:
getDimensionByName
in interfaceICube
- Parameters:
name
- name of the dimension- Returns:
- dimension
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getId
public int getId()Description copied from interface:ICube
Get the ID of the Cube -
addRule
public void addRule(String definition, boolean activate, String externalIdentifier, String comment, boolean useIdentifier, double position, String source) throws PaloException Description copied from interface:ICube
add a rule to cube.- Specified by:
addRule
in interfaceICube
- Parameters:
definition
- definition of the ruleactivate
- true when rule should be active, false otherwise.externalIdentifier
- optional external IDcomment
- optional commentuseIdentifier
- use id instead of name in rulesposition
- position in the rules listsource
- query definition for template rules. Empty for regular rules.- Throws:
PaloException
- exception from OLAP server
-
updateRule
public void updateRule(int id, String definition, boolean activate, String externalIdentifier, String comment, boolean useIdentifier, double position, String source) throws PaloException Description copied from interface:ICube
update an existing rule- Specified by:
updateRule
in interfaceICube
- Parameters:
id
- id of the rule.definition
- definition of the ruleactivate
- true, if the rule is active, false otherwise.externalIdentifier
- optional external IDcomment
- optional commentuseIdentifier
- use id instead of name in rulesposition
- position in the rules listsource
- query definition for template rules. Empty for regular rules.- Throws:
PaloException
- exception from OLAP server
-
parseRule
Description copied from interface:ICube
parse a definition of the rule- Specified by:
parseRule
in interfaceICube
- Parameters:
definition
- rule definition- Returns:
- XML representation of the enterprise rule.
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
removeRules
Description copied from interface:ICube
remove a set of rules, the rules will be removed depending on their identifiers.- Specified by:
removeRules
in interfaceICube
- Parameters:
rules
- rules to be removed- Throws:
PaloException
- exception from OLAP server
-
removeRules
Description copied from interface:ICube
remove all rules.- Specified by:
removeRules
in interfaceICube
- Throws:
PaloException
- exception from OLAP server
-
getCellsExporter
public CellsExporter getCellsExporter(IElement[][] area, ICellExportContext context) throws PaloException, PaloJException Description copied from interface:ICube
Get an exporter to use later to export cells from an olap cube- Specified by:
getCellsExporter
in interfaceICube
- Parameters:
area
- Area contained from the cartesian product of the elements mentioned in each dimension. The dimensions in the array has the same order as in the cube. So, Element[0] refers to elements in the first dimension of the cube. If no elements are given for a certain dimension, then all elements will be used.context
- of the exportICellExportContext
- Returns:
- exporter to get the cells in blocks and only when needed
ICellsExporter
. - Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getCell
Description copied from interface:ICube
get the value of a single cell typically using cell/value- Specified by:
getCell
in interfaceICube
- Parameters:
path
- path to certain cell- Returns:
- cube cell with its value
ICell
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getCells
Description copied from interface:ICube
get the values of multiple cells typically using cell/values- Specified by:
getCells
in interfaceICube
- Parameters:
paths
- An array of paths to certain cells- Returns:
- cube cells with their values
ICell
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
hasCells
Description copied from interface:ICube
check for multiple cell paths if there is a non-empty cell- Specified by:
hasCells
in interfaceICube
- Parameters:
paths
- An array of paths to certain cells- Returns:
- For each cell path true if a non-empty cell with at least read access exists in the cube, otherwise false
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
copyCell
public void copyCell(IElement[] fromPath, IElement[] toPath, IElement[][] lockedPaths, boolean useRules, boolean wait) throws PaloException - Specified by:
copyCell
in interfaceICube
- Parameters:
fromPath
- Source cell path used for copytoPath
- Target cell pathlockedPaths
- Optional list of locked paths. Splashing will not change locked paths and sources areas of these paths if they are consolidated.useRules
- copy rule based cell valueswait
- wait until the asynchronous part of operation is finished- Throws:
PaloException
- exception from OLAP server
-
copyLikeCell
public void copyLikeCell(IElement[] fromPath, IElement[] toPath, IElement[][] lockedPaths, Double likeValue, boolean useRules, boolean wait) throws PaloException - Specified by:
copyLikeCell
in interfaceICube
- Parameters:
fromPath
- Source cell path used for copytoPath
- Target cell pathlockedPaths
- Optional list of locked paths. Splashing will not change locked paths and sources areas of these paths if they are consolidated.likeValue
- Numeric value of the target cube celluseRules
- copy rule based cell valueswait
- wait until the asynchronous part of operation is finished- Throws:
PaloException
- exception from OLAP server
-
predictCell
public void predictCell(IElement[][] fromArea, IElement[] toPath, IElement[][] lockedPaths, boolean useRules, boolean wait) throws PaloException - Specified by:
predictCell
in interfaceICube
- Parameters:
fromArea
- Source area used for the predictive function. Only one element list can contain multiple elements. The area is the cartesian product.toPath
- Target cell pathlockedPaths
- Optional list of locked paths. Splashing will not change locked paths and sources areas of these paths if they are consolidated.useRules
- copy rule based cell valueswait
- wait until the asynchronous part of operation is finished- Throws:
PaloException
- exception from OLAP server
-
rename
Description copied from interface:ICube
rename a cube- Specified by:
rename
in interfaceICube
- Parameters:
name
- new cube name- Throws:
PaloException
- exception from OLAP server
-
getCBToken
Description copied from interface:ICube
get current Palo_CB Token- Specified by:
getCBToken
in interfaceICube
- Returns:
- Palo_CB token
- Throws:
PaloException
- exception from OLAP server
-
getCCToken
Description copied from interface:ICube
get current Palo_CC Token- Specified by:
getCCToken
in interfaceICube
- Returns:
- Palo_CC token
- Throws:
PaloException
- exception from OLAP server
-
activateRules
Description copied from interface:ICube
activate a set of rules, the rules will be changed depending on their identifiers.- Specified by:
activateRules
in interfaceICube
- Parameters:
rules
- rules to be activated- Throws:
PaloException
- exception from OLAP server
-
deactivateRules
Description copied from interface:ICube
deactivate a set of rules, the rules will be changed depending on their identifiers.- Specified by:
deactivateRules
in interfaceICube
- Parameters:
rules
- rules to be deactivated- Throws:
PaloException
- exception from OLAP server
-
getCellLoadContext
public ICellLoadContext getCellLoadContext(ICube.SplashMode mode, int blockSize, boolean add, boolean eventProcessor) Description copied from interface:ICube
get a cell load context which is needed when writing cell values- Specified by:
getCellLoadContext
in interfaceICube
- Parameters:
mode
-ICellLoadContext.getSplashMode()
blockSize
-ICellLoadContext.getBlockSize()
add
-ICellLoadContext.isAdd()
eventProcessor
-ICellLoadContext.isEventProcessor()
- Returns:
- cellLoadContext
-
generateScript
- Specified by:
generateScript
in interfaceICube
-
getScriptContext
- Specified by:
getScriptContext
in interfaceICube
-
checkCCTokenChange
protected boolean checkCCTokenChange() -
checkCBTokenChange
protected boolean checkCBTokenChange() -
getDimensionById
- Throws:
PaloException
PaloJException
-
resetCache
public void resetCache() -
getDataToken
- Specified by:
getDataToken
in interfaceICube
-
addHold
- Specified by:
addHold
in interfaceICube
- Throws:
PaloException
-
getHolds
- Specified by:
getHolds
in interfaceICube
- Throws:
PaloException
-
removeHolds
- Specified by:
removeHolds
in interfaceICube
- Throws:
PaloException
-
removeHolds
- Specified by:
removeHolds
in interfaceICube
- Throws:
PaloException
-