uk.ac.soton.itinnovation.grid.service.ogsadai.rdbms
Class PostgreSQLBackendHelper

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.ogsadai.rdbms.PostgreSQLBackendHelper
All Implemented Interfaces:
BackendHelper

public class PostgreSQLBackendHelper
extends Object
implements BackendHelper


Field Summary
 
Fields inherited from interface uk.ac.soton.itinnovation.grid.service.ogsadai.rdbms.BackendHelper
DAI_CALLBACK, DAI_DRIVER, DAI_NAME, DAI_VENDOR, DAI_VERSION
 
Constructor Summary
PostgreSQLBackendHelper()
           
 
Method Summary
 void addDaa(String dbName, String username, String password)
          Add a user with administrator privileges to the database.
 void addDauRo(String dbName, String username, String password)
          Add a user with administrator privileges to the database.
 void addDauRw(String dbName, String username, String password)
          Add a user with administrator privileges to the database.
 void createDatabase(String dbName)
          Create a new database on the RDMBS with the given name.
 void dropDatabase(String dbName)
          Drop the database on the RDMBS with the given name.
 void dropUser(String dbName, String username)
          Remove a user and all his permissions from a database.
 String getProperty(String property)
          Returns the value of a property specific to this database backend.
 void initalise(String jdbcUrl, String systemDatabase, String systemUsername, String systemPassword)
          Load the backend JDBC driver and store the given RDBMS login credentials.
 void initUsers(String dbName, String usernameDauRo, String usernameDauRw, String usernameDaa)
          Perform any necessary actions to initalise the DAA, DAU-RW, and DAU-RO users.
 String uncommentRelevantActivities(String fileContents)
          Uncomment activities to this backend.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgreSQLBackendHelper

public PostgreSQLBackendHelper()
Method Detail

initalise

public void initalise(String jdbcUrl,
                      String systemDatabase,
                      String systemUsername,
                      String systemPassword)
               throws ClassNotFoundException
Description copied from interface: BackendHelper
Load the backend JDBC driver and store the given RDBMS login credentials.

Specified by:
initalise in interface BackendHelper
Parameters:
jdbcUrl - The base URL of the RDBMS without any database. eg: jdbc:mysql://localhost/
systemDatabase - The name of a system database to connect to when performing database manipulation operations.
systemUsername - The username of an administrator user.
systemPassword - The password for an administrator user.
Throws:
ClassNotFoundException - Thrown if the JDBC driver could not be found.

createDatabase

public void createDatabase(String dbName)
                    throws SQLException
Description copied from interface: BackendHelper
Create a new database on the RDMBS with the given name.

Specified by:
createDatabase in interface BackendHelper
Throws:
SQLException

dropDatabase

public void dropDatabase(String dbName)
                  throws SQLException
Description copied from interface: BackendHelper
Drop the database on the RDMBS with the given name.

Specified by:
dropDatabase in interface BackendHelper
Throws:
SQLException

addDaa

public void addDaa(String dbName,
                   String username,
                   String password)
            throws SQLException
Description copied from interface: BackendHelper
Add a user with administrator privileges to the database. Such a user should have all the permissions of a DAU-RW user as well as the ability to create and remove tables.

Specified by:
addDaa in interface BackendHelper
Parameters:
dbName - The name of the database to which the user should be given access.
username - The name of the new user.
password - The password for the new user.
Throws:
SQLException

addDauRo

public void addDauRo(String dbName,
                     String username,
                     String password)
              throws SQLException
Description copied from interface: BackendHelper
Add a user with administrator privileges to the database. Such a user should only have permission to read data.

Specified by:
addDauRo in interface BackendHelper
Parameters:
dbName - The name of the database to which the user should be given access.
username - The name of the new user.
password - The password for the new user.
Throws:
SQLException

addDauRw

public void addDauRw(String dbName,
                     String username,
                     String password)
              throws SQLException
Description copied from interface: BackendHelper
Add a user with administrator privileges to the database. Such a user should have all the permissions of a DAU-RO user as well as the ability to write data.

Specified by:
addDauRw in interface BackendHelper
Parameters:
dbName - The name of the database to which the user should be given access.
username - The name of the new user.
password - The password for the new user.
Throws:
SQLException

dropUser

public void dropUser(String dbName,
                     String username)
              throws SQLException
Description copied from interface: BackendHelper
Remove a user and all his permissions from a database.

Specified by:
dropUser in interface BackendHelper
Parameters:
dbName - The name of the database from which the user should be removed.
username - The name of the user to be removed.
Throws:
SQLException

initUsers

public void initUsers(String dbName,
                      String usernameDauRo,
                      String usernameDauRw,
                      String usernameDaa)
               throws SQLException
Description copied from interface: BackendHelper
Perform any necessary actions to initalise the DAA, DAU-RW, and DAU-RO users. Called after all three users have been created.

Specified by:
initUsers in interface BackendHelper
Parameters:
dbName - The name of the database.
usernameDauRo - The name of the DAU-RO user.
usernameDauRw - The name of the DAU-RW user.
usernameDaa - The name of the DAA user.
Throws:
SQLException

getProperty

public String getProperty(String property)
Description copied from interface: BackendHelper
Returns the value of a property specific to this database backend.

Specified by:
getProperty in interface BackendHelper
Parameters:
property - Name of the property. Can be one of BackendHelper.DAI_CALLBACK, BackendHelper.DAI_DRIVER, BackendHelper.DAI_NAME, BackendHelper.DAI_VENDOR, or BackendHelper.DAI_VERSION.
Returns:
Value of the requested property.

uncommentRelevantActivities

public String uncommentRelevantActivities(String fileContents)
Description copied from interface: BackendHelper
Uncomment activities to this backend.

Specified by:
uncommentRelevantActivities in interface BackendHelper


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.