com.tensegrity.palojava
Interface IConnection

All Known Implementing Classes:
ConnectionHttp

public interface IConnection

Represents the internal used Connection class as an interface so that it could be implemented from others as well Currently this is used to support the new palo server version, based on the http protocol, as well as the legacy server.

NOTE: this class is for internal use only

Version:
$Id$
Author:
ArndHouben

Field Summary
static int ADDORUPDATE_MODE_ADD
           
static int ADDORUPDATE_MODE_ADD_OR_UPDATE
           
static int ADDORUPDATE_MODE_FORCE_ADD
           
static int ADDORUPDATE_MODE_UPDATE
           
static java.lang.String ELEMENTINDEX_OUTOFBOUNDS
           
static java.lang.String NOT_CONNECTED
           
static int SPLASH_MODE_BASE_ADD
          adds the new value to the values of the consolidated elements
static int SPLASH_MODE_BASE_SET
          set the value as the new value of the consolidated elements
static int SPLASH_MODE_DEFAULT
          recompute the values of the consolidated elements
static int SPLASH_MODE_DISABLED
           
static int SPLASH_MODE_UNKNOWN
           
 
Method Summary
 void addDatabase(java.lang.String database)
          Adds the given database.
 void clearDimension(java.lang.String database, java.lang.String dimension)
          Clears the specified dimension.
 void cubeCommitLog(java.lang.String database, java.lang.String cube)
          Deprecated. not required anymore
 java.lang.String[] cubeListDimensions(java.lang.String database, java.lang.String cube)
          Receives the dimension names of the specified cube.
 void cubeLoad(java.lang.String database, java.lang.String cube)
          Loads the cube data into memory.
 void databaseAddCube(java.lang.String database, java.lang.String cube, java.lang.String[] dimensions)
          Adds a new cube with the given name and the specified dimensions
 void databaseAddDimension(java.lang.String database, java.lang.String dimension)
          Adds a new dimension to the database
 java.lang.String[] databaseListCubes(java.lang.String database)
          Receives the cube names of the specified database
 java.lang.String[] databaseListDimensions(java.lang.String database)
          Receives the dimension names of the specified database
 void databaseLoad(java.lang.String database)
          Loads the given database.
 void databaseRenameDimension(java.lang.String database, java.lang.String dimensionOldname, java.lang.String dimensionNewname)
          Renames a dimension
 void databaseSave(java.lang.String database)
          Saves the specified database.
 void deleteCube(java.lang.String database, java.lang.String cube)
          Deletes the given cube.
 void deleteDatabase(java.lang.String database)
          Deletes the given database.
 void deleteDimension(java.lang.String database, java.lang.String dimension)
          Deletes the specified dimension
 void dimElementDelete(java.lang.String database, java.lang.String dimension, java.lang.String element)
          Deletes the specified element from its dimension
 ConsolidationInfo[] dimElementListConsolidated(java.lang.String database, java.lang.String dimension, java.lang.String element)
          Receives the conoslidation informations about the specified element.
 void dimElementMove(java.lang.String database, java.lang.String dimension, java.lang.String element, int newPosition)
          Moves the given element to the specified position within its dimension.
 void dimElementRename(java.lang.String database, java.lang.String dimension, java.lang.String element, java.lang.String newName)
          Renames the given element
 void dimensionAddOrUpdateDimElement(java.lang.String database, java.lang.String dimension, java.lang.String element, int addOrUpdateMode, int dimElementType, ConsolidationInfo[] ci, boolean append)
          Adds or update the given element.
 void dimensionCommitLog(java.lang.String database, java.lang.String dimension)
          Deprecated. not required anymore
 java.lang.String[] dimensionListCubes(java.lang.String database, java.lang.String dimension)
          Receives the cube names of the specified dimension.
 DimElementInfo[] dimensionListDimElements(java.lang.String database, java.lang.String dimension)
          Receives the dimension elements of the specified dimension.
 void dimensionProcess(java.lang.String database, java.lang.String dimension)
          Deprecated. not required anymore
 void disconnect()
          Disconnects from the palo server
 int elementChildCount(java.lang.String database, java.lang.String dimension, java.lang.String element)
          Returns the number of children for the specified element.
 int elementCount(java.lang.String database, java.lang.String dimension)
          Returns the number of elements for the specified dimension.
 int elementIndent(java.lang.String database, java.lang.String dimension, java.lang.String element)
          Returns the indent of the given element.
 int elementIndex(java.lang.String database, java.lang.String dimension, java.lang.String element)
          Returns the index of the specified element within its dimension.
 int elementIsChild(java.lang.String database, java.lang.String dimension, java.lang.String parent, java.lang.String child)
          Deprecated. not required anymore
 int elementLevel(java.lang.String database, java.lang.String dimension, java.lang.String element)
          Deprecated. not required anymore
 java.lang.String elementName(java.lang.String database, java.lang.String dimension, int n)
          Returns the name of the element at the given position within the specified dimension
 int elementParentCount(java.lang.String database, java.lang.String dimension, java.lang.String element)
          Returns the number of parents for the specified element.
 int elementTopLevel(java.lang.String database, java.lang.String dimension)
          Deprecated. not required anymore
 int elementType(java.lang.String database, java.lang.String dimension, int n)
          Returns the type of the element at the given position within the specified dimension
 java.lang.Object getData(java.lang.String database, java.lang.String cube, int nCoordinates, java.lang.String[] coordinates)
          Returns the value of the cell which is determined by the given coordinates.
 java.lang.Object[] getDataArea(java.lang.String database, java.lang.String cube, java.lang.String[][] elements)
          Convenient method to receive multiple cell values at one time.
 java.lang.String getPassword()
          Returns the login password
 java.lang.String getServer()
          Returns the server name which hosts the palo server, e.g. localhost
 java.lang.String getService()
          Returns the port number
 java.lang.String getUsername()
          Returns the login name
 boolean isConnected()
          Returns true if a connection to the server is established, false otherwise
 void ping()
          Tests if the palo server is still reachable
 java.lang.String[] rootListDatabases()
          Returns the names of the databases of the palo server
 void rootSave()
          Saves the server data, i.e. its database names
 void setDataBulk(java.lang.String database, java.lang.String cube, java.lang.String[][] coordinates, java.lang.Object[] values, int splashMode)
          Convenient method to set multiple cell values at one time.
 void setDataNumeric(java.lang.String database, java.lang.String cube, int nCoordinates, java.lang.String[] coordinates, double value)
          Sets the given double value at the specified cell getData(String, String, int, String[])
 void setDataNumericSplashed(java.lang.String database, java.lang.String cube, int nCoordinates, java.lang.String[] coordinates, double value, int splashMode)
          Sets the given double value at the specified cell.
 void setDataString(java.lang.String database, java.lang.String cube, int nCoordinates, java.lang.String[] coordinates, java.lang.String value)
          Sets the given String value at the specified cell getData(String, String, int, String[])
 void unloadCube(java.lang.String database, java.lang.String cube)
          Unloads the cube data from memory.
 void unloadDatabase(java.lang.String database)
          Unloads the specified database from memory.
 void unloadDimension(java.lang.String database, java.lang.String dimension)
          Deprecated.  
 

