com.tensegrity.palojava.http.handlers
Class HttpDimensionHandler

java.lang.Object
  extended by com.tensegrity.palojava.http.handlers.HttpHandler
      extended by com.tensegrity.palojava.http.handlers.HttpDimensionHandler

public class HttpDimensionHandler
extends HttpHandler

This HttpHandler is used for dealing with requests concerning palo Dimensions.

Version:
$Id$
Author:
ArndHouben

Constructor Summary
HttpDimensionHandler(HttpClient client)
          Creates a new HttpDimensionHandler instance.
 
Method Summary
 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 createDimension(java.lang.String dbName, java.lang.String dimName)
          Creates a new dimension with the given name in the specified database
 boolean deleteDimension(java.lang.String dbName, java.lang.String dimName)
          Deletes a new dimension with the given name in the specified database
 java.lang.String[] getCubes(java.lang.String dbName, java.lang.String dimName)
          Returns the names of all the cubes which are associated with the specified dimension
 java.lang.String[] getElements(java.lang.String dbName, java.lang.String dimName)
          Returns the names of all elements the specified dimension consists of
 java.lang.String[] getInfos(java.lang.String dbName, java.lang.String dimName)
          Returns information about the dimension.
 boolean rename(java.lang.String dbName, java.lang.String dimName, java.lang.String newName)
          Renames the specified dimension
 
Methods inherited from class com.tensegrity.palojava.http.handlers.HttpHandler
setSID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpDimensionHandler

public HttpDimensionHandler(HttpClient client)
Creates a new HttpDimensionHandler instance. Requires a HttpClient for delegating all requests to the connected palo server.

Parameters:
client - the connection to the palo server
Method Detail

getInfos

public final java.lang.String[] getInfos(java.lang.String dbName,
                                         java.lang.String dimName)
                                  throws java.io.IOException
Returns information about the 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 - a valid database name
dimName - a valid dimension name
Returns:
an String array containing information about the dimension
Throws:
java.io.IOException - if an I/O exception occurs

createDimension

public final boolean createDimension(java.lang.String dbName,
                                     java.lang.String dimName)
                              throws java.io.IOException
Creates a new dimension with the given name in the specified database

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

deleteDimension

public final boolean deleteDimension(java.lang.String dbName,
                                     java.lang.String dimName)
                              throws java.io.IOException
Deletes a new dimension with the given name in the specified database

Parameters:
dbName - a valid database name
dimName - a valid dimension name
Returns:
true if deleting 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 all elements the specified dimension consists of

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

rename

public final boolean rename(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 - a valid dimension name
Returns:
true if clearing 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,
                                         java.lang.String dimName)
                                  throws java.io.IOException
Returns the names of all the cubes which are associated with the specified dimension

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