uk.ac.soton.itinnovation.grid.service.ogsadai.rdbms
Interface BackendHelper

All Known Implementing Classes:
MySQLBackendHelper, PostgreSQLBackendHelper

public interface BackendHelper

Interface used by RDBMSDataResourceManager to manipulate a specific type of RDBMS.


Field Summary
static String DAI_CALLBACK
           
static String DAI_DRIVER
           
static String DAI_NAME
           
static String DAI_VENDOR
           
static String DAI_VERSION
           
 
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.
 

Field Detail

DAI_NAME

static final String DAI_NAME
See Also:
Constant Field Values

DAI_VERSION

static final String DAI_VERSION
See Also:
Constant Field Values

DAI_VENDOR

static final String DAI_VENDOR
See Also:
Constant Field Values

DAI_CALLBACK

static final String DAI_CALLBACK
See Also:
Constant Field Values

DAI_DRIVER

static final String DAI_DRIVER
See Also:
Constant Field Values
Method Detail

initalise

void initalise(String jdbcUrl,
               String systemDatabase,
               String systemUsername,
               String systemPassword)
               throws ClassNotFoundException
Load the backend JDBC driver and store the given RDBMS login credentials.

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

void createDatabase(String dbName)
                    throws SQLException
Create a new database on the RDMBS with the given name.

Throws:
SQLException

dropDatabase

void dropDatabase(String dbName)
                  throws SQLException
Drop the database on the RDMBS with the given name.

Throws:
SQLException

addDauRo

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

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

void addDauRw(String dbName,
              String username,
              String password)
              throws SQLException
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.

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

addDaa

void addDaa(String dbName,
            String username,
            String password)
            throws SQLException
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.

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

initUsers

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

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

dropUser

void dropUser(String dbName,
              String username)
              throws SQLException
Remove a user and all his permissions from a database.

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

getProperty

String getProperty(String property)
Returns the value of a property specific to this database backend.

Parameters:
property - Name of the property. Can be one of DAI_CALLBACK, DAI_DRIVER, DAI_NAME, DAI_VENDOR, or DAI_VERSION.
Returns:
Value of the requested property.

uncommentRelevantActivities

String uncommentRelevantActivities(String fileContents)
Uncomment activities to this backend.

Parameters:
fileContents -


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