|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tensegrity.palojava.http.ConnectionHttp
public class ConnectionHttp
ConnectionHttp
Implementation of the IConnection
interface based on the new
palo server which uses the http protocol for communication
Field Summary |
---|
Fields inherited from interface com.tensegrity.palojava.IConnection |
---|
ADDORUPDATE_MODE_ADD, ADDORUPDATE_MODE_ADD_OR_UPDATE, ADDORUPDATE_MODE_FORCE_ADD, ADDORUPDATE_MODE_UPDATE, ELEMENTINDEX_OUTOFBOUNDS, NOT_CONNECTED, SPLASH_MODE_BASE_ADD, SPLASH_MODE_BASE_SET, SPLASH_MODE_DEFAULT, SPLASH_MODE_DISABLED, SPLASH_MODE_UNKNOWN |
Constructor Summary | |
---|---|
ConnectionHttp(java.lang.String server,
java.lang.String service,
java.lang.String username,
java.lang.String password)
Creates a new Connection instance |
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)
Commits the cube log. |
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)
Commits the dimension log. |
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)
(Re)loads the given dimension. |
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)
|
int |
elementLevel(java.lang.String database,
java.lang.String dimension,
java.lang.String element)
|
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)
|
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 |
getErrorMessage()
Returns the current error message |
java.lang.String |
getPassword()
Returns the password md5 encrypted |
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
IConnection.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
IConnection.getData(String, String, int, String[]) |
void |
setErrorMessage(java.lang.String errorMessage)
Sets the specified message as new error message |
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)
Unloads the specified dimension from memory. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionHttp(java.lang.String server, java.lang.String service, java.lang.String username, java.lang.String password) throws PaloException
Connection
instance
server
- the host name of the palo serverservice
- the port number of the palo serverusername
- the login namepassword
- the login password
PaloException
- if login failedMethod Detail |
---|
public java.lang.String getServer()
IConnection
getServer
in interface IConnection
public java.lang.String getService()
IConnection
getService
in interface IConnection
public java.lang.String getUsername()
IConnection
getUsername
in interface IConnection
public java.lang.String getPassword()
getPassword
in interface IConnection
public boolean isConnected()
IConnection
isConnected
in interface IConnection
public java.lang.String getErrorMessage()
public void setErrorMessage(java.lang.String errorMessage)
errorMessage
- the new error messagepublic void disconnect() throws PaloException
IConnection
disconnect
in interface IConnection
PaloException
- if an communication exception occurspublic void ping() throws PaloException
IConnection
ping
in interface IConnection
PaloException
- if palo server is not reachable anymorepublic java.lang.String[] rootListDatabases()
IConnection
rootListDatabases
in interface IConnection
public java.lang.String[] databaseListCubes(java.lang.String database)
IConnection
databaseListCubes
in interface IConnection
database
- a database name
public java.lang.String[] databaseListDimensions(java.lang.String database)
IConnection
databaseListDimensions
in interface IConnection
database
- a database name
public java.lang.String[] cubeListDimensions(java.lang.String database, java.lang.String cube)
IConnection
cubeListDimensions
in interface IConnection
database
- the name of a database which contains the cubecube
- a cube name
public java.lang.String[] dimensionListCubes(java.lang.String database, java.lang.String dimension)
IConnection
dimensionListCubes
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- a dimension name
public DimElementInfo[] dimensionListDimElements(java.lang.String database, java.lang.String dimension)
IConnection
dimensionListDimElements
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- the dimension name
DimElementInfo
arraypublic ConsolidationInfo[] dimElementListConsolidated(java.lang.String database, java.lang.String dimension, java.lang.String element)
IConnection
dimElementListConsolidated
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- the dimension name which contains the elementelement
- the name of an element
ConsolidationInfo
arraypublic int elementChildCount(java.lang.String database, java.lang.String dimension, java.lang.String element)
IConnection
elementChildCount
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- the dimension name which contains the elementelement
- the name of an element
public int elementParentCount(java.lang.String database, java.lang.String dimension, java.lang.String element)
IConnection
elementParentCount
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- the dimension name which contains the elementelement
- the name of an element
public int elementCount(java.lang.String database, java.lang.String dimension)
IConnection
elementCount
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- a dimension name
public int elementIndex(java.lang.String database, java.lang.String dimension, java.lang.String element)
IConnection
elementIndex
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- the dimension name which contains the elementelement
- the name of an element
public int elementIsChild(java.lang.String database, java.lang.String dimension, java.lang.String parent, java.lang.String child)
elementIsChild
in interface IConnection
public int elementLevel(java.lang.String database, java.lang.String dimension, java.lang.String element)
elementLevel
in interface IConnection
public int elementIndent(java.lang.String database, java.lang.String dimension, java.lang.String element)
IConnection
elementIndent
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- the name of the dimension which contains the elementelement
- the element name
public int elementTopLevel(java.lang.String database, java.lang.String dimension)
elementTopLevel
in interface IConnection
public java.lang.String elementName(java.lang.String database, java.lang.String dimension, int n)
IConnection
elementName
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- the dimension name which contains the elementn
- the element position
public int elementType(java.lang.String database, java.lang.String dimension, int n)
IConnection
elementType
in interface IConnection
database
- the name of a database which contains the dimensiondimension
- the dimension name which contains the elementn
- the element position
public java.lang.Object getData(java.lang.String database, java.lang.String cube, int nCoordinates, java.lang.String[] coordinates) throws PaloException
IConnection
Element
names from the
Dimension
s which made up the cube
. It is
important to specifiy the elements in the same order as the dimensions
are within the cube.
getData
in interface IConnection
database
- the name of a database which contains the cubecube
- a cube namenCoordinates
- number of coordinatescoordinates
- the element names
PaloException
- if an exception occurs during the communication
with the palo serverpublic java.lang.Object[] getDataArea(java.lang.String database, java.lang.String cube, java.lang.String[][] elements) throws PaloException
IConnection
IConnection.getData(String, String, int, String[])
getDataArea
in interface IConnection
database
- the name of a database which contains the cubecube
- a cube nameelements
- two dimensional array of element coordinates
PaloException
- if an exception occurs during the communication
with the palo serverpublic void setDataString(java.lang.String database, java.lang.String cube, int nCoordinates, java.lang.String[] coordinates, java.lang.String value) throws PaloException
IConnection
String
value at the specified cell
IConnection.getData(String, String, int, String[])
setDataString
in interface IConnection
database
- the name of a database which contains the cubecube
- a cube namenCoordinates
- number of coordinatescoordinates
- the element namesvalue
- the new value
PaloException
- if an exception occurs during the communication
with the palo serverpublic void setDataNumeric(java.lang.String database, java.lang.String cube, int nCoordinates, java.lang.String[] coordinates, double value) throws PaloException
IConnection
double
value at the specified cell
IConnection.getData(String, String, int, String[])
setDataNumeric
in interface IConnection
database
- the name of a database which contains the cubecube
- a cube namenCoordinates
- number of coordinatescoordinates
- the element namesvalue
- the new value
PaloException
- if an exception occurs during the communication
with the palo serverpublic void setDataBulk(java.lang.String database, java.lang.String cube, java.lang.String[][] coordinates, java.lang.Object[] values, int splashMode) throws PaloException
IConnection
IConnection.setDataNumericSplashed(String, String, int, String[], double, int)
setDataBulk
in interface IConnection
database
- the name of a database which contains the cubecube
- a cube namecoordinates
- the coordinates of the cellssplashMode
- the splash mode, use defined class constants
PaloException
- if an exception occurs during the communication
with the palo serverpublic void addDatabase(java.lang.String database)
IConnection
addDatabase
in interface IConnection
database
- name of the new database.public void unloadDatabase(java.lang.String database)
IConnection
unloadDatabase
in interface IConnection
database
- name of the databasepublic void deleteDatabase(java.lang.String database)
IConnection
deleteDatabase
in interface IConnection
database
- name of the database.public void unloadDimension(java.lang.String database, java.lang.String dimension)
IConnection
unloadDimension
in interface IConnection
database
- the database name which contains the dimenionsdimension
- the dimension namepublic void deleteDimension(java.lang.String database, java.lang.String dimension)
IConnection
deleteDimension
in interface IConnection
database
- the database name which contains the dimenionsdimension
- the dimension namepublic void clearDimension(java.lang.String database, java.lang.String dimension)
IConnection
clearDimension
in interface IConnection
database
- the database name which contains the dimenionsdimension
- the dimension namepublic void databaseAddCube(java.lang.String database, java.lang.String cube, java.lang.String[] dimensions)
IConnection
databaseAddCube
in interface IConnection
database
- name of the database to add the cube tocube
- the cube namedimensions
- the dimension namespublic void databaseAddDimension(java.lang.String database, java.lang.String dimension)
IConnection
databaseAddDimension
in interface IConnection
database
- name of the database to add the dimension topublic void databaseRenameDimension(java.lang.String database, java.lang.String dimensionOldname, java.lang.String dimensionNewname)
IConnection
databaseRenameDimension
in interface IConnection
database
- name of the database which contains the dimensiondimensionOldname
- old dimension namedimensionNewname
- new dimension namepublic void dimensionAddOrUpdateDimElement(java.lang.String database, java.lang.String dimension, java.lang.String element, int addOrUpdateMode, int dimElementType, ConsolidationInfo[] ci, boolean append)
IConnection
dimensionAddOrUpdateDimElement
in interface IConnection
database
- name of the database which contains the dimensiondimension
- name of the dimension which contains the elementelement
- the element nameaddOrUpdateMode
- one of the defined add or update mode constantsdimElementType
- a valid element typeci
- ConsolidatioInfo
s if anypublic void dimElementRename(java.lang.String database, java.lang.String dimension, java.lang.String element, java.lang.String newName)
IConnection
dimElementRename
in interface IConnection
database
- name of the database which contains the dimensiondimension
- name of the dimension which contains the elementelement
- old element namenewName
- new element namepublic void dimElementMove(java.lang.String database, java.lang.String dimension, java.lang.String element, int newPosition)
IConnection
dimElementMove
in interface IConnection
database
- name of the database which contains the dimensiondimension
- name of the dimension which contains the elementelement
- name of the element which should be movednewPosition
- the new element positionpublic void dimElementDelete(java.lang.String database, java.lang.String dimension, java.lang.String element)
IConnection
dimElementDelete
in interface IConnection
database
- name of the database which contains the dimensiondimension
- name of the dimension which contains the elementelement
- name of the element which should be deletedpublic void cubeLoad(java.lang.String database, java.lang.String cube)
IConnection
cubeLoad
in interface IConnection
database
- name of the database which contains the cubecube
- the cube namepublic void databaseLoad(java.lang.String database)
IConnection
IConnection.cubeLoad(String, String)
databaseLoad
in interface IConnection
database
- name of the database to loadpublic void cubeCommitLog(java.lang.String database, java.lang.String cube)
IConnection
cubeCommitLog
in interface IConnection
database
- name of the database which contains the cubecube
- the cube namepublic void databaseSave(java.lang.String database)
IConnection
databaseSave
in interface IConnection
database
- name of the database to savepublic void rootSave()
IConnection
rootSave
in interface IConnection
public void dimensionProcess(java.lang.String database, java.lang.String dimension)
IConnection
dimensionProcess
in interface IConnection
database
- name of the database which contains the dimensiondimension
- the dimension namepublic void unloadCube(java.lang.String database, java.lang.String cube)
IConnection
unloadCube
in interface IConnection
database
- name of the database which contains the cubecube
- the cube namepublic void deleteCube(java.lang.String database, java.lang.String cube)
IConnection
deleteCube
in interface IConnection
database
- name of the database which contains the cubecube
- the cube namepublic void dimensionCommitLog(java.lang.String database, java.lang.String dimension)
IConnection
dimensionCommitLog
in interface IConnection
database
- name of the database which contains the dimensiondimension
- the dimension namepublic void setDataNumericSplashed(java.lang.String database, java.lang.String cube, int nCoordinates, java.lang.String[] coordinates, double value, int splashMode) throws PaloException
IConnection
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
setDataNumericSplashed
in interface IConnection
database
- the name of a database which contains the cubecube
- a cube namenCoordinates
- number of coordinatescoordinates
- the element namesvalue
- the new valuesplashMode
- the splash mode, use defined class constants
PaloException
- if an exception occurs during the communication
with the palo server
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |