com.tensegrity.palojava.http
Class HttpClient

java.lang.Object
  extended by com.tensegrity.palojava.http.HttpClient

public class HttpClient
extends java.lang.Object

This class encapsulates the http based communication between the palo api and the palo server. Therefore different (so called) http handlers are used to perform the desired actions. So internally every action is delegated to a certain registered http handler.

Version:
$Id$
Author:
ArndHouben

Constructor Summary
HttpClient(ConnectionHttp paloConn)
          Creates a new HttpClient instance and connects to the palo server specified by the given ConnectionHttp instance.
 
Method Summary
 boolean addCube(java.lang.String dbName, java.lang.String name, java.lang.String dimNames)
          Creates and adds the specified cube to the given database
 java.lang.String addDatabase(java.lang.String dbName)
          Creates a new database with the given name and adds it to the server
 boolean addDimension(java.lang.String dbName, java.lang.String dimName)
          Creates and adds the specified dimension to the given database
 boolean addElement(java.lang.String dbName, java.lang.String dimName, java.lang.String name, java.lang.String type, java.lang.String childNames, java.lang.String weights)
          Creates and adds the specified element to the given dimension
 boolean clearDimension(java.lang.String dbName, java.lang.String dimName)
          Clears the specified dimension, i.e. all its elements are removed and all associated cubes are cleared as well.
 boolean deleteDatabase(java.lang.String dbName)
          Removes the given database and its dimensions and cubes from the palo server
 void disconnect()
          Disconnects this client from the palo server
 void ensureConnection()
          Checks if the session id is still valid.
 ConsolidationInfo[] getConsolidationInfos(java.lang.String dbName, java.lang.String dimName, java.lang.String elName)
          Returns the ConsolidationInfos associated with the specified element
 HttpCubeHandler getCubeHandler()
          Returns the cube handler which is responsible for the part of the http communication which deals with cubes
 java.lang.String[] getCubeInfos(java.lang.String dbName, java.lang.String cubeName)
          Returns information about the specified cube.
 java.lang.String[] getCubes(java.lang.String dbName)
          Returns the names of the cubes which are saved within the given database
 java.lang.String[] getCubesFromDimension(java.lang.String dbName, java.lang.String dimName)
          Returns the names of the cubes which are associated to the given dimension
 java.lang.Object getData(java.lang.String dbName, java.lang.String cubeName, int coordsCount, java.lang.String[] coords)
          Receives the value at the given cube cell.
 java.lang.Object[] getDataArea(java.lang.String dbName, java.lang.String cubeName, java.lang.String[][] elNames)
          A convenient method to receive the values of multiple cube cells.
 HttpDatabaseHandler getDatabaseHandler()
          Returns the database handler which is responsible for the part of the http communication which deals with databases
 java.lang.String[] getDatabaseInfos(java.lang.String dbName)
          Returns information about the specified database.
 java.lang.String[] getDatabases()
          Returns an array of database names which are stored in the server so far
 DimElementInfo[] getDimElementInfos(java.lang.String dbName, java.lang.String dimName)
          Returns the DimElementInfos associated with the specified dimension
 java.lang.String[] getDimensionInfos(java.lang.String dbName, java.lang.String dimName)
          Returns information about the specified dimension.
 java.lang.String[] getDimensions(java.lang.String dbName)
          Returns the names of the dimensions which are saved within the given database
 java.lang.String[] getDimensionsFromCube(java.lang.String dbName, java.lang.String cubeName)
          Returns the names of the dimensions which build up the specified cube
 HttpDimensionHandler getDimHandler()
          Returns the dimension handler which is responsible for the part of the http communication which deals with dimensions
 int getElementChildCount(java.lang.String dbName, java.lang.String dimName, java.lang.String elName)
          Returns the number of children the specified element has
 int getElementCount(java.lang.String dbName, java.lang.String dimName)
          Returns the number of elements the specified dimension has
 HttpElementHandler getElementHandler()
          Returns the element handler which is responsible for the part of the http communication which deals with elements
 int getElementIndent(java.lang.String dbName, java.lang.String dimName, java.lang.String elName)
          Returns the indent of the specified element within the given dimension
 int getElementIndex(java.lang.String dbName, java.lang.String dimName, java.lang.String elName)
          Returns the position of the specified element within the given dimension
 java.lang.String[] getElementInfos(java.lang.String dbName, java.lang.String dimName, java.lang.String elName)
          Returns information about the specified element.
 int getElementLevel(java.lang.String dbName, java.lang.String dimName, java.lang.String elName)
          Returns the level of the specified element within the given dimension
 int getElementParentCount(java.lang.String dbName, java.lang.String dimName, java.lang.String elName)
          Returns the number of parents the specified element has
 java.lang.String[] getElements(java.lang.String dbName, java.lang.String dimName)
          Returns the names of the elements which made up the specified dimension
 int getElementTopLevel(java.lang.String dbID, java.lang.String dimID)
          Deprecated. will be removed, please do not use anymore
 java.lang.String getExpireTime()
          Returns the time in seconds at when the session id is invalid
 java.lang.String[] getServerInfos()
          Returns information about the palo server.
 java.lang.String getSID()
          Returns the session id
 boolean isChild(java.lang.String dbID, java.lang.String dimID, java.lang.String elID, java.lang.String childID)
          Deprecated. will be removed, please do not use anymore
 boolean loadCube(java.lang.String dbName, java.lang.String cubeName)
          Loads the specified cube into memory
 boolean loadDatabase(java.lang.String dbName)
          Loads the given database
 void login(java.lang.String user, java.lang.String passw)
          Login the given user with the given password.
 boolean moveElement(java.lang.String dbName, java.lang.String dimName, java.lang.String elName, java.lang.String pos)
          Moves the specified element to the given position within its dimension
 boolean ping()
          Performs a ping to the palo server.
 void registerHandlers()
          Registers all known http handlers which carry out the communication
 boolean reloadServer()
          Reloads the complete server data
 boolean removeCube(java.lang.String dbName, java.lang.String cubeName)
          Removes the specified cube from the given database
 boolean removeDimension(java.lang.String dbName, java.lang.String dimName)
          Removes the specified dimension and its elements from the given database
 boolean removeElement(java.lang.String dbName, java.lang.String dimName, java.lang.String elName)
          Removes the specified element from its dimension
 boolean renameDimension(java.lang.String dbName, java.lang.String dimName, java.lang.String newName)
          Renames the specified dimension
 boolean renameElement(java.lang.String dbName, java.lang.String dimName, java.lang.String elName, java.lang.String newName)
          Renames the specified element
 boolean saveCube(java.lang.String dbName, java.lang.String cubeName)
          Saves the specified cube
 boolean saveDatabase(java.lang.String dbName)
          Saves the database
 boolean saveServer()
          Saves the current server state.
 java.lang.String send(java.lang.String request)
          Sends the given request string to the server.
 boolean setData(java.lang.String dbName, java.lang.String cubeName, java.lang.String path, java.lang.Object value, int splashMode)
          Sets the value of the specified cube cell.
 void setDataBulk(java.lang.String dbName, java.lang.String cubeName, java.lang.String[][] coordinates, java.lang.Object[] values, int splashMode)
          Sets the values of multiple cells at one time.
 void setDataNumeric(java.lang.String dbName, java.lang.String cubeName, int nCoordinates, java.lang.String[] coordinates, double value)
          Sets the double value of the given cube cell.
 void setDataNumeric(java.lang.String dbName, java.lang.String cubeName, int nCoordinates, java.lang.String[] coordinates, double value, int splashMode)
          Sets the double value of the given cube cell.
 void setDataString(java.lang.String dbName, java.lang.String cubeName, int nCoordinates, java.lang.String[] coordinates, java.lang.String value)
          Sets the String value of the given cube cell.
 boolean unloadCube(java.lang.String dbName, java.lang.String cubeName)
          Unoads the specified cube from memory
 boolean unloadDatabase(java.lang.String dbName)
          Unloads the given database from memory (it does not delete it from server)
 boolean updateElement(java.lang.String dbName, java.lang.String dimName, java.lang.String elName, java.lang.String type, java.lang.String childNames, java.lang.String weights)
          Updates the specified element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClient

public HttpClient(ConnectionHttp paloConn)
           throws java.net.UnknownHostException,
                  java.io.IOException
Creates a new HttpClient instance and connects to the palo server specified by the given ConnectionHttp instance.

Parameters:
paloConn - a ConnectionHttp object containing information about palo server
Throws:
java.net.UnknownHostException - if the IP address of the host could not be determined
java.io.IOException - if an I/O exception occurs on establishing the connection
Method Detail

registerHandlers

public final void registerHandlers()
Registers all known http handlers which carry out the communication


getDatabaseHandler

public final HttpDatabaseHandler getDatabaseHandler()
Returns the database handler which is responsible for the part of the http communication which deals with databases

Returns:
the registered HttpDatabaseHandler

getDimHandler

public final HttpDimensionHandler getDimHandler()
Returns the dimension handler which is responsible for the part of the http communication which deals with dimensions

Returns:
the registered HttpDimensionHandler

getCubeHandler

public final HttpCubeHandler getCubeHandler()
Returns the cube handler which is responsible for the part of the http communication which deals with cubes

Returns:
the registered HttpCubeHandler

getElementHandler

public final HttpElementHandler getElementHandler()
Returns the element handler which is responsible for the part of the http communication which deals with elements

Returns:
the registered HttpElementHandler

login

public final void login(java.lang.String user,
                        java.lang.String passw)
                 throws java.io.IOException
Login the given user with the given password. Note: the password has to be md5 encrypted

Parameters:
user - the login name
passw - the md5 encrypted password
Throws:
java.io.IOException

getSID

public final java.lang.String getSID()
Returns the session id

Returns:
the current valid session id

getExpireTime

public final java.lang.String getExpireTime()
Returns the time in seconds at when the session id is invalid

Returns:
the expire time in seconds since 1970-01-01 00:00:00 GMT

ping

public final boolean ping()
Performs a ping to the palo server. This will inform any registered listeners about changes of palo server data.

Returns:
true if ping was successful, false otherwise

disconnect

public final void disconnect()
                      throws java.io.IOException
Disconnects this client from the palo server

Throws:
java.io.IOException - if an I/O exception occurs

send

public final java.lang.String send(java.lang.String request)
                            throws java.io.IOException
Sends the given request string to the server. Note that all parameters have to be csv encoded

Parameters:
request - a request
Returns:
the answer string from the server
Throws:
java.io.IOException - if an I/O exception occurs

getDatabases

public final java.lang.String[] getDatabases()
                                      throws java.io.IOException
Returns an array of database names which are stored in the server so far

Returns:
the names of known databases
Throws:
java.io.IOException - if an I/O exception occurs

reloadServer

public final boolean reloadServer()
                           throws java.io.IOException
Reloads the complete server data

Returns:
true if reloading was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

saveServer

public final boolean saveServer()
                         throws java.io.IOException
Saves the current server state. Note: this will overwrite the previous server state

Returns:
true if saving was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

getServerInfos

public final java.lang.String[] getServerInfos()
                                        throws java.io.IOException
Returns information about the palo server. The information at index n is: at 0 the major version of the server at 1 the minor version of the server at 2 the bugfix level of the server at 3 the build number of the server

Returns:
an String array containing palo server information
Throws:
java.io.IOException - if an I/O exception occurs

getDatabaseInfos

public final java.lang.String[] getDatabaseInfos(java.lang.String dbName)
                                          throws java.io.IOException
Returns information about the specified database. The information at index n is: at 0 the database id at 1 the database name at 2 the number of dimensions in the database at 3 the number of cubes in the database at 4 the database status (0=unloaded, 1=loaded and 2=changed) at 5 the database type (0=normal, 1=system) at 6 the database token

Parameters:
dbName - a database name
Returns:
an String array containing the database information
Throws:
java.io.IOException - if an I/O exception occurs

getDimensionInfos

public final java.lang.String[] getDimensionInfos(java.lang.String dbName,
                                                  java.lang.String dimName)
                                           throws java.io.IOException
Returns information about the specified dimension. The information at index n is: at 0 the dimension id at 1 the dimension name at 2 the number of dimension elements at 3 the maximum level of the dimension at 4 the maximum indent of the dimension at 5 the maximum depth of the dimension at 6 the dimension type (0=normal, 1=system, 2=attribute) at 7 the dimension attribute id of a normal dimension or the id of the normal dimension associated to a attributes dimension. at 8 the attributes cube id (only for normal dimensions, i.e. type == 0) at 9 the rights cube id (only for normal dimensions, i.e. type == 0) at 10 the dimensions token

