Interface IDimension

All Known Implementing Classes:
Dimension

public interface IDimension
Interface that represents a dimension in database
Author:
khaddadin
  • 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

      Get the dimension type IDimension.DimensionType
      Returns:
      type
    • getDimensionInfo

      IDimensionInfo getDimensionInfo() throws PaloException
      Get the dimension info object IDimensionInfo
      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, use getElements() 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 server
      PaloJException - exception from the library itself
    • getElements

      IElement[] getElements() throws PaloException, PaloJException
      Get the list of elements in the dimension
      Returns:
      list of elements
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getRootElements

      @Deprecated default IElement[] getRootElements(boolean withAttributes) throws PaloException, PaloJException
      Deprecated.
      This method is deprecated, use getRootElements() 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 server
      PaloJException - exception from the library itself
    • getRootElements

      IElement[] getRootElements() throws PaloException, PaloJException
      Get the list of the root elements in the dimension
      Returns:
      list of root elements
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getBasesElements

      @Deprecated default IElement[] getBasesElements(boolean withAttributes) throws PaloException, PaloJException
      Deprecated.
      This method is deprecated, use getBasesElements() 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 server
      PaloJException - exception from the library itself
    • getBasesElements

      IElement[] getBasesElements() throws PaloException, PaloJException
      Get the list of the bases elements in the dimension
      Returns:
      list of root elements
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getElementByName

      @Deprecated default IElement getElementByName(String name, boolean withAttributes) throws PaloException, PaloJException
      Deprecated.
      This method is deprecated, use getElementByName(String) instead.
      Get an element using its name
      Parameters:
      name - name of the element
      withAttributes - true get the element attributes information as well, false this information will be ignored.
      Returns:
      element object
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getElementByName

      IElement getElementByName(String name) throws PaloException, PaloJException
      Get an element using its name
      Parameters:
      name - name of the element
      Returns:
      element object
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getElementsByName

      @Deprecated default IElement[] getElementsByName(String[] names, boolean withAttributes) throws PaloException, PaloJException
      Deprecated.
      This method is deprecated, use getElementsByName(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 elements
      withAttributes - true get the element attributes information as well, false this information will be ignored.
      Returns:
      element array object
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getElementsByName

      IElement[] getElementsByName(String[] names) 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:
      names - names array of the elements
      Returns:
      element array object
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getAttributeByName

      IAttribute getAttributeByName(String name) throws PaloException, PaloJException
      Get an attribute using its name
      Parameters:
      name - name of the attribute
      Returns:
      attribute object
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getAttributeByName

      default IAttribute getAttributeByName(String name, String language) throws PaloException, PaloJException
      Throws:
      PaloException
      PaloJException
    • addElements

      void addElements(String[] names, IElement.ElementType[] types) throws PaloException, PaloJException
      Create a list of elements
      Parameters:
      names - the names of the new elements
      types - the types of the new elements
      Throws:
      PaloException - exception from OLAP server
      PaloJException - 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 used IElement.ElementType. Consolidated elements can not be included in the given list of elements.
      Parameters:
      elements - the new elements
      type - string or numeric
      Throws:
      PaloException - exception from OLAP server
      PaloJException - 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 element
      type - the type of the new element
      Returns:
      the newly created Element
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • addAttribute

      void 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 attribute
      type - the type of the new attribute
      Throws:
      PaloException - exception from OLAP server
      PaloJException - 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 attributes
      types - types of the new attributes
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • removeElements

      void removeElements(IElement[] elements) throws PaloException, PaloJException
      removes the elements
      Parameters:
      elements - names of the elements to be removed
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • removeAttributes

      void removeAttributes(IAttribute[] attributes) throws PaloException, PaloJException
      Removes the attributes
      Parameters:
      attributes - names of the attributes to be removed
      Throws:
      PaloException - exception from OLAP server
      PaloJException - 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 - attribute
      elements - list of elements, null value means all.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - 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 attribute
      elements - dimension elements
      values - attribute new values
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • removeConsolidations

      void removeConsolidations(IElement[] elements) throws PaloException, PaloJException
      remove the consolidations for these elements i.e. their children
      Parameters:
      elements - dimension elements
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • updateConsolidations

      void updateConsolidations(IConsolidation[] consolidations) throws PaloException, PaloJException
      update the consolidation for the elements mentioned as parents in the consolidations set.
      Parameters:
      consolidations - element parent-child relationships
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • addConsolidations

      void addConsolidations(IConsolidation[] consolidations) throws PaloException, PaloJException
      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 server
      PaloJException - exception from the library itself
    • newConsolidation

      IConsolidation newConsolidation(IElement parent, IElement child, double weight)
      create a consolidation object, no change is yet done to the dimension
      Parameters:
      parent - parent element
      child - child element
      weight - child weight
      Returns:
      the consolidation object
    • getAttributes

      IAttribute[] getAttributes() throws PaloException, PaloJException
      Get a list of attributes for this dimension
      Returns:
      attributes dimension attributes
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • rename

      void rename(String newname) throws PaloException, PaloJException
      rename a dimension
      Parameters:
      newname - new dimension name
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getChildrenMap

      @Deprecated default Map<String,IElement[]> getChildrenMap() throws PaloException
      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 default Map<String,HashMap<String,Object>> getAttributesMap() throws PaloException
      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 default Map<String,HashMap<String,Double>> getWeightsMap() throws PaloException
      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 methods addBaseElement, 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

      void appendElements(IElement[] elements) throws PaloException, PaloJException
      Add new elements with the given type or simply change type of existing elements
      Parameters:
      elements - element to append
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • moveElements

      void moveElements(IElement[] elements, Integer[] positions) throws PaloException, PaloJException
      move a list of elements to new positions
      Parameters:
      elements - elements to move
      positions - new positions
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getSingleElement

      @Deprecated default IElement getSingleElement(String elementName, boolean withAttributes) throws PaloException, PaloJException
      Deprecated.
      This method is deprecated, use getElement(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 element
      withAttributes - true will get the attributes information as well
      Returns:
      element if exists,otherwise null.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getElement

      default IElement getElement(String elementName) 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 element
      Returns:
      element if exists,otherwise null.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getSingleElement

      @Deprecated default IElement getSingleElement(String elementName, boolean withAttributes, boolean withPermission) throws PaloException, PaloJException
      Deprecated.
      This method is deprecated, use getElement(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 element
      withAttributes - true will get the attributes information as well
      withPermission - true will get the element permissions as well, default is false.
      Returns:
      element if exists,otherwise null.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - 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 element
      withPermission - true will get the element permissions as well, default is false.
      Returns:
      element if exists,otherwise null.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getGlobalSubsetVariables

      default String[] getGlobalSubsetVariables(String name) throws PaloException, PaloJException
      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 server
      PaloJException - 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 subset
      subsetVariables - subset variables (can be empty)
      Returns:
      the list of elements in the dimension that matches the subset
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getGlobalSubsets

      default String[] getGlobalSubsets() throws PaloException, PaloJException
      get the list of global subsets
      Returns:
      list of global subsets
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getAttributeCube

      default ICube getAttributeCube()
      get the attribute cube if exists
      Returns:
      get the attribute cube if exists, null if it does not exist
    • getDefaultReadElement

      @Deprecated default IElement getDefaultReadElement(boolean withAttributes)
      Deprecated.
      This method is deprecated, use getDefaultReadElement() 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

      default IElement 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 default IElement getDefaultWriteElement(boolean withAttributes)
      Deprecated.
      This method is deprecated, use getDefaultWriteElement() 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

      default IElement 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 default IElement getDefaultNAElement(boolean withAttributes)
      Deprecated.
      This method is deprecated, use getDefaultNAElement() 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

      default IElement 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 default IElement getDefaultTotalElement(boolean withAttributes)
      Deprecated.
      This method is deprecated, use getDefaultTotalElement() 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

      default IElement 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 default IElement getDefaultParentElement(boolean withAttributes)
      Deprecated.
      This method is deprecated, use getDefaultParentElement() 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

      default IElement getDefaultParentElement()
      get the element set as default parent for the dimension
      Returns:
      get the element if exists, null if it does not exist
    • generateScript

      default String generateScript(IDimensionScriptContext dimensionScriptContext)
    • getScriptContext

      default IDimensionScriptContext getScriptContext()
    • createVirtualDimension

      default void createVirtualDimension(IAttribute attribute)
      Creates a virtual dimension specified by a dimension attribute.
      Parameters:
      attribute - a string attribute of the dimension
    • removeVirtualDimension

      default void removeVirtualDimension(IAttribute attribute)
      Removes a virtual dimension specified by a dimension attribute.
      Parameters:
      attribute - a string attribute of the dimension
    • getVirtualDimensions

      default IDimension[] getVirtualDimensions()
      Get a list of all virtual dimensions derived from attributes of this dimension
      Returns:
      a list of virtual dimensions