Field Detail

NOT_CONNECTED

static final java.lang.String NOT_CONNECTED
See Also:
Constant Field Values

ELEMENTINDEX_OUTOFBOUNDS

static final java.lang.String ELEMENTINDEX_OUTOFBOUNDS
See Also:
Constant Field Values

ADDORUPDATE_MODE_ADD

static final int ADDORUPDATE_MODE_ADD
See Also:
Constant Field Values

ADDORUPDATE_MODE_FORCE_ADD

static final int ADDORUPDATE_MODE_FORCE_ADD
See Also:
Constant Field Values

ADDORUPDATE_MODE_UPDATE

static final int ADDORUPDATE_MODE_UPDATE
See Also:
Constant Field Values

ADDORUPDATE_MODE_ADD_OR_UPDATE

static final int ADDORUPDATE_MODE_ADD_OR_UPDATE
See Also:
Constant Field Values

SPLASH_MODE_DISABLED

static final int SPLASH_MODE_DISABLED
See Also:
Constant Field Values

SPLASH_MODE_UNKNOWN

static final int SPLASH_MODE_UNKNOWN
See Also:
Constant Field Values

SPLASH_MODE_DEFAULT

static final int SPLASH_MODE_DEFAULT
recompute the values of the consolidated elements

See Also:
Constant Field Values

SPLASH_MODE_BASE_SET

static final int SPLASH_MODE_BASE_SET
set the value as the new value of the consolidated elements

See Also:
Constant Field Values

SPLASH_MODE_BASE_ADD

static final int SPLASH_MODE_BASE_ADD
adds the new value to the values of the consolidated elements

See Also:
Constant Field Values
Method Detail

getServer

java.lang.String getServer()
Returns the server name which hosts the palo server, e.g. localhost

Returns:
the name of the palo server host

getService

java.lang.String getService()
Returns the port number

Returns:
port number

getUsername

java.lang.String getUsername()
Returns the login name

Returns:
login name

getPassword

java.lang.String getPassword()
Returns the login password

Returns:
login password

isConnected

boolean isConnected()
Returns true if a connection to the server is established, false otherwise

Returns:
true if a connection is established, false otherwise

disconnect

void disconnect()
                throws PaloException
Disconnects from the palo server

Throws:
PaloException - if an communication exception occurs

ping

void ping()
          throws PaloException
Tests if the palo server is still reachable

Throws:
PaloException - if palo server is not reachable anymore

rootListDatabases

java.lang.String[] rootListDatabases()
Returns the names of the databases of the palo server

Returns:
the database names

databaseListCubes

java.lang.String[] databaseListCubes(java.lang.String database)
Receives the cube names of the specified database

Parameters:
database - a database name
Returns:
its cube names

databaseListDimensions

java.lang.String[] databaseListDimensions(java.lang.String database)
Receives the dimension names of the specified database

Parameters:
database - a database name
Returns:
its dimension names

cubeListDimensions

java.lang.String[] cubeListDimensions(java.lang.String database,
                                      java.lang.String cube)
Receives the dimension names of the specified cube.

Parameters:
database - the name of a database which contains the cube
cube - a cube name
Returns:
the dimension names the specified cube consists of

dimensionListCubes

java.lang.String[] dimensionListCubes(java.lang.String database,
                                      java.lang.String dimension)
Receives the cube names of the specified dimension.

Parameters:
database - the name of a database which contains the dimension
dimension - a dimension name
Returns:
the names of cubes which use the specified dimension

dimensionListDimElements

DimElementInfo[] dimensionListDimElements(java.lang.String database,
                                          java.lang.String dimension)
Receives the dimension elements of the specified dimension.

Parameters:
database - the name of a database which contains the dimension
dimension - the dimension name
Returns:
the dimension elements as an DimElementInfo array

dimElementListConsolidated

ConsolidationInfo[] dimElementListConsolidated(java.lang.String database,
                                               java.lang.String dimension,
                                               java.lang.String element)
Receives the conoslidation informations about the specified element.

Parameters:
database - the name of a database which contains the dimension
dimension - the dimension name which contains the element
element - the name of an element
Returns:
the consolidation infos as ConsolidationInfo array

elementChildCount

int elementChildCount(java.lang.String database,
                      java.lang.String dimension,
                      java.lang.String element)
Returns the number of children for the specified element.

Parameters:
database - the name of a database which contains the dimension
dimension - the dimension name which contains the element
element - the name of an element
Returns:
the number of children the specified element has

elementParentCount

int elementParentCount(java.lang.String database,
                       java.lang.String dimension,
                       java.lang.String element)
Returns the number of parents for the specified element.

Parameters:
database - the name of a database which contains the dimension
dimension - the dimension name which contains the element
element - the name of an element
Returns:
the number of parents the specified element has

elementCount

int elementCount(java.lang.String database,
                 java.lang.String dimension)
Returns the number of elements for the specified dimension.

Parameters:
database - the name of a database which contains the dimension
dimension - a dimension name
Returns:
the number of elements the specified dimension has

elementIndex

int elementIndex(java.lang.String database,
                 java.lang.String dimension,
                 java.lang.String element)
Returns the index of the specified element within its dimension.

Parameters:
database - the name of a database which contains the dimension
dimension - the dimension name which contains the element
element - the name of an element
Returns:
the number of parents the specified element has

elementIsChild

int elementIsChild(java.lang.String database,
                   java.lang.String dimension,
                   java.lang.String parent,
                   java.lang.String child)
Deprecated. not required anymore

Parameters:
database -
dimension -
parent -
child -
Returns:

elementLevel

int elementLevel(java.lang.String database,
                 java.lang.String dimension,
                 java.lang.String element)
Deprecated. not required anymore

Parameters:
database -
dimension -
element -
Returns:

elementIndent

int elementIndent(java.lang.String database,
                  java.lang.String dimension,
                  java.lang.String element)
Returns the indent of the given element. Note: parents have a lower indent as their children. The indent is usefull to arrange element representations within a gui.

Parameters:
database - the name of a database which contains the dimension
dimension - the name of the dimension which contains the element
element - the element name
Returns:
the element indent

