connections = serviceClient.getConnections();
- Author:
- jamesdixon
ConnectionServiceClient
public ConnectionServiceClient()
addConnection
public boolean addConnection(IConnection connection)
throws ConnectionServiceException
- Adds a connection to the server's configuration. Returns true if the attempt was successful.
setHost(), setUserId() and setPassword() must be called before this
method is called.
- Specified by:
addConnection
in interface IConnectionService
- Parameters:
connection
- The connection to be added
- Returns:
- True if the addition was successful
- Throws:
ConnectionServiceException
convertFromConnection
public DatabaseConnection convertFromConnection(IConnection connection)
throws ConnectionServiceException
- Specified by:
convertFromConnection
in interface IConnectionService
- Throws:
ConnectionServiceException
serializeDatabaseConnection
public org.dom4j.Document serializeDatabaseConnection(DatabaseConnection databaseConnection)
deserializeDatabaseConnection
public DatabaseConnection deserializeDatabaseConnection(org.dom4j.Element rootNode)
throws javax.xml.stream.XMLStreamException,
org.apache.axis2.AxisFault
- Throws:
javax.xml.stream.XMLStreamException
org.apache.axis2.AxisFault
convertToConnection
public IConnection convertToConnection(IDatabaseConnection arg0)
throws ConnectionServiceException
- Specified by:
convertToConnection
in interface IConnectionService
- Throws:
ConnectionServiceException
deleteConnection
public boolean deleteConnection(IConnection connection)
throws ConnectionServiceException
- Deletes a connection from the server's configuration.
Returns true if the attempt was successful.
setHost(), setUserId() and setPassword() must be called before this
method is called.
- Specified by:
deleteConnection
in interface IConnectionService
- Parameters:
connection
- The connection to be deleted
- Returns:
- True if the deletion was successful
- Throws:
ConnectionServiceException
deleteConnection
public boolean deleteConnection(String connectionName)
throws ConnectionServiceException
- Deletes a connection from the server's configuration.
Returns true if the attempt was successful.
setHost(), setUserId() and setPassword() must be called before this
method is called.
- Specified by:
deleteConnection
in interface IConnectionService
- Parameters:
connectionName
- The name of the connection to be deleted
- Returns:
- True if the deletion was successful
- Throws:
ConnectionServiceException
getConnectionByName
public IConnection getConnectionByName(String connectionName)
throws ConnectionServiceException
- Returns a specified connection. Returns null is the connection is not
defined in the server's configuration.
setHost(), setUserId() and setPassword() must be called before this
method is called.
- Specified by:
getConnectionByName
in interface IConnectionService
- Parameters:
connectionName
- The name of the connection to be returned
- Returns:
- The connection requested
- Throws:
ConnectionServiceException
getConnections
public List<IConnection> getConnections()
throws ConnectionServiceException
- Returns a list of connections known to the server. Each one is an IConnection object.
Returns an empty list if no connections are defined.
setHost(), setUserId() and setPassword() must be called before this
method is called.
- Specified by:
getConnections
in interface IConnectionService
- Returns:
- List of the connections
- Throws:
ConnectionServiceException
testConnection
public boolean testConnection(IConnection connection)
throws ConnectionServiceException
- Tests a provided connection on the server. This does not store the
connection on the server, just validates that the connection works
in the server's environment.
- Specified by:
testConnection
in interface IConnectionService
- Parameters:
connection
- The connection to be tested
- Throws:
ConnectionServiceException
updateConnection
public boolean updateConnection(IConnection connection)
throws ConnectionServiceException
- Specified by:
updateConnection
in interface IConnectionService
- Throws:
ConnectionServiceException
setHost
public void setHost(String host)
- Sets the host server, port, and context. For example
http://server:port/pentaho
- Parameters:
host
- The host address and context
setUserId
public void setUserId(String userId)
- Sets the user id to use to connect to the server
- Parameters:
userId
-
setPassword
public void setPassword(String password)
- Sets the password to use to connect to the server
- Parameters:
userId
-
getObject
public Object getObject(Class clazz)
throws org.apache.axis2.AxisFault
- Returns an object for the specified class.
This is in the ObjectSupplier interface used by
the BeanUtil deserialize methods.
- Specified by:
getObject
in interface org.apache.axis2.engine.ObjectSupplier
- Throws:
org.apache.axis2.AxisFault