Package com.jedox.palojlib.interfaces
Interface IDimension
- All Known Implementing Classes:
Dimension
public interface IDimension
Interface that represents a dimension in database
- Author:
- khaddadin
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, IElement.ElementType type) Create one attribute, this method does not invalidate the cache.voidaddAttributes(String[] names, IElement.ElementType[] types) Create new attributes in this dimensionvoidaddAttributeValues(IAttribute attribute, IElement[] elements, Object[] values) Writes the attribute values for these elementsaddBaseElement(String name, IElement.ElementType type) Create one element, this method does not invalidate the cache.voidaddConsolidations(IConsolidation[] consolidations) Add the consolidations for the elements mentioned as parents in the consolidations set, the children will be added to the existing children list.voidaddElements(String[] names, IElement.ElementType[] types) Create a list of elementsvoidappendElements(IElement[] elements) Add new elements with the given type or simply change type of existing elementsdefault voidcreateVirtualDimension(IAttribute attribute) Creates a virtual dimension specified by a dimension attribute.default IElement[]evaluateGlobalSubset(String name, IVariable[] subsetVariables) Evaluate the given subset with the set of variablesdefault StringgenerateScript(IDimensionScriptContext dimensionScriptContext) getAttributeByName(String name) Get an attribute using its namedefault IAttributegetAttributeByName(String name, String language) default ICubeGet the attribute cube if existsGet a list of attributes for this dimensionIElement[]Get the list of the bases elements in the dimensiondefault IElement[]getBasesElements(boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.default IElementGet the element set as default N/A for the dimensiondefault IElementgetDefaultNAElement(boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultNAElement()instead.default IElementGet the element set as default parent for the dimensiondefault IElementgetDefaultParentElement(boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultParentElement()instead.default IElementGet the element set as default read for the dimensiondefault IElementgetDefaultReadElement(boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultReadElement()instead.default IElementGet the element set as default total for the dimensiondefault IElementgetDefaultTotalElement(boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultTotalElement()instead.default IElementGet the element set as default write for the dimensiondefault IElementgetDefaultWriteElement(boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultWriteElement()instead.Get the dimension info objectIDimensionInfodefault IElementgetElement(String elementName) Get a single element in the dimension, the dimension elements will not be read in this casedefault IElementgetElement(String elementName, boolean withPermission) Get a single element in the dimension, the dimension elements will not be read in this casegetElementByName(String name) Get an element using its namedefault IElementgetElementByName(String name, boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElementByName(String)instead.IElement[]Get the list of elements in the dimensiondefault IElement[]getElements(boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElements()instead.IElement[]getElementsByName(String[] names) Get an array of elements using their names, an exception will be thrown if at least one of them does not existdefault IElement[]getElementsByName(String[] names, boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElementsByName(String[])instead.default String[]Get the list of global subsetsdefault String[]get the list of variables for the given global subsetintgetId()Get the ID of the DimensiongetName()Get the name of the dimensionIElement[]Get the list of the root elements in the dimensiondefault IElement[]getRootElements(boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetRootElements()instead.default IDimensionScriptContextdefault IElementgetSingleElement(String elementName, boolean withAttributes) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElement(String)instead.default IElementgetSingleElement(String elementName, boolean withAttributes, boolean withPermission) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElement(String, boolean)instead.getType()Get the dimension typeIDimension.DimensionTypedefault IDimension[]Get a list of all virtual dimensions derived from attributes of this dimensionbooleanCheck if at least one C-Element existsdefault void/** Set the cache to be no longer trusted without clearing the cached information.voidmoveElements(IElement[] elements, Integer[] positions) Move a list of elements to new positionsnewConsolidation(IElement parent, IElement child, double weight) Create a consolidation object, no change is yet done to the dimensionintClear all consolidations that exists in the dimensionvoidremoveAttributes(IAttribute[] attributes) Removes the attributesvoidremoveAttributeValues(IAttribute attribute, IElement[] elements) Removes the attribute values for these elements in this dimension, for the given language in the attribute.voidremoveConsolidations(IElement[] elements) Remove the consolidations for these elements i.e. their childrenvoidremoveElements(IElement[] elements) Removes the elementsdefault voidremoveVirtualDimension(IAttribute attribute) Removes a virtual dimension specified by a dimension attribute.voidRename a dimensiondefault voidClear any cached information if exists, the expiry trust time will not be affecteddefault voidsetCacheTrustExpiry(int seconds) Set the cache to be trusted (i.e. no need to check server tokens) for a certain amount of time.default voidsetWithElementPermission(boolean withPermission) Decide whether elements should be read with permission or notvoidupdateConsolidations(IConsolidation[] consolidations) Update the consolidation for the elements mentioned as parents in the consolidations set.voidupdateElementsType(IElement[] elements, IElement.ElementType type) Update the types of the elements, only ElementTypes type string and numeric can be usedIElement.ElementType.
-
Method Details
-
getName
String getName()Get the name of the dimension- Returns:
- name of the dimension
-
getId
int getId()Get the ID of the Dimension- Returns:
- Dimension ID
-
getType
IDimension.DimensionType getType()Get the dimension typeIDimension.DimensionType- Returns:
- type
-
getDimensionInfo
Get the dimension info objectIDimensionInfo- Returns:
- dimension info object
- Throws:
PaloException- exception from OLAP server
-
getElements
@Deprecated(forRemoval=true) default IElement[] getElements(boolean withAttributes) throws PaloException, PaloJException Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElements()instead.Get the list of elements in the dimension- Parameters:
withAttributes- true get the element attribute information as well, false this information will be ignored.- Returns:
- list of elements
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getElements
Get the list of elements in the dimension- Returns:
- list of elements
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getRootElements
@Deprecated(forRemoval=true) default IElement[] getRootElements(boolean withAttributes) throws PaloException, PaloJException Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetRootElements()instead.Get the list of the root elements in the dimension- Parameters:
withAttributes- true get the element attributes information as well, false this information will be ignored.- Returns:
- list of root elements
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getRootElements
Get the list of the root elements in the dimension- Returns:
- list of root elements
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getBasesElements
@Deprecated(forRemoval=true) default IElement[] getBasesElements(boolean withAttributes) throws PaloException, PaloJException Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetBasesElements()instead.Get the list of the bases elements in the dimension- Parameters:
withAttributes- true get the element attributes information as well, false this information will be ignored.- Returns:
- list of root elements
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getBasesElements
Get the list of the bases elements in the dimension- Returns:
- list of root elements
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getElementByName
@Deprecated(forRemoval=true) default IElement getElementByName(String name, boolean withAttributes) throws PaloException, PaloJException Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElementByName(String)instead.Get an element using its name- Parameters:
name- name of the elementwithAttributes- true get the element attributes information as well, false this information will be ignored.- Returns:
- element object
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getElementByName
Get an element using its name- Parameters:
name- name of the element- Returns:
- element object
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getElementsByName
@Deprecated(forRemoval=true) default IElement[] getElementsByName(String[] names, boolean withAttributes) throws PaloException, PaloJException Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElementsByName(String[])instead.Get an array of elements using their names, an exception will be thrown if at least one of them does not exist- Parameters:
names- names array of the elementswithAttributes- true get the element attributes information as well, false this information will be ignored.- Returns:
- element array object
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getElementsByName
Get an array of elements using their names, an exception will be thrown if at least one of them does not exist- Parameters:
names- names array of the elements- Returns:
- element array object
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getAttributeByName
Get an attribute using its name- Parameters:
name- name of the attribute- Returns:
- attribute object
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getAttributeByName
default IAttribute getAttributeByName(String name, String language) throws PaloException, PaloJException - Throws:
PaloExceptionPaloJException
-
addElements
Create a list of elements- Parameters:
names- the names of the new elementstypes- the types of the new elements- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
updateElementsType
void updateElementsType(IElement[] elements, IElement.ElementType type) throws PaloException, PaloJException Update the types of the elements, only ElementTypes type string and numeric can be usedIElement.ElementType. Consolidated elements can not be included in the given list of elements.- Parameters:
elements- the new elementstype- string or numeric- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addBaseElement
IElement addBaseElement(String name, IElement.ElementType type) throws PaloJException, PaloException Create one element, this method does not invalidate the cache.- Parameters:
name- the name of the new elementtype- the type of the new element- Returns:
- the newly created Element
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addAttribute
Create one attribute, this method does not invalidate the cache.- Parameters:
name- the name of the new attributetype- the type of the new attribute- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addAttributes
void addAttributes(String[] names, IElement.ElementType[] types) throws PaloJException, PaloException Create new attributes in this dimension- Parameters:
names- names of the new attributestypes- types of the new attributes- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
removeElements
Removes the elements- Parameters:
elements- names of the elements to be removed- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
removeAttributes
Removes the attributes- Parameters:
attributes- names of the attributes to be removed- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
removeAttributeValues
void removeAttributeValues(IAttribute attribute, IElement[] elements) throws PaloJException, PaloException Removes the attribute values for these elements in this dimension, for the given language in the attribute.- Parameters:
attribute- attributeelements- list of elements, null value means all.- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addAttributeValues
void addAttributeValues(IAttribute attribute, IElement[] elements, Object[] values) throws PaloJException, PaloException Writes the attribute values for these elements- Parameters:
attribute- dimension attributeelements- dimension elementsvalues- attribute new values- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
removeConsolidations
Remove the consolidations for these elements i.e. their children- Parameters:
elements- dimension elements- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
updateConsolidations
Update the consolidation for the elements mentioned as parents in the consolidations set.- Parameters:
consolidations- element parent-child relationships- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addConsolidations
Add the consolidations for the elements mentioned as parents in the consolidations set, the children will be added to the existing children list. This will send one separate request per Element.- Parameters:
consolidations- element parent-child relationships- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
newConsolidation
Create a consolidation object, no change is yet done to the dimension- Parameters:
parent- parent elementchild- child elementweight- child weight- Returns:
- the consolidation object
-
getAttributes
Get a list of attributes for this dimension- Returns:
- attributes dimension attributes
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
rename
Rename a dimension- Parameters:
newname- new dimension name- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
setCacheTrustExpiry
default void setCacheTrustExpiry(int seconds) Set the cache to be trusted (i.e. no need to check server tokens) for a certain amount of time. Be careful! changes from outside the library API on the OLAP server will not be considered. The value will be reseted as soon as a write API call is done with library, with exception to methodsaddBaseElement,addAttribute- Parameters:
seconds- number of seconds that the cache will be trusted
-
hasConsolidatedElements
boolean hasConsolidatedElements()Check if at least one C-Element exists- Returns:
- true, if at least one C-element exists
-
setWithElementPermission
default void setWithElementPermission(boolean withPermission) Decide whether elements should be read with permission or not- Parameters:
withPermission- true means element permission will be read as well, default is false.
-
resetCache
default void resetCache()Clear any cached information if exists, the expiry trust time will not be affected -
markCacheDirty
default void markCacheDirty()/** Set the cache to be no longer trusted without clearing the cached information. Upon next access to the dimension elements, the cache will get validated and eventually updated from OLAP Server. Expiry trust time will not be affected. -
removeAllConsolidations
int removeAllConsolidations()Clear all consolidations that exists in the dimension- Returns:
- number of C-Elements that were converted to base element
-
appendElements
Add new elements with the given type or simply change type of existing elements- Parameters:
elements- element to append- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
moveElements
Move a list of elements to new positions- Parameters:
elements- elements to movepositions- new positions- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getSingleElement
@Deprecated(forRemoval=true) default IElement getSingleElement(String elementName, boolean withAttributes) throws PaloException, PaloJException Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElement(String)instead.Get a single element in the dimension, the dimension elements will not be read in this case- Parameters:
elementName- name of the elementwithAttributes- true will get the attributes information as well- Returns:
- element if exists,otherwise null.
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getElement
Get a single element in the dimension, the dimension elements will not be read in this case- Parameters:
elementName- name of the element- Returns:
- element if exists,otherwise null.
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getSingleElement
@Deprecated(forRemoval=true) default IElement getSingleElement(String elementName, boolean withAttributes, boolean withPermission) throws PaloException, PaloJException Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetElement(String, boolean)instead.Get a single element in the dimension, the dimension elements will not be read in this case- Parameters:
elementName- name of the elementwithAttributes- true will get the attributes information as wellwithPermission- true will get the element permissions as well, default is false.- Returns:
- element if exists,otherwise null.
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getElement
default IElement getElement(String elementName, boolean withPermission) throws PaloException, PaloJException Get a single element in the dimension, the dimension elements will not be read in this case- Parameters:
elementName- name of the elementwithPermission- true will get the element permissions as well, default is false.- Returns:
- element if exists,otherwise null.
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getGlobalSubsetVariables
get the list of variables for the given global subset- Parameters:
name- name of the subset- Returns:
- list of variables
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
evaluateGlobalSubset
default IElement[] evaluateGlobalSubset(String name, IVariable[] subsetVariables) throws PaloException, PaloJException Evaluate the given subset with the set of variables- Parameters:
name- name of the subsetsubsetVariables- subset variables (can be empty)- Returns:
- the list of elements in the dimension that matches the subset
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getGlobalSubsets
Get the list of global subsets- Returns:
- list of global subsets
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getAttributeCube
Get the attribute cube if exists- Returns:
- get the attribute cube if exists, null if it does not exist
-
getDefaultReadElement
Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultReadElement()instead.Get the element set as default read for the dimension- Parameters:
withAttributes- true will get the attributes information as well- Returns:
- get the element if exists, null if it does not exist
-
getDefaultReadElement
Get the element set as default read for the dimension- Returns:
- get the element if exists, null if it does not exist
-
getDefaultWriteElement
Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultWriteElement()instead.Get the element set as default write for the dimension- Parameters:
withAttributes- true will get the attributes information as well- Returns:
- get the element if exists, null if it does not exist
-
getDefaultWriteElement
Get the element set as default write for the dimension- Returns:
- get the element if exists, null if it does not exist
-
getDefaultNAElement
Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultNAElement()instead.Get the element set as default N/A for the dimension- Parameters:
withAttributes- true will get the attributes information as well- Returns:
- get the element if exists, null if it does not exist
-
getDefaultNAElement
Get the element set as default N/A for the dimension- Returns:
- get the element if exists, null if it does not exist
-
getDefaultTotalElement
Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultTotalElement()instead.Get the element set as default total for the dimension- Parameters:
withAttributes- true will get the attributes information as well- Returns:
- get the element if exists, null if it does not exist
-
getDefaultTotalElement
Get the element set as default total for the dimension- Returns:
- get the element if exists, null if it does not exist
-
getDefaultParentElement
Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated, usegetDefaultParentElement()instead.Get the element set as default parent for the dimension- Parameters:
withAttributes- true will get the attributes information as well- Returns:
- get the element if exists, null if it does not exist
-
getDefaultParentElement
Get the element set as default parent for the dimension- Returns:
- get the element if exists, null if it does not exist
-
generateScript
-
getScriptContext
-
createVirtualDimension
Creates a virtual dimension specified by a dimension attribute.- Parameters:
attribute- a string attribute of the dimension
-
removeVirtualDimension
Removes a virtual dimension specified by a dimension attribute.- Parameters:
attribute- a string attribute of the dimension
-
getVirtualDimensions
Get a list of all virtual dimensions derived from attributes of this dimension- Returns:
- a list of virtual dimensions
-
getBasesElements()instead.