elementTopLevel

int elementTopLevel(java.lang.String database,
                    java.lang.String dimension)
Deprecated. not required anymore

Parameters:
database -
dimension -
Returns:

elementName

java.lang.String elementName(java.lang.String database,
                             java.lang.String dimension,
                             int n)
Returns the name of the element at the given position within the specified dimension

Parameters:
database - the name of a database which contains the dimension
dimension - the dimension name which contains the element
n - the element position
Returns:
the name of the element

elementType

int elementType(java.lang.String database,
                java.lang.String dimension,
                int n)
Returns the type of the element at the given position within the specified dimension

Parameters:
database - the name of a database which contains the dimension
dimension - the dimension name which contains the element
n - the element position
Returns:
the type of the element

getData

java.lang.Object getData(java.lang.String database,
                         java.lang.String cube,
                         int nCoordinates,
                         java.lang.String[] coordinates)
                         throws PaloException
Returns the value of the cell which is determined by the given coordinates. The coordinates consists of Element names from the Dimensions which made up the cube. It is important to specifiy the elements in the same order as the dimensions are within the cube.

Parameters:
database - the name of a database which contains the cube
cube - a cube name
nCoordinates - number of coordinates
coordinates - the element names
Returns:
the cell value
Throws:
PaloException - if an exception occurs during the communication with the palo server

getDataArea

java.lang.Object[] getDataArea(java.lang.String database,
                               java.lang.String cube,
                               java.lang.String[][] elements)
                               throws PaloException
Convenient method to receive multiple cell values at one time. getData(String, String, int, String[])

Parameters:
database - the name of a database which contains the cube
cube - a cube name
elements - two dimensional array of element coordinates
Returns:
the values of the cells which correspond to the given coordinates
Throws:
PaloException - if an exception occurs during the communication with the palo server

setDataString

void setDataString(java.lang.String database,
                   java.lang.String cube,
                   int nCoordinates,
                   java.lang.String[] coordinates,
                   java.lang.String value)
                   throws PaloException
Sets the given String value at the specified cell getData(String, String, int, String[])

Parameters:
database - the name of a database which contains the cube
cube - a cube name
nCoordinates - number of coordinates
coordinates - the element names
value - the new value
Throws:
PaloException - if an exception occurs during the communication with the palo server

setDataNumeric

void setDataNumeric(java.lang.String database,
                    java.lang.String cube,
                    int nCoordinates,
                    java.lang.String[] coordinates,
                    double value)
                    throws PaloException
Sets the given double value at the specified cell getData(String, String, int, String[])

Parameters:
database - the name of a database which contains the cube
cube - a cube name
nCoordinates - number of coordinates
coordinates - the element names
value - the new value
Throws:
PaloException - if an exception occurs during the communication with the palo server

setDataNumericSplashed

void setDataNumericSplashed(java.lang.String database,
                            java.lang.String cube,
                            int nCoordinates,
                            java.lang.String[] coordinates,
                            double value,
                            int splashMode)
                            throws PaloException
Sets the given double value at the specified cell. The splashMode paramater is only important for consolidated cells and determines how the value is scattered 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:
database - the name of a database which contains the cube
cube - a cube name
nCoordinates - number of coordinates
coordinates - the element names
value - the new value
splashMode - the splash mode, use defined class constants
Throws:
PaloException - if an exception occurs during the communication with the palo server

setDataBulk

void setDataBulk(java.lang.String database,
                 java.lang.String cube,
                 java.lang.String[][] coordinates,
                 java.lang.Object[] values,
                 int splashMode)
                 throws PaloException
Convenient method to set multiple cell values at one time. setDataNumericSplashed(String, String, int, String[], double, int)

Parameters:
database - the name of a database which contains the cube
cube - a cube name
coordinates - the coordinates of the cells
value - the new values
splashMode - the splash mode, use defined class constants
Throws:
PaloException - if an exception occurs during the communication with the palo server

addDatabase

void addDatabase(java.lang.String database)
Adds the given database. Note: the database name has to be unique

Parameters:
database - name of the new database.

unloadDatabase

void unloadDatabase(java.lang.String database)
Unloads the specified database from memory.

Parameters:
database - name of the database

deleteDatabase

void deleteDatabase(java.lang.String database)
Deletes the given database.

Parameters:
database - name of the database.

unloadDimension

void unloadDimension(java.lang.String database,
                     java.lang.String dimension)
