com.tensegrity.palojava.http.handlers
Class HttpCubeHandler

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

public class HttpCubeHandler
extends HttpHandler

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

Version:
$Id$
Author:
ArndHouben

Constructor Summary
HttpCubeHandler(HttpClient client)
          Creates a new HttpCubeHandler instance.
 
Method Summary
 boolean createCube(java.lang.String dbName, java.lang.String cubeName, java.lang.String dimNames)
          Creates the specified cube
 boolean deleteCube(java.lang.String dbName, java.lang.String cubeName)
          Deletes the specified cube from its database
 java.lang.String[] getDimensions(java.lang.String dbName, java.lang.String cubeName)
          Returns the names of the dimensions which build up the specified cube
 java.lang.String[] getInfos(java.lang.String dbName, java.lang.String cubeName)
          Returns information about the dimension.
 boolean loadCube(java.lang.String dbName, java.lang.String cubeName)
          Loads the specified cube
 boolean saveCube(java.lang.String dbName, java.lang.String cubeName)
          Saves the specified cube
 boolean unloadCube(java.lang.String dbName, java.lang.String cubeName)
          Unloads the specified cube
 
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

HttpCubeHandler

public HttpCubeHandler(HttpClient client)
Creates a new HttpCubeHandler 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 cubeName)
                                  throws java.io.IOException
Returns information about the dimension. 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 - a valid database name
cubeName - a valid cube name
Returns:
an String array containing information about the cube
Throws:
java.io.IOException - if an I/O exception occurs

getDimensions

public final java.lang.String[] getDimensions(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

createCube

public final boolean createCube(java.lang.String dbName,
                                java.lang.String cubeName,
                                java.lang.String dimNames)
                         throws java.io.IOException
Creates the specified cube

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

deleteCube

public final boolean deleteCube(java.lang.String dbName,
                                java.lang.String cubeName)
                         throws java.io.IOException
Deletes the specified cube from its database

Parameters:
dbName - a valid database name
cubeName - a valid cube name
Returns:
true if deleting was successful, false otherwise
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

Parameters:
dbName - a valid database name
cubeName - a valid 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
Unloads the specified cube

Parameters:
dbName - a valid database name
cubeName - a valid cube name
Returns:
true if unloading 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 - a valid cube name
Returns:
true if saving was successful, false otherwise
Throws:
java.io.IOException - if an I/O exception occurs