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 booleanstatic final intprotected LinkedHashMap<Integer,Element> protected static final Stringprotected booleanprotected DimensionInfoprotected static final Stringprotected static final StringFields inherited from class com.jedox.palojlib.main.CachedComponent
cacheTrustExpiry -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDimension(DimensionHandler dimensionHandler, 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 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 elementsprotected voidprotected booleanprotected booleanvoidcreateVirtualDimension(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 variablesgetAttributeByName(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[]Get the list of the bases elements in the dimensionprotected DatabaseGet the element set as default N/A for the dimensionGet the element set as default parent for the dimensionGet the element set as default read for the dimensionGet the element set as default total for the dimensionGet the element set as default write for the dimensionprotected DimensionHandlerGet the dimension info objectIDimensionInfogetElement(String elementName, boolean withPermission) Get a single element in the dimension, the dimension elements will not be read in this caseprotected ElementgetElementById(int id) getElementByName(String name) Get an element using its nameIElement[]Get the list of elements in the dimensionIElement[]getElementsByName(String[] names) 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[]Get the list of the root elements in the dimensionprotected DimensionInfogetType()Get the dimension typeIDimension.DimensionTypeGet a list of all virtual dimensions derived from attributes of this dimensionbooleanCheck if at least one C-Element existsvoid/** 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 dimensionreadAttributeValue(IElement element, String attributeName, String language) protected DimensionInfointClear 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 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
getBasesElements, getDefaultNAElement, getDefaultParentElement, getDefaultReadElement, getDefaultTotalElement, getDefaultWriteElement, getElement, getElementByName, getElements, getElementsByName, getRootElements, getSingleElement, getSingleElement, setCacheTrustExpiry
-
Field Details
-
defaultExpiryDuration
public static final int defaultExpiryDuration- See Also:
-
info
-
cacheExists
protected boolean cacheExists -
elementsIdMap
-
elementsNameMap
-
hasConsolidatedElements
protected boolean hasConsolidatedElements -
SUBSET_CUBE_NAME
- See Also:
-
SUBSET_CUBE_DIMENSION_NAME
- See Also:
-
EMPTY_CONSOLIDATION_LIST_ERROR_MSG
- See Also:
-
-
Constructor Details
-
Dimension
protected Dimension(DimensionHandler dimensionHandler, 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- 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- 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- Returns:
- list of root elements
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
readAttributeValue
-
getElementByName
Description copied from interface:IDimensionGet an element using its name- Specified by:
getElementByNamein interfaceIDimension- Parameters:
name- name of the element- Returns:
- element object
- Throws:
PaloException- exception from OLAP serverPaloJException- exception from the library itself
-
getDefaultReadElement
Description copied from interface:IDimensionGet the element set as default read for the dimension- Specified by:
getDefaultReadElementin interfaceIDimension- Returns:
- get the element if exists, null if it does not exist
-
getDefaultParentElement
Description copied from interface:IDimensionGet the element set as default parent for the dimension- Specified by:
getDefaultParentElementin interfaceIDimension- Returns:
- get the element if exists, null if it does not exist
-
getDefaultNAElement
Description copied from interface:IDimensionGet the element set as default N/A for the dimension- Specified by:
getDefaultNAElementin interfaceIDimension- Returns:
- get the element if exists, null if it does not exist
-
getDefaultTotalElement
Description copied from interface:IDimensionGet the element set as default total for the dimension- Specified by:
getDefaultTotalElementin interfaceIDimension- Returns:
- get the element if exists, null if it does not exist
-
getDefaultWriteElement
Description copied from interface:IDimensionGet the element set as default write for the dimension- Specified by:
getDefaultWriteElementin interfaceIDimension- Returns:
- get the element if exists, null if it does not exist
-
getElementsByName
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 elements- 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 void 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- 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
-
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() -
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
-
getElement
public IElement getElement(String elementName, boolean withPermission) throws PaloException, PaloJException Description copied from interface:IDimensionGet a single element in the dimension, the dimension elements will not be read in this case- Specified by:
getElementin interfaceIDimension- 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
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
-
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
-
markCacheDirty
public void markCacheDirty()Description copied from interface:IDimension/** 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.- Specified by:
markCacheDirtyin interfaceIDimension
-
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
-
getDimensionhandler
-