Deprecated. 

Unloads the specified dimension from memory.

Parameters:
database - the database name which contains the dimenions
dimension - the dimension name

deleteDimension

void deleteDimension(java.lang.String database,
                     java.lang.String dimension)
Deletes the specified dimension

Parameters:
database - the database name which contains the dimenions
dimension - the dimension name

clearDimension

void clearDimension(java.lang.String database,
                    java.lang.String dimension)
Clears the specified dimension. This means that all its elements are removed and that all associated cubes are cleared too.

Parameters:
database - the database name which contains the dimenions
dimension - the dimension name

databaseAddCube

void databaseAddCube(java.lang.String database,
                     java.lang.String cube,
                     java.lang.String[] dimensions)
Adds a new cube with the given name and the specified dimensions

Parameters:
database - name of the database to add the cube to
cube - the cube name
dimensions - the dimension names

databaseAddDimension

void databaseAddDimension(java.lang.String database,
                          java.lang.String dimension)
Adds a new dimension to the database

Parameters:
database - name of the database to add the dimension to
dimensionthe - dimension name

databaseRenameDimension

void databaseRenameDimension(java.lang.String database,
                             java.lang.String dimensionOldname,
                             java.lang.String dimensionNewname)
Renames a dimension

Parameters:
database - name of the database which contains the dimension
dimensionOldname - old dimension name
dimensionNewname - new dimension name

dimensionAddOrUpdateDimElement

void dimensionAddOrUpdateDimElement(java.lang.String database,
                                    java.lang.String dimension,
                                    java.lang.String element,
                                    int addOrUpdateMode,
                                    int dimElementType,
                                    ConsolidationInfo[] ci,
                                    boolean append)
Adds or update the given element.

Parameters:
database - name of the database which contains the dimension
dimension - name of the dimension which contains the element
element - the element name
addOrUpdateMode - one of the defined add or update mode constants
dimElementType - a valid element type
ci - ConsolidatioInfos if any
append -

dimElementRename

void dimElementRename(java.lang.String database,
                      java.lang.String dimension,
                      java.lang.String element,
                      java.lang.String newName)
Renames the given element

Parameters:
database - name of the database which contains the dimension
dimension - name of the dimension which contains the element
element - old element name
newName - new element name

dimElementMove

void dimElementMove(java.lang.String database,
                    java.lang.String dimension,
                    java.lang.String element,
                    int newPosition)
Moves the given element to the specified position within its dimension.

Parameters:
database - name of the database which contains the dimension
dimension - name of the dimension which contains the element
element - name of the element which should be moved
newPosition - the new element position

dimElementDelete

void dimElementDelete(java.lang.String database,
                      java.lang.String dimension,
                      java.lang.String element)
Deletes the specified element from its dimension

Parameters:
database - name of the database which contains the dimension
dimension - name of the dimension which contains the element
element - name of the element which should be deleted

cubeLoad

void cubeLoad(java.lang.String database,
              java.lang.String cube)
Loads the cube data into memory.

Parameters:
database - name of the database which contains the cube
cube - the cube name

databaseLoad

void databaseLoad(java.lang.String database)
Loads the given database. For loading a cube please use cubeLoad(String, String)

Parameters:
database - name of the database to load

cubeCommitLog

void cubeCommitLog(java.lang.String database,
                   java.lang.String cube)
Deprecated. not required anymore

Commits the cube log.

Parameters:
database - name of the database which contains the cube
cube - the cube name

databaseSave

void databaseSave(java.lang.String database)
Saves the specified database.

Parameters:
database - name of the database to save

rootSave

void rootSave()
Saves the server data, i.e. its database names


dimensionProcess

void dimensionProcess(java.lang.String database,
                      java.lang.String dimension)
Deprecated. not required anymore

(Re)loads the given dimension.

Parameters:
database - name of the database which contains the dimension
dimension - the dimension name

unloadCube

void unloadCube(java.lang.String database,
                java.lang.String cube)
Unloads the cube data from memory.

Parameters:
database - name of the database which contains the cube
cube - the cube name

deleteCube

void deleteCube(java.lang.String database,
                java.lang.String cube)
Deletes the given cube.

Parameters:
database - name of the database which contains the cube
cube - the cube name

dimensionCommitLog

void dimensionCommitLog(java.lang.String database,
                        java.lang.String dimension)
Deprecated. not required anymore

Commits the dimension log.

Parameters:
database - name of the database which contains the dimension
dimension - the dimension name