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 TypeMethodDescriptionvoid
addAttribute
(String name, IElement.ElementType type) Create one attribute, this method does not invalidate the cache.void
addAttributes
(String[] names, IElement.ElementType[] types) Create new attributes in this dimensionvoid
addAttributeValues
(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.void
addConsolidations
(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.void
addElements
(String[] names, IElement.ElementType[] types) Create a list of elementsvoid
appendElements
(IElement[] elements) Add new elements with the given type or simply change type of existing elementsdefault void
createVirtualDimension
(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 String
generateScript
(IDimensionScriptContext dimensionScriptContext) getAttributeByName
(String name) Get an attribute using its namedefault IAttribute
getAttributeByName
(String name, String language) default ICube
get the attribute cube if existsGet a list of attributes for this dimensionDeprecated.This method is deprecated and will be removed.IElement[]
Get the list of the bases elements in the dimensiondefault IElement[]
getBasesElements
(boolean withAttributes) Deprecated.This method is deprecated, usegetBasesElements()
instead.Deprecated.This method is deprecated and will be removed.default IElement
get the element set as default N/A for the dimensiondefault IElement
getDefaultNAElement
(boolean withAttributes) Deprecated.This method is deprecated, usegetDefaultNAElement()
instead.default IElement
get the element set as default parent for the dimensiondefault IElement
getDefaultParentElement
(boolean withAttributes) Deprecated.This method is deprecated, usegetDefaultParentElement()
instead.default IElement
get the element set as default read for the dimensiondefault IElement
getDefaultReadElement
(boolean withAttributes) Deprecated.This method is deprecated, usegetDefaultReadElement()
instead.default IElement
get the element set as default total for the dimensiondefault IElement
getDefaultTotalElement
(boolean withAttributes) Deprecated.This method is deprecated, usegetDefaultTotalElement()
instead.default IElement
get the element set as default write for the dimensiondefault IElement
getDefaultWriteElement
(boolean withAttributes) Deprecated.This method is deprecated, usegetDefaultWriteElement()
instead.Get the dimension info objectIDimensionInfo
default IElement
getElement
(String elementName) Get a single element in the dimension, the dimension elements will not be read in this casedefault IElement
getElement
(String elementName, boolean withPermission) Get the a single element in the dimension, the dimension elements will not be read in this casegetElementByName
(String name) Get an element using its namedefault IElement
getElementByName
(String name, boolean withAttributes) Deprecated.This method is deprecated, usegetElementByName(String)
instead.IElement[]
Get the list of elements in the dimensiondefault IElement[]
getElements
(boolean withAttributes) Deprecated.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.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 subsetint
getId()
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.This method is deprecated, usegetRootElements()
instead.default IDimensionScriptContext
default IElement
getSingleElement
(String elementName, boolean withAttributes) Deprecated.This method is deprecated, usegetElement(String)
instead.default IElement
getSingleElement
(String elementName, boolean withAttributes, boolean withPermission) Deprecated.This method is deprecated, usegetElement(String, boolean)
instead.getType()
Get the dimension typeIDimension.DimensionType
default IDimension[]
Get a list of all virtual dimensions derived from attributes of this dimensionDeprecated.This method is deprecated and will be removed.boolean
check if at least one C-Element existsvoid
moveElements
(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 dimensionint
clear all consolidations that exists in the dimensionvoid
removeAttributes
(IAttribute[] attributes) Removes the attributesvoid
removeAttributeValues
(IAttribute attribute, IElement[] elements) Removes the attribute values for these elements in this dimension, for the given language in the attribute.void
removeConsolidations
(IElement[] elements) remove the consolidations for these elements i.e.void
removeElements
(IElement[] elements) removes the elementsdefault void
removeVirtualDimension
(IAttribute attribute) Removes a virtual dimension specified by a dimension attribute.void
rename a dimensiondefault void
clear any cached information if exists, the expiry trust time will not be affecteddefault void
setCacheTrustExpiry
(int seconds) set the cache to be trusted (i.e.default void
setWithElementPermission
(boolean withPermission) decide whether elements should be read with permission or notvoid
updateConsolidations
(IConsolidation[] consolidations) update the consolidation for the elements mentioned as parents in the consolidations set.void
updateElementsType
(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 default IElement[] getElements(boolean withAttributes) throws PaloException, PaloJException Deprecated.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 default IElement[] getRootElements(boolean withAttributes) throws PaloException, PaloJException Deprecated.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 default IElement[] getBasesElements(boolean withAttributes) throws PaloException, PaloJException Deprecated.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 default IElement getElementByName(String name, boolean withAttributes) throws PaloException, PaloJException Deprecated.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 default IElement[] getElementsByName(String[] names, boolean withAttributes) throws PaloException, PaloJException Deprecated.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:
PaloException
PaloJException
-
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
-
getChildrenMap
Deprecated.This method is deprecated and will be removed.get a map that maps each element name to its children- Returns:
- map the map
- Throws:
PaloException
- exception from OLAP server
-
getAttributesMap
Deprecated.This method is deprecated and will be removed.get a map that maps each element name to a sub map which maps the element attribute names to their corresponding values for that element- Returns:
- map the map
- Throws:
PaloException
- exception from OLAP server
-
getWeightsMap
Deprecated.This method is deprecated and will be removed.get a map that maps each element name to a sub map which maps the elements' parents to their weights for that element- Returns:
- map the map
- Throws:
PaloException
- exception from OLAP server
-
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 -
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 default IElement getSingleElement(String elementName, boolean withAttributes) throws PaloException, PaloJException Deprecated.This method is deprecated, usegetElement(String)
instead.Get the 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 default IElement getSingleElement(String elementName, boolean withAttributes, boolean withPermission) throws PaloException, PaloJException Deprecated.This method is deprecated, usegetElement(String, boolean)
instead.Get the 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 the 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.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.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.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.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.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
-