Parameters:
dbName - the name of a database which contains the dimension
dimName - a dimension name
Returns:
an String array containing the dimension information
Throws:
java.io.IOException - if an I/O exception occurs

getCubeInfos

public final java.lang.String[] getCubeInfos(java.lang.String dbName,
                                             java.lang.String cubeName)
                                      throws java.io.IOException
Returns information about the specified cube. The information at index n is: at 0 the cube id at 1 the cube name at 2 the number of dimensions at 3 a comma separate list of dimension identifiers at 4 the total number of cells at 5 the number of filled cells at 6 the cube status (0=unloaded, 1=loaded and 2=changed) at 7 the cube type (0=normal, 1=system, 2=attribute) at 8 the cube token

Parameters:
dbName - the name of a database which contains the cube
cubeName - a cube name
Returns:
an String array containing the cube information
Throws:
java.io.IOException - if an I/O exception occurs

getElementInfos

public final java.lang.String[] getElementInfos(java.lang.String dbName,
                                                java.lang.String dimName,
                                                java.lang.String elName)
                                         throws java.io.IOException
Returns information about the specified element. The information at index n is: at 0 the element id at 1 the element name at 2 the element position within its dimension at 3 the element level at 4 the element indent at 5 the element depth at 6 the element type (1=NUMERIC, 2=STRING, 4=CONSOLIDATED) at 7 the number of parents at 8 a comma separate list of parent identifiers at 9 the number of children at 10 a comma separate list of children identifiers at 11 a comma separate list of children weight

Parameters:
dbName - the name of a database which contains the dimension
dimName - the name of a dimension which contains the element
elName - the element name
Returns:
an String array containing the element information
Throws:
java.io.IOException - if an I/O exception occurs

saveDatabase

public final boolean saveDatabase(java.lang.String dbName)
                           throws java.io.IOException
Saves the database

Parameters:
dbName - the name of the database
Returns:
true if saving was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

addDatabase

public final java.lang.String addDatabase(java.lang.String dbName)
                                   throws java.io.IOException
Creates a new database with the given name and adds it to the server

Parameters:
dbName - the name of the database
Returns:
the id of the new database
Throws:
java.io.IOException - if an I/O exception occurs

loadDatabase

public final boolean loadDatabase(java.lang.String dbName)
                           throws java.io.IOException
Loads the given database

Parameters:
dbName - the name of the database
Returns:
true if loading was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

unloadDatabase

public final boolean unloadDatabase(java.lang.String dbName)
                             throws java.io.IOException
Unloads the given database from memory (it does not delete it from server)

Parameters:
dbName - the name of the database
Returns:
true if unloading was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

deleteDatabase

public final boolean deleteDatabase(java.lang.String dbName)
                             throws java.io.IOException
Removes the given database and its dimensions and cubes from the palo server

Parameters:
dbName - the name of the database
Returns:
true if deleting was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

addDimension

public final boolean addDimension(java.lang.String dbName,
                                  java.lang.String dimName)
                           throws java.io.IOException
Creates and adds the specified dimension to the given database

Parameters:
dbName - the name of the database
dimName - the name of the dimension
Returns:
true if creating and adding was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

removeDimension

public final boolean removeDimension(java.lang.String dbName,
                                     java.lang.String dimName)
                              throws java.io.IOException
Removes the specified dimension and its elements from the given database

Parameters:
dbName - the name of the database
dimName - the name of the dimension
Returns:
true if removing was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

getDimensions

public final java.lang.String[] getDimensions(java.lang.String dbName)
                                       throws java.io.IOException
Returns the names of the dimensions which are saved within the given database

Parameters:
dbName - a valid database name
Returns:
an String array containing all known dimension names
Throws:
java.io.IOException - if an I/O exception occurs

getDimensionsFromCube

public final java.lang.String[] getDimensionsFromCube(java.lang.String dbName,
                                                      java.lang.String cubeName)
                                               throws java.io.IOException
Returns the names of the dimensions which build up the specified cube

