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 TypeMethodDescriptionaddAttribute(String name, IElement.ElementType type) Create one attribute, this method does not invalidate the cache.voidaddAttributeConsolidation(IAttribute attribute, IAttribute child) add a child for this attributevoidaddAttributes(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 dimensionDeprecated.This method is deprecated and will be removed.IElement[]getBasesElements(boolean withAttributes) Get the list of the bases elements in the dimensionDeprecated.This method is deprecated and will be removed.default IElementgetDefaultNAElement(boolean withAttributes) default IElementgetDefaultParentElement(boolean withAttributes) default IElementgetDefaultReadElement(boolean withAttributes) default IElementgetDefaultTotalElement(boolean withAttributes) default IElementgetDefaultWriteElement(boolean withAttributes) Get the dimension info objectIDimensionInfogetElementByName(String name, boolean withAttributes) Get an element using its nameIElement[]getElements(boolean withAttributes) Get the list of elements in the dimensionIElement[]getElementsByName(String[] name, boolean withAttributes) Get an array of elements using their names, an exception will be thrown if at least one of them does not existdefault 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[]getRootElements(boolean withAttributes) Get the list of the root elements in the dimensiondefault IDimensionScriptContextdefault IElementgetSingleElement(String elementName, boolean withAttributes) Get the a single element in the dimension, the dimension elements will not be read in this casedefault IElementgetSingleElement(String elementName, boolean withAttributes, boolean withPermission) getType()Get the dimension typeIDimension.DimensionTypedefault IDimension[]Get a list of all virtual dimensions derived from attributes of this dimensionDeprecated.This method is deprecated and will be removed.booleancheck if at least one C-Element existsvoidmoveElements(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 dimensionvoidremoveAttributeConsolidations(IAttribute attribute) remove the consolidations for this attribute i.e.voidremoveAttributes(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.voidremoveElements(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.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
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
-
getRootElements
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
-
getBasesElements
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
-
getElementByName
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
-
getElementsByName
IElement[] getElementsByName(String[] name, boolean withAttributes) throws PaloException, PaloJException Get an array of elements using their names, an exception will be thrown if at least one of them does not exist- Parameters:
name- 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
-
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
IAttribute addAttribute(String name, IElement.ElementType type) throws PaloJException, PaloException Create one attribute, this method does not invalidate the cache.- Parameters:
name- the name of the new attributetype- the type of the new attribute- Returns:
- the newly created 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
-
removeAttributeConsolidations
remove the consolidations for this attribute i.e. its children- Parameters:
attribute- dimension attribute- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addAttributeConsolidation
void addAttributeConsolidation(IAttribute attribute, IAttribute child) throws PaloJException, PaloException add a child for this attribute- Parameters:
attribute- dimension attributechild- attribute child attribute- 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
default IElement getSingleElement(String elementName, boolean withAttributes) 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 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
-
getSingleElement
default IElement getSingleElement(String elementName, boolean withAttributes, boolean withPermission) throws PaloException, PaloJException - Throws:
PaloExceptionPaloJException
-
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
-
getDefaultWriteElement
-
getDefaultNAElement
-
getDefaultTotalElement
-
getDefaultParentElement
-
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
-