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 TypeMethodDescriptionvoidactivateGpu(boolean activate) activate and deactivate GPU acceleration for the cubevoidactivateRules(IRule[] rules) activate a set of rules, the rules will be changed depending on their identifiers.voidaddRule(String definition, boolean activate, String externalIdentifier, String comment, boolean useIdentifier, double position, String source) add a rule to cube.booleancheck if the cube can store zero values (introduced in 6.5)protected booleanprotected booleanvoidclear()clears completely the data in the cubevoidclearCells(IElement[][] area) empty cells in an area within a cubevoidcommitLock(int lockId) commit/free a lock in the cubevoidconvert(ICube.CubeType cubetype) Deprecated.voidcopyCell(IElement[] fromPath, IElement[] toPath, IElement[][] lockedPaths, boolean useRules, boolean wait) voidcopyLikeCell(IElement[] fromPath, IElement[] toPath, IElement[][] lockedPaths, Double likeValue, boolean useRules, boolean wait) voiddeactivateRules(IRule[] rules) deactivate a set of rules, the rules will be changed depending on their identifiers.longget current Palo_CB Tokenlongget 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 cubegetDimensionById(int dimId) getDimensionByName(String name) Get a specific dimension in this cubeint[]intGet 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()intgetId()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.CubeTypeBoolean[]check for multiple cell paths if there is a non-empty cellvoidloadCell(IElement[] path, Object value, ICellLoadContext context, IElement[][] lockedPaths) voidloadCells(IElement[][] paths, Object[] values, ICellLoadContext context, IElement[][] lockedPaths) Write cells back in palo server.intlock only an area in the cube, reading is still possible.intlock the data in the cube, no reading is possible.modify(IDimension[] dimensions) modify the given cubeparse a definition of the rulevoidpredictCell(IElement[][] fromArea, IElement[] toPath, IElement[][] lockedPaths, boolean useRules, boolean wait) voidvoidremoveHolds(IHold[] holds) voidremove all rules.voidremoveRules(IRule[] rules) remove a set of rules, the rules will be removed depending on their identifiers.voidrename a cubevoidvoidsave()Deprecated.voidupdateRule(int id, String definition, boolean activate, String externalIdentifier, String comment, boolean useIdentifier, double position, String source) update an existing rulevoidupdate the template rules in this cubeMethods inherited from class com.jedox.palojlib.main.CachedComponent
endTrustTime, inTrustTime, setCacheTrustExpiryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
PaloExceptionPaloJException
-
-
Method Details
-
getName
Description copied from interface:ICubeGet the name of the cube. -
getCubeInfo
- Specified by:
getCubeInfoin interfaceICube
-
getDimensions
Description copied from interface:ICubeGet the list of dimensions in this cube.- Specified by:
getDimensionsin 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:ICubeGet the list of dimensions in this cube.- Specified by:
getDimensionsin interfaceICube- Parameters:
withVirtualDimensions- if yes return also all virtual dimension of the cube- Returns:
- list of dimensions of the cube
- Throws:
PaloExceptionPaloJException
-
getDimensionIndexByName
Description copied from interface:ICubeGet a specific dimension index in this cube- Specified by:
getDimensionIndexByNamein 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:ICubeget the elements object that points to a cell path within the cube- Specified by:
getCellPathin interfaceICube- Parameters:
names- the element names- Returns:
- element objects
- Throws:
PaloExceptionPaloJException
-
getNumberOfFilledCells
Description copied from interface:ICubeGet the number of filled cells in the cube.- Specified by:
getNumberOfFilledCellsin interfaceICube- Returns:
- number of filled cells.
- Throws:
PaloException- exception from OLAP server
-
getNumberOfCells
Description copied from interface:ICubeGet the number of cells, filled and empty ones.- Specified by:
getNumberOfCellsin interfaceICube- Returns:
- overall number of possible cells in the cube
- Throws:
PaloException- exception from OLAP server
-
getNumberOfZeroCells
Description copied from interface:ICubeNumber of cells storing zero values (introduced in 6.5)- Specified by:
getNumberOfZeroCellsin interfaceICube- Returns:
- Number of cells storing zero values
- Throws:
PaloException- exception from OLAP server
-
getNumberOfEmptyCells
Description copied from interface:ICubeNumber of cells storing empty values (introduced in 6.5)- Specified by:
getNumberOfEmptyCellsin interfaceICube- Returns:
- Number of cells storing empty values
- Throws:
PaloException- exception from OLAP server
-
canStoreZero
Description copied from interface:ICubecheck if the cube can store zero values (introduced in 6.5)- Specified by:
canStoreZeroin interfaceICube- Returns:
- true if zeros can stored.
- Throws:
PaloException- exception from OLAP server
-
getType
Description copied from interface:ICubeGet the cube typeICube.CubeType- Specified by:
getTypein interfaceICube- Returns:
- cube type
- Throws:
PaloException- exception from OLAP server
-
getDimensionIds
- Throws:
PaloException
-
clear
Description copied from interface:ICubeclears completely the data in the cube- Specified by:
clearin interfaceICube- Throws:
PaloException- exception from OLAP server
-
clearCells
Description copied from interface:ICubeempty cells in an area within a cube- Specified by:
clearCellsin 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:ICubesave the cube to the csv files.- Specified by:
savein interfaceICube- Throws:
PaloException- exception from OLAP server
-
lockComplete
Description copied from interface:ICubelock the data in the cube, no reading is possible.- Specified by:
lockCompletein 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:ICubelock only an area in the cube, reading is still possible.- Specified by:
lockAreain 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:ICubemodify the given cube -
commitLock
Description copied from interface:ICubecommit/free a lock in the cube- Specified by:
commitLockin interfaceICube- Parameters:
lockId- id of the locked area in the cube- Throws:
PaloException- exception from OLAP server
-
convert
Deprecated.Description copied from interface:ICubeconvert cube type from normal to gpu or other vice versa.- Specified by:
convertin interfaceICube- Parameters:
cubetype-ICube.CubeType- Throws:
PaloJException- exception from the library itselfPaloException- exception from OLAP server
-
activateGpu
Description copied from interface:ICubeactivate and deactivate GPU acceleration for the cube- Specified by:
activateGpuin interfaceICube- Parameters:
activate- : if true activate, if false deactivate- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
loadCells
public void loadCells(IElement[][] paths, Object[] values, ICellLoadContext context, IElement[][] lockedPaths) throws PaloJException, PaloException Description copied from interface:ICubeWrite cells back in palo server.- Specified by:
loadCellsin interfaceICube- Parameters:
paths- each path specify cell coordinates.values- each value is a cell valuecontext- load contextICellLoadContextlockedPaths- 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
-
loadCell
public void loadCell(IElement[] path, Object value, ICellLoadContext context, IElement[][] lockedPaths) throws PaloJException, PaloException - Specified by:
loadCellin interfaceICube- Parameters:
path- path specify cell coordinates.value- value is a cell valuecontext- load contextICellLoadContextlockedPaths- paths where Splashing will not change them and their sources areas if they are consolidated.- Throws:
PaloJExceptionPaloException
-
getRules
Description copied from interface:ICubeget the list of the rules for this cube- Specified by:
getRulesin interfaceICube- Returns:
- rules
IRule - Throws:
PaloException- exception from OLAP server
-
updateRuleTemplates
public void updateRuleTemplates()Description copied from interface:ICubeupdate the template rules in this cube- Specified by:
updateRuleTemplatesin interfaceICube
-
getDimensionByName
Description copied from interface:ICubeGet a specific dimension in this cube- Specified by:
getDimensionByNamein 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:ICubeGet 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:ICubeadd a rule to cube.- Specified by:
addRulein 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:ICubeupdate an existing rule- Specified by:
updateRulein 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:ICubeparse a definition of the rule- Specified by:
parseRulein 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:ICuberemove a set of rules, the rules will be removed depending on their identifiers.- Specified by:
removeRulesin interfaceICube- Parameters:
rules- rules to be removed- Throws:
PaloException- exception from OLAP server
-
removeRules
Description copied from interface:ICuberemove all rules.- Specified by:
removeRulesin interfaceICube- Throws:
PaloException- exception from OLAP server
-
getCellsExporter
public CellsExporter getCellsExporter(IElement[][] area, ICellExportContext context) throws PaloException, PaloJException Description copied from interface:ICubeGet an exporter to use later to export cells from an olap cube- Specified by:
getCellsExporterin 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:ICubeget the value of a single cell typically using cell/value- Specified by:
getCellin 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:ICubeget the values of multiple cells typically using cell/values- Specified by:
getCellsin 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:ICubecheck for multiple cell paths if there is a non-empty cell- Specified by:
hasCellsin 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:
copyCellin 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:
copyLikeCellin 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:
predictCellin 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:ICuberename a cube- Specified by:
renamein interfaceICube- Parameters:
name- new cube name- Throws:
PaloException- exception from OLAP server
-
getCBToken
Description copied from interface:ICubeget current Palo_CB Token- Specified by:
getCBTokenin interfaceICube- Returns:
- Palo_CB token
- Throws:
PaloException- exception from OLAP server
-
getCCToken
Description copied from interface:ICubeget current Palo_CC Token- Specified by:
getCCTokenin interfaceICube- Returns:
- Palo_CC token
- Throws:
PaloException- exception from OLAP server
-
activateRules
Description copied from interface:ICubeactivate a set of rules, the rules will be changed depending on their identifiers.- Specified by:
activateRulesin interfaceICube- Parameters:
rules- rules to be activated- Throws:
PaloException- exception from OLAP server
-
deactivateRules
Description copied from interface:ICubedeactivate a set of rules, the rules will be changed depending on their identifiers.- Specified by:
deactivateRulesin 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:ICubeget a cell load context which is needed when writing cell values- Specified by:
getCellLoadContextin interfaceICube- Parameters:
mode-ICellLoadContext.getSplashMode()blockSize-ICellLoadContext.getBlockSize()add-ICellLoadContext.isAdd()eventProcessor-ICellLoadContext.isEventProcessor()- Returns:
- cellLoadContext
-
generateScript
- Specified by:
generateScriptin interfaceICube
-
getScriptContext
- Specified by:
getScriptContextin interfaceICube
-
checkCCTokenChange
protected boolean checkCCTokenChange() -
checkCBTokenChange
protected boolean checkCBTokenChange() -
getDimensionById
- Throws:
PaloExceptionPaloJException
-
resetCache
public void resetCache() -
getDataToken
- Specified by:
getDataTokenin interfaceICube
-
addHold
- Specified by:
addHoldin interfaceICube- Throws:
PaloException
-
getHolds
- Specified by:
getHoldsin interfaceICube- Throws:
PaloException
-
removeHolds
- Specified by:
removeHoldsin interfaceICube- Throws:
PaloException
-
removeHolds
- Specified by:
removeHoldsin interfaceICube- Throws:
PaloException
-