Parameters:
dbName - a valid database name
cubeName - the name of the cube
Returns:
an String array containing the dimension names
Throws:
java.io.IOException - if an I/O exception occurs

renameDimension

public final boolean renameDimension(java.lang.String dbName,
                                     java.lang.String dimName,
                                     java.lang.String newName)
                              throws java.io.IOException
Renames the specified dimension

Parameters:
dbName - a valid database name
dimName - the old dimension name
newName - the new dimension name
Returns:
true if renaming was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

clearDimension

public final boolean clearDimension(java.lang.String dbName,
                                    java.lang.String dimName)
                             throws java.io.IOException
Clears the specified dimension, i.e. all its elements are removed and all associated cubes are cleared as well.

Parameters:
dbName - a valid database name
dimName - the dimension name
Returns:
true if clearing was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

addCube

public final boolean addCube(java.lang.String dbName,
                             java.lang.String name,
                             java.lang.String dimNames)
                      throws java.io.IOException
Creates and adds the specified cube to the given database

Parameters:
dbName - a valid database name
name - the cube name
dimNames - the comma separated names of the dimensions which build up the cube
Returns:
true if creating and adding was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

removeCube

public final boolean removeCube(java.lang.String dbName,
                                java.lang.String cubeName)
                         throws java.io.IOException
Removes the specified cube from the given database

Parameters:
dbName - a valid database name
cubeName - the cube name
Returns:
true if removing was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

saveCube

public final boolean saveCube(java.lang.String dbName,
                              java.lang.String cubeName)
                       throws java.io.IOException
Saves the specified cube

Parameters:
dbName - a valid database name
cubeName - the cube name
Returns:
true if saving was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

getCubes

public final java.lang.String[] getCubes(java.lang.String dbName)
                                  throws java.io.IOException
Returns the names of the cubes which are saved within the given database

Parameters:
dbName - a valid database name
Returns:
an String array containing the names of all known cubes
Throws:
java.io.IOException - if an I/O exception occurs

getCubesFromDimension

public final java.lang.String[] getCubesFromDimension(java.lang.String dbName,
                                                      java.lang.String dimName)
                                               throws java.io.IOException
Returns the names of the cubes which are associated to the given dimension

Parameters:
dbName - a valid database name
dimName - the dimension name
Returns:
an String array containing the names of all known cubes associated with the dimension
Throws:
java.io.IOException - if an I/O exception occurs

loadCube

public final boolean loadCube(java.lang.String dbName,
                              java.lang.String cubeName)
                       throws java.io.IOException
Loads the specified cube into memory

Parameters:
dbName - a valid database name
cubeName - the cube name
Returns:
true if loading was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

unloadCube

public final boolean unloadCube(java.lang.String dbName,
                                java.lang.String cubeName)
                         throws java.io.IOException
Unoads the specified cube from memory

Parameters:
dbName - a valid database name
cubeName - the cube name
Returns:
true if unloading was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

getElements

public final java.lang.String[] getElements(java.lang.String dbName,
                                            java.lang.String dimName)
                                     throws java.io.IOException
Returns the names of the elements which made up the specified dimension

Parameters:
dbName - a valid database name
dimName - a valid dimension name
Returns:
an String array containing the names of the elements within the dimension
Throws:
java.io.IOException - if an I/O exception occurs

addElement

public final boolean addElement(java.lang.String dbName,
                                java.lang.String dimName,
                                java.lang.String name,
                                java.lang.String type,
                                java.lang.String childNames,
                                java.lang.String weights)
                         throws java.io.IOException
Creates and adds the specified element to the given dimension

Parameters:
dbName - a valid database name
dimName - a valid dimension name
name - the element name
type - the element type
childNames - a comma separated list of children names
weights - a comma separated list of weights associated with the children
Returns:
true if creating and adding was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

removeElement

public final boolean removeElement(java.lang.String dbName,
                                   java.lang.String dimName,
                                   java.lang.String elName)
                            throws java.io.IOException
Removes the specified element from its dimension

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - the element name
Returns:
true if removing was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

updateElement

public final boolean updateElement(java.lang.String dbName,
                                   java.lang.String dimName,
                                   java.lang.String elName,
                                   java.lang.String type,
                                   java.lang.String childNames,
                                   java.lang.String weights)
                            throws java.io.IOException
