Package com.jedox.palojlib.main
Class Dimension
java.lang.Object
com.jedox.palojlib.main.CachedComponent
com.jedox.palojlib.main.Dimension
- All Implemented Interfaces:
IDimension
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jedox.palojlib.interfaces.IDimension
IDimension.DimensionType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedHashMap<Integer,Element> protected LinkedHashMap<String,Attribute> static final intprotected LinkedHashMap<Integer,Element> protected booleanprotected DimensionInfoprotected booleanprotected booleanFields inherited from class com.jedox.palojlib.main.CachedComponent
cacheTrustExpiry -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDimension(int contextId, int id, String name, Database database, IDimension.DimensionType type, String attributeDimensionId, String attributeCubeId, String maximumLevel, String maximumIndent, String maximumDepth, String token, String numberOfElements, String defaultRead, String defaultWrite, String defaultNA, String defaultTotal, String defaultParent) -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String name, IElement.ElementType type) Create one attribute, this method does not invalidate the cache.voidaddAttributeConsolidation(IAttribute parent, 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 elementsprotected voidbuildCache(boolean withAttributes) protected booleancacheExists(boolean withAttributes) protected booleancheckCacheStatus(boolean withAttributes) voidcreateVirtualDimension(IAttribute attribute) Creates a virtual dimension specified by a dimension attribute.IElement[]evaluateGlobalSubset(String subsetname, IVariable[] subsetVariables) evaluate the given subset with the set of variablesprotected AttributegetAttributeById(int id) getAttributeByName(String name) Get an attribute using its namegetAttributeByName(String name, String language) get the attribute cube if existsprotected intGet a list of attributes for this dimensionIElement[]getBasesElements(boolean withAttributes) Get the list of the bases elements in the dimensionprotected intprotected DatabasegetDefaultNAElement(boolean withAttributes) getDefaultParentElement(boolean withAttributes) getDefaultReadElement(boolean withAttributes) getDefaultTotalElement(boolean withAttributes) getDefaultWriteElement(boolean withAttributes) Get the dimension info objectIDimensionInfoprotected ElementgetElementById(int id) getElementByName(String name, boolean withAttributes) Get an element using its nameIElement[]getElements(boolean withAttributes) Get the list of elements in the dimensionIElement[]getElementsByName(String[] names, boolean withAttributes) Get an array of elements using their names, an exception will be thrown if at least one of them does not existString[]get the list of global subsetsString[]getGlobalSubsetVariables(String subsetname) 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 dimensionprotected DimensionInfogetSingleElement(String elementName, boolean withAttributes, boolean withPermission) getType()Get the dimension typeIDimension.DimensionTypeGet a list of all virtual dimensions derived from attributes of this dimensionbooleancheck 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 dimensionprotected DimensionInfointclear 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 elementsvoidremoveVirtualDimension(IAttribute attribute) Removes a virtual dimension specified by a dimension attribute.voidrename a dimensionvoidclear any cached information if exists, the expiry trust time will not be affectedvoidsetWithElementPermission(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.Methods 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.IDimension
getAttributesMap, getChildrenMap, getSingleElement, getWeightsMap, setCacheTrustExpiry
-
Field Details
-
defaultExpiryDuration
public static final int defaultExpiryDuration- See Also:
-
info
-
withAttributeCacheExists
protected boolean withAttributeCacheExists -
withoutAttributeCacheExists
protected boolean withoutAttributeCacheExists -
attributesIdMap
-
elementsIdMap
-
elementsNameMap
-
attributesNameMap
-
attributesObjectNameMap
-
hasConsolidatedElements
protected boolean hasConsolidatedElements
-
-
Constructor Details
-
Dimension
protected Dimension(int contextId, int id, String name, Database database, IDimension.DimensionType type, String attributeDimensionId, String attributeCubeId, String maximumLevel, String maximumIndent, String maximumDepth, String token, String numberOfElements, String defaultRead, String defaultWrite, String defaultNA, String defaultTotal, String defaultParent) throws PaloException, PaloJException - Throws:
PaloExceptionPaloJException
-
-
Method Details
-
getName
Description copied from interface:IDimensionGet the name of the dimension- Specified by:
getNamein interfaceIDimension- Returns:
- name of the dimension
-
getType
Description copied from interface:IDimensionGet the dimension typeIDimension.DimensionType- Specified by:
getTypein interfaceIDimension- Returns:
- type
-
getDimensionInfo
Description copied from interface:IDimensionGet the dimension info objectIDimensionInfo- Specified by:
getDimensionInfoin interfaceIDimension- Returns:
- dimension info object
-
getElements
Description copied from interface:IDimensionGet the list of elements in the dimension- Specified by:
getElementsin interfaceIDimension- 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
Description copied from interface:IDimensionGet the list of the root elements in the dimension- Specified by:
getRootElementsin interfaceIDimension- 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
Description copied from interface:IDimensionGet the list of the bases elements in the dimension- Specified by:
getBasesElementsin interfaceIDimension- 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
-
getAttributesObjectMap
-
getElementByName
public IElement getElementByName(String name, boolean withAttributes) throws PaloException, PaloJException Description copied from interface:IDimensionGet an element using its name- Specified by:
getElementByNamein interfaceIDimension- 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
-
getDefaultReadElement
- Specified by:
getDefaultReadElementin interfaceIDimension
-
getDefaultParentElement
- Specified by:
getDefaultParentElementin interfaceIDimension
-
getDefaultNAElement
- Specified by:
getDefaultNAElementin interfaceIDimension
-
getDefaultTotalElement
- Specified by:
getDefaultTotalElementin interfaceIDimension
-
getDefaultWriteElement
- Specified by:
getDefaultWriteElementin interfaceIDimension
-
getElementsByName
public IElement[] getElementsByName(String[] names, boolean withAttributes) throws PaloException, PaloJException Description copied from interface:IDimensionGet an array of elements using their names, an exception will be thrown if at least one of them does not exist- Specified by:
getElementsByNamein interfaceIDimension- 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
-
hasConsolidatedElements
public boolean hasConsolidatedElements()Description copied from interface:IDimensioncheck if at least one C-Element exists- Specified by:
hasConsolidatedElementsin interfaceIDimension- Returns:
- true, if at least one C-element exists
-
getAttributes
Description copied from interface:IDimensionGet a list of attributes for this dimension- Specified by:
getAttributesin interfaceIDimension- Returns:
- attributes dimension attributes
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getAttributeByName
Description copied from interface:IDimensionGet an attribute using its name- Specified by:
getAttributeByNamein interfaceIDimension- Parameters:
name- name of the attribute- Returns:
- attribute object
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getAttributeByName
public IAttribute getAttributeByName(String name, String language) throws PaloException, PaloJException - Specified by:
getAttributeByNamein interfaceIDimension- Throws:
PaloExceptionPaloJException
-
addElements
public void addElements(String[] names, IElement.ElementType[] types) throws PaloException, PaloJException Description copied from interface:IDimensionCreate a list of elements- Specified by:
addElementsin interfaceIDimension- 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
-
appendElements
Description copied from interface:IDimensionAdd new elements with the given type or simply change type of existing elements- Specified by:
appendElementsin interfaceIDimension- Parameters:
elements- element to append- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
moveElements
public void moveElements(IElement[] elements, Integer[] positions) throws PaloException, PaloJException Description copied from interface:IDimensionmove a list of elements to new positions- Specified by:
moveElementsin interfaceIDimension- Parameters:
elements- elements to movepositions- new positions- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addBaseElement
public IElement addBaseElement(String name, IElement.ElementType type) throws PaloJException, PaloException Description copied from interface:IDimensionCreate one element, this method does not invalidate the cache.- Specified by:
addBaseElementin interfaceIDimension- Parameters:
name- the name of the new elementtype- the type of the new element- Returns:
- the newly created Element
- Throws:
PaloJException- exception from the library itselfPaloException- exception from OLAP server
-
addAttribute
public IAttribute addAttribute(String name, IElement.ElementType type) throws PaloJException, PaloException Description copied from interface:IDimensionCreate one attribute, this method does not invalidate the cache.- Specified by:
addAttributein interfaceIDimension- Parameters:
name- the name of the new attributetype- the type of the new attribute- Returns:
- the newly created attribute
- Throws:
PaloJException- exception from the library itselfPaloException- exception from OLAP server
-
addAttributes
public void addAttributes(String[] names, IElement.ElementType[] types) throws PaloJException, PaloException Description copied from interface:IDimensionCreate new attributes in this dimension- Specified by:
addAttributesin interfaceIDimension- Parameters:
names- names of the new attributestypes- types of the new attributes- Throws:
PaloJException- exception from the library itselfPaloException- exception from OLAP server
-
removeConsolidations
Description copied from interface:IDimensionremove the consolidations for these elements i.e. their children- Specified by:
removeConsolidationsin interfaceIDimension- Parameters:
elements- dimension elements- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
removeAllConsolidations
Description copied from interface:IDimensionclear all consolidations that exists in the dimension- Specified by:
removeAllConsolidationsin interfaceIDimension- Returns:
- number of C-Elements that were converted to base element
- Throws:
PaloExceptionPaloJException
-
updateConsolidations
public void updateConsolidations(IConsolidation[] consolidations) throws PaloException, PaloJException Description copied from interface:IDimensionupdate the consolidation for the elements mentioned as parents in the consolidations set.- Specified by:
updateConsolidationsin interfaceIDimension- Parameters:
consolidations- element parent-child relationships- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addAttributeConsolidation
public void addAttributeConsolidation(IAttribute parent, IAttribute child) throws PaloJException, PaloException Description copied from interface:IDimensionadd a child for this attribute- Specified by:
addAttributeConsolidationin interfaceIDimension- Parameters:
parent- dimension attributechild- attribute child attribute- Throws:
PaloJException- exception from the library itselfPaloException- exception from OLAP server
-
removeAttributeConsolidations
public void removeAttributeConsolidations(IAttribute attribute) throws PaloException, PaloJException Description copied from interface:IDimensionremove the consolidations for this attribute i.e. its children- Specified by:
removeAttributeConsolidationsin interfaceIDimension- Parameters:
attribute- dimension attribute- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
newConsolidation
Description copied from interface:IDimensioncreate a consolidation object, no change is yet done to the dimension- Specified by:
newConsolidationin interfaceIDimension- Parameters:
parent- parent elementchild- child elementweight- child weight- Returns:
- the consolidation object
-
removeAttributes
Description copied from interface:IDimensionRemoves the attributes- Specified by:
removeAttributesin interfaceIDimension- Parameters:
attributes- names of the attributes to be removed- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
removeElements
Description copied from interface:IDimensionremoves the elements- Specified by:
removeElementsin interfaceIDimension- Parameters:
elements- names of the elements to be removed- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
addAttributeValues
public void addAttributeValues(IAttribute attribute, IElement[] elements, Object[] values) throws PaloJException, PaloException Description copied from interface:IDimensionWrites the attribute values for these elements- Specified by:
addAttributeValuesin interfaceIDimension- Parameters:
attribute- dimension attributeelements- dimension elementsvalues- attribute new values- Throws:
PaloJException- exception from the library itselfPaloException- exception from OLAP server
-
removeAttributeValues
public void removeAttributeValues(IAttribute attribute, IElement[] elements) throws PaloJException, PaloException Description copied from interface:IDimensionRemoves the attribute values for these elements in this dimension, for the given language in the attribute.- Specified by:
removeAttributeValuesin interfaceIDimension- Parameters:
attribute- attributeelements- list of elements, null value means all.- Throws:
PaloJException- exception from the library itselfPaloException- exception from OLAP server
-
addConsolidations
Description copied from interface:IDimensionadd 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.- Specified by:
addConsolidationsin interfaceIDimension- Parameters:
consolidations- element parent-child relationships- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getAttributeCube
Description copied from interface:IDimensionget the attribute cube if exists- Specified by:
getAttributeCubein interfaceIDimension- Returns:
- get the attribute cube if exists, null if it does not exist
-
generateScript
- Specified by:
generateScriptin interfaceIDimension
-
getScriptContext
- Specified by:
getScriptContextin interfaceIDimension
-
buildCache
- Throws:
PaloExceptionPaloJException
-
cacheExists
protected boolean cacheExists(boolean withAttributes) -
checkCacheStatus
- Throws:
PaloExceptionPaloJException
-
getId
public int getId()Description copied from interface:IDimensionGet the ID of the Dimension- Specified by:
getIdin interfaceIDimension- Returns:
- Dimension ID
-
rename
Description copied from interface:IDimensionrename a dimension- Specified by:
renamein interfaceIDimension- Parameters:
name- new dimension name- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
updateElementsType
public void updateElementsType(IElement[] elements, IElement.ElementType type) throws PaloException, PaloJException Description copied from interface:IDimensionupdate 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.- Specified by:
updateElementsTypein interfaceIDimension- Parameters:
elements- the new elementstype- string or numeric- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getSingleElement
public IElement getSingleElement(String elementName, boolean withAttributes, boolean withPermission) throws PaloException, PaloJException - Specified by:
getSingleElementin interfaceIDimension- Throws:
PaloExceptionPaloJException
-
getGlobalSubsetVariables
Description copied from interface:IDimensionget the list of variables for the given global subset- Specified by:
getGlobalSubsetVariablesin interfaceIDimension- Parameters:
subsetname- name of the subset- Returns:
- list of variables
-
evaluateGlobalSubset
Description copied from interface:IDimensionevaluate the given subset with the set of variables- Specified by:
evaluateGlobalSubsetin interfaceIDimension- Parameters:
subsetname- name of the subsetsubsetVariables- subset variables (can be empty)- Returns:
- the list of elements in the dimension that matches the subset
-
getGlobalSubsets
Description copied from interface:IDimensionget the list of global subsets- Specified by:
getGlobalSubsetsin interfaceIDimension- Returns:
- list of global subsets
-
getElementById
- Throws:
PaloExceptionPaloJException
-
getServerDimensionInfo
- Throws:
PaloExceptionPaloJException
-
refreshDimensionInfo
- Throws:
PaloExceptionPaloJException
-
getAttributeById
- Throws:
PaloExceptionPaloJException
-
setWithElementPermission
public void setWithElementPermission(boolean withPermission) Description copied from interface:IDimensiondecide whether elements should be read with permission or not- Specified by:
setWithElementPermissionin interfaceIDimension- Parameters:
withPermission- true means element permission will be read as well, default is false.
-
resetCache
public void resetCache()Description copied from interface:IDimensionclear any cached information if exists, the expiry trust time will not be affected- Specified by:
resetCachein interfaceIDimension
-
getContextId
protected int getContextId() -
getDatabase
-
getAttributeDimensionId
protected int getAttributeDimensionId() -
createVirtualDimension
Description copied from interface:IDimensionCreates a virtual dimension specified by a dimension attribute.- Specified by:
createVirtualDimensionin interfaceIDimension- Parameters:
attribute- a string attribute of the dimension
-
removeVirtualDimension
Description copied from interface:IDimensionRemoves a virtual dimension specified by a dimension attribute.- Specified by:
removeVirtualDimensionin interfaceIDimension- Parameters:
attribute- a string attribute of the dimension
-
getVirtualDimensions
Description copied from interface:IDimensionGet a list of all virtual dimensions derived from attributes of this dimension- Specified by:
getVirtualDimensionsin interfaceIDimension- Returns:
- a list of virtual dimensions
-