Updates the specified element. Note: if the element does not exist within the dimension it is created.

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - the element name
type - the element type
childNames - a comma separated list of children names
weights - a comma separated list of weights associated with the children
Returns:
true if updating was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

renameElement

public final boolean renameElement(java.lang.String dbName,
                                   java.lang.String dimName,
                                   java.lang.String elName,
                                   java.lang.String newName)
                            throws java.io.IOException
Renames the specified element

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - the old element name
newName - the new element name
Returns:
true if renaming was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

getElementChildCount

public final int getElementChildCount(java.lang.String dbName,
                                      java.lang.String dimName,
                                      java.lang.String elName)
                               throws java.io.IOException
Returns the number of children the specified element has

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - a valid element name
Returns:
the number of children of given element
Throws:
java.io.IOException - if an I/O exception occurs

getElementParentCount

public final int getElementParentCount(java.lang.String dbName,
                                       java.lang.String dimName,
                                       java.lang.String elName)
                                throws java.io.IOException
Returns the number of parents the specified element has

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - a valid element name
Returns:
the number of parents
Throws:
java.io.IOException - if an I/O exception occurs

getElementCount

public final int getElementCount(java.lang.String dbName,
                                 java.lang.String dimName)
                          throws java.io.IOException
Returns the number of elements the specified dimension has

Parameters:
dbName - a valid database name
dimName - a valid dimension name
Returns:
the number of elements
Throws:
java.io.IOException - if an I/O exception occurs

getElementIndex

public final int getElementIndex(java.lang.String dbName,
                                 java.lang.String dimName,
                                 java.lang.String elName)
                          throws java.io.IOException
Returns the position of the specified element within the given dimension

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - a valid element name
Returns:
the position of the element within its dimension
Throws:
java.io.IOException - if an I/O exception occurs

getElementLevel

public final int getElementLevel(java.lang.String dbName,
                                 java.lang.String dimName,
                                 java.lang.String elName)
                          throws java.io.IOException
Returns the level of the specified element within the given dimension

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - a valid element name
Returns:
the element level
Throws:
java.io.IOException - if an I/O exception occurs

getElementIndent

public final int getElementIndent(java.lang.String dbName,
                                  java.lang.String dimName,
                                  java.lang.String elName)
                           throws java.io.IOException
Returns the indent of the specified element within the given dimension

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - a valid element name
Returns:
the element indent
Throws:
java.io.IOException - if an I/O exception occurs

moveElement

public final boolean moveElement(java.lang.String dbName,
                                 java.lang.String dimName,
                                 java.lang.String elName,
                                 java.lang.String pos)
                          throws java.io.IOException
Moves the specified element to the given position within its dimension

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - a valid element name
pos - the new element position
Returns:
true if moving was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

getElementTopLevel

public final int getElementTopLevel(java.lang.String dbID,
                                    java.lang.String dimID)
Deprecated. will be removed, please do not use anymore

Parameters:
dbID -
dimID -
Returns:

isChild

public final boolean isChild(java.lang.String dbID,
                             java.lang.String dimID,
                             java.lang.String elID,
                             java.lang.String childID)
Deprecated. will be removed, please do not use anymore

Parameters:
dbID -
dimID -
elID -
childID -
Returns:

getData

public final java.lang.Object getData(java.lang.String dbName,
                                      java.lang.String cubeName,
                                      int coordsCount,
                                      java.lang.String[] coords)
                               throws java.io.IOException
Receives the value at the given cube cell. The coordinates are simply the element names which has to be specified in the same order as their dimensions are.

Parameters:
dbName - a valid database name
cubeName - a valid cube name
coordsCount - the number of coordinates
coords - the coordinates which determines the cube cell
Returns:
the value of the cube cell
Throws:
java.io.IOException - if an I/O exception occurs

getDataArea

public final java.lang.Object[] getDataArea(java.lang.String dbName,
                                            java.lang.String cubeName,
                                            java.lang.String[][] elNames)
                                     throws java.io.IOException
A convenient method to receive the values of multiple cube cells.

Parameters:
dbName - a valid database name
cubeName - a valid cube name
elNames - the element names which specify the cube cells
Returns:
the values of the cube cells
Throws:
java.io.IOException - if an I/O exception occurs

setDataString

public final void setDataString(java.lang.String dbName,
                                java.lang.String cubeName,
                                int nCoordinates,
                                java.lang.String[] coordinates,
                                java.lang.String value)
                         throws java.io.IOException
Sets the String value of the given cube cell. The coordinates are simply the element names which has to be specified in the same order as their dimensions are.

Parameters:
dbName - a valid database name
cubeName - a valid cube name
nCoordinates - the number of coordinates
coordinates - the coordinates which determines the cube cell
value - the new cell String value
Throws:
java.io.IOException - if an I/O exception occurs

setDataNumeric

public final void setDataNumeric(java.lang.String dbName,
                                 java.lang.String cubeName,
                                 int nCoordinates,
                                 java.lang.String[] coordinates,
                                 double value)
                          throws java.io.IOException
Sets the double value of the given cube cell. The coordinates are simply the element names which has to be specified in the same order as their dimensions are.

Parameters:
dbName - a valid database name
cubeName - a valid cube name
nCoordinates - the number of coordinates
coordinates - the coordinates which determines the cube cell
value - the new cell double value
Throws:
java.io.IOException - if an I/O exception occurs

setDataNumeric

public final void setDataNumeric(java.lang.String dbName,
                                 java.lang.String cubeName,
                                 int nCoordinates,
                                 java.lang.String[] coordinates,
                                 double value,
                                 int splashMode)
                          throws java.io.IOException
Sets the double value of the given cube cell. The splashMode paramater is only important for consolidated cells and determines how the value is spread among the consolidated elements. Please use the defined class constants for valid values. Although more modes are currently defined only three are supported, namely: SPLASH_MODE_DEFAULT, SPLASH_MODE_BASE_SET and SPLASH_MODE_BASE_ADD

Parameters:
dbName - a valid database name
cubeName - a valid cube name
nCoordinates - the number of coordinates
coordinates - the coordinates which determines the cube cell
value - the new cell double value
splashMode - the splash mode, please refer to IConnection
Throws:
java.io.IOException - if an I/O exception occurs

setDataBulk

public final void setDataBulk(java.lang.String dbName,
                              java.lang.String cubeName,
                              java.lang.String[][] coordinates,
                              java.lang.Object[] values,
                              int splashMode)
                       throws java.io.IOException
Sets the values of multiple cells at one time. The splashMode parameter defines how the value is spread among consolidated elements.

Parameters:
dbName - a valid database name
cubeName - a valid cube name
coordinates - the cell coordinates, please see setDataString(String, String, int, String[], String)
values - the new cell values
splashMode - the splash mode, please refer to IConnection
Throws:
java.io.IOException - if an I/O exception occurs

setData

public final boolean setData(java.lang.String dbName,
                             java.lang.String cubeName,
                             java.lang.String path,
                             java.lang.Object value,
                             int splashMode)
                      throws java.io.IOException
Sets the value of the specified cube cell.

Parameters:
dbName - a valid database name
cubeName - a valid cube name
path - a comma separated list of element names
value - the new cell value
splashMode - the splash mode, please refer to IConnection
Returns:
true if setting was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs

getDimElementInfos

public final DimElementInfo[] getDimElementInfos(java.lang.String dbName,
                                                 java.lang.String dimName)
                                          throws java.io.IOException
Returns the DimElementInfos associated with the specified dimension

Parameters:
dbName - a valid database name
dimName - a valid dimension name
Returns:
an DimElementInfo array
Throws:
java.io.IOException - if an I/O exception occurs

getConsolidationInfos

public final ConsolidationInfo[] getConsolidationInfos(java.lang.String dbName,
                                                       java.lang.String dimName,
                                                       java.lang.String elName)
                                                throws java.io.IOException
Returns the ConsolidationInfos associated with the specified element

Parameters:
dbName - a valid database name
dimName - a valid dimension name
elName - a valid element name
Returns:
an ConsolidationInfo array
Throws:
java.io.IOException - if an I/O exception occurs

ensureConnection

public final void ensureConnection()
                            throws java.io.IOException
Checks if the session id is still valid. If it is going to expire soon, a new login is performed to update the sid

Throws:
java.io.IOException
java.security.NoSuchAlgorithmException