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

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.ogsadai.OgsaDaiDataResourceManager
      extended by uk.ac.soton.itinnovation.grid.service.ogsadai.rdbms.RDBMSDataResourceManager
All Implemented Interfaces:
DataResourceManager

public class RDBMSDataResourceManager
extends OgsaDaiDataResourceManager


Field Summary
protected static org.apache.log4j.Logger log
           
static String PROP_BACKEND_HELPER_CLASS
           
static String PROP_JDBC_URL_ROOT
           
static String PROP_SYSTEM_DATABASE
           
static String PROP_SYSTEM_PASSWORD
           
static String PROP_SYSTEM_USERNAME
           
static String PROP_USERNAME_PREFIX
           
 
Fields inherited from class uk.ac.soton.itinnovation.grid.service.ogsadai.OgsaDaiDataResourceManager
configurationDirectory, ogsaDaiInstance, schemaUrl, skeletonDirectory
 
Constructor Summary
RDBMSDataResourceManager()
           
 
Method Summary
 void connectDataResource(DataResourceBean bean)
          Connect an existing resource on the backend.
 void connectDataResourceRole(DataResourceRoleBean bean)
          Connect a data resource role on the backend.
 void createDataResource(DataResourceBean bean)
          Create a new resource on the backend.
 void createDataResourceRole(DataResourceRoleBean bean)
          Create a data resource role on the backend.
 void createDataResourceSubscription(DataResourceSubscriptionBean bean)
          Perform any required actions on the backend to subscribe to a role.
 List<org.apache.axis.message.addressing.EndpointReferenceType> createDefaultRoles(MatchRule owner, DataResourceBean bean, DataResource service, String metricURI)
          Create any default roles on a newly created data resource.
 void destroyDataResource(DataResourceBean bean)
          Destroy a data resource on the backend.
 void destroyDataResourceRole(DataResourceRoleBean bean)
          Destroy a role on the backend.
 void destroyDataResourceSubscription(DataResourceSubscriptionBean bean)
          Perform any required actions on the backend to unsubscribe to a role.
 void disconnectDataResource(DataResourceBean bean)
          Disconnect a data resource on the backend.
 void disconnectDataResourceRole(DataResourceRoleBean bean)
          Disconnect a role on the backend.
 Properties getProperties()
           
 void reloadConfiguration()
          Instruct the data resource manager to reload any configuration files it needs.
 void saveConfiguration(String url, String systemUser, String systemPass, String systemDb, String userPrefix, String backendHelperClass)
           
static String subFromTemplate(String file, String key, String value)
           
 void writeDataResourceConfiguration(String resourceID, String jdbcURL)
          Writes or re-writes configuration for a data resource
 
Methods inherited from class uk.ac.soton.itinnovation.grid.service.ogsadai.OgsaDaiDataResourceManager
createOgsaDaiInstance, getGriaConfigDirectory, getOgsaDaiInstance, getSchemaURL, getServiceConfiguration, getWebInfDirectory, isConfigurationLoaded, loadPropertiesFile, readFile, readFileFromClassPath, readSkeletonFile, setConfigurationLoaded, writeFile, writeFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_BACKEND_HELPER_CLASS

public static final String PROP_BACKEND_HELPER_CLASS
See Also:
Constant Field Values

PROP_JDBC_URL_ROOT

public static final String PROP_JDBC_URL_ROOT
See Also:
Constant Field Values

PROP_SYSTEM_USERNAME

public static final String PROP_SYSTEM_USERNAME
See Also:
Constant Field Values

PROP_SYSTEM_PASSWORD

public static final String PROP_SYSTEM_PASSWORD
See Also:
Constant Field Values

PROP_SYSTEM_DATABASE

public static final String PROP_SYSTEM_DATABASE
See Also:
Constant Field Values

PROP_USERNAME_PREFIX

public static final String PROP_USERNAME_PREFIX
See Also:
Constant Field Values

log

protected static org.apache.log4j.Logger log
Constructor Detail

RDBMSDataResourceManager

public RDBMSDataResourceManager()
Method Detail

connectDataResource

public void connectDataResource(DataResourceBean bean)
                         throws GridFailureException
Description copied from interface: DataResourceManager
Connect an existing resource on the backend.

Parameters:
bean - A bean holding information about the resource to be connected
Throws:
GridFailureException

createDataResource

public void createDataResource(DataResourceBean bean)
Description copied from interface: DataResourceManager
Create a new resource on the backend. DataResourceManager.createDefaultRoles(uk.ac.soton.itinnovation.grid.types.MatchRule, uk.ac.soton.itinnovation.grid.service.dataresource.beans.DataResourceBean, uk.ac.soton.itinnovation.grid.comms.dataresource.DataResource, java.lang.String) will be called shortly after this method to allow the creation of any default roles that allow users to access the resource.

Parameters:
bean - A bean holding information about the resource to be created

destroyDataResource

public void destroyDataResource(DataResourceBean bean)
                         throws GridFailureException
Description copied from interface: DataResourceManager
Destroy a data resource on the backend. Unlike DataResourceManager.disconnectDataResource(uk.ac.soton.itinnovation.grid.service.dataresource.beans.DataResourceBean), this method should totally remove the data resource and any data contained within it. This method will only be called on resources that were created with DataResourceManager.createDataResource(uk.ac.soton.itinnovation.grid.service.dataresource.beans.DataResourceBean).

Parameters:
bean - A bean holding information about the resource to be destroyed
Throws:
GridFailureException

disconnectDataResource

public void disconnectDataResource(DataResourceBean bean)
Description copied from interface: DataResourceManager
Disconnect a data resource on the backend. This method should leave any data that was contained within the data resource intact. This method will only be called by resources that were created with DataResourceManager.connectDataResource(uk.ac.soton.itinnovation.grid.service.dataresource.beans.DataResourceBean).

Parameters:
bean - A bean holding information about the resource to be disconnected

connectDataResourceRole

public void connectDataResourceRole(DataResourceRoleBean bean)
Description copied from interface: DataResourceManager
Connect a data resource role on the backend.

Parameters:
bean - A bean holding information about the role to be connected

createDataResourceRole

public void createDataResourceRole(DataResourceRoleBean bean)
Description copied from interface: DataResourceManager
Create a data resource role on the backend.

Parameters:
bean - A bean holding information about the role to be created

createDefaultRoles

public List<org.apache.axis.message.addressing.EndpointReferenceType> createDefaultRoles(MatchRule owner,
                                                                                         DataResourceBean bean,
                                                                                         DataResource service,
                                                                                         String metricURI)
                                                                                  throws GridFailureException
Description copied from interface: DataResourceManager
Create any default roles on a newly created data resource. This method will be called shortly after DataResourceManager.createDataResource(uk.ac.soton.itinnovation.grid.service.dataresource.beans.DataResourceBean) and is responsible for setting up one or more roles for users to access the data resource. It should call the DataResource.createDataResourceRole(java.lang.String, uk.ac.soton.itinnovation.grid.types.MatchRule, java.lang.String, java.util.Map, java.lang.String) method on service to create the roles.

Parameters:
owner - A rule describing the owner of the resource. Should be passed as a parameter to DataResource.createDataResourceRole(java.lang.String, uk.ac.soton.itinnovation.grid.types.MatchRule, java.lang.String, java.util.Map, java.lang.String).
bean - A bean holding information about the data resource that has just been created. The resourceID can be retreived from this bean and passed as a parameter to DataResource.createDataResourceRole(java.lang.String, uk.ac.soton.itinnovation.grid.types.MatchRule, java.lang.String, java.util.Map, java.lang.String)
service - The service interface used to do the creation of roles.
metricURI - The metric URI given to the data resource. Variations on this should be given to each of the roles. If metricURI is an empty string (""), no metrics should be assigned to the roles.
Returns:
A list of the EPRs returned by createDataResourceRole.
Throws:
GridFailureException

destroyDataResourceRole

public void destroyDataResourceRole(DataResourceRoleBean bean)
                             throws GridFailureException
Description copied from interface: DataResourceManager
Destroy a role on the backend. Unlike DataResourceManager.disconnectDataResourceRole(uk.ac.soton.itinnovation.grid.service.dataresource.beans.DataResourceRoleBean), this method should totally remove the role from the backend. It will only be called on resources that were created with DataResourceManager.createDataResourceRole(uk.ac.soton.itinnovation.grid.service.dataresource.beans.DataResourceRoleBean).

Parameters:
bean - A bean holding information about the role to be destroyed
Throws:
GridFailureException

disconnectDataResourceRole

public void disconnectDataResourceRole(DataResourceRoleBean bean)
Description copied from interface: DataResourceManager
Disconnect a role on the backend. This method should leave the actual role intact. It will only be called on resources that were created with DataResourceManager.connectDataResourceRole(uk.ac.soton.itinnovation.grid.service.dataresource.beans.DataResourceRoleBean).

Parameters:
bean - A bean holding information about the role to be disconnected

writeDataResourceConfiguration

public void writeDataResourceConfiguration(String resourceID,
                                           String jdbcURL)
Description copied from interface: DataResourceManager
Writes or re-writes configuration for a data resource


reloadConfiguration

public void reloadConfiguration()
                         throws GridFailureException
Description copied from interface: DataResourceManager
Instruct the data resource manager to reload any configuration files it needs. This is called once upon service initialisation and may be called after the user has changed settings in a user interface.

Throws:
GridFailureException

subFromTemplate

public static String subFromTemplate(String file,
                                     String key,
                                     String value)

saveConfiguration

public void saveConfiguration(String url,
                              String systemUser,
                              String systemPass,
                              String systemDb,
                              String userPrefix,
                              String backendHelperClass)
                       throws GridFailureException
Throws:
GridFailureException

createDataResourceSubscription

public void createDataResourceSubscription(DataResourceSubscriptionBean bean)
Description copied from interface: DataResourceManager
Perform any required actions on the backend to subscribe to a role. Typically this method will do nothing as subscriptions have no meaning to the backend.

Parameters:
bean - A bean holding information about the subscription

destroyDataResourceSubscription

public void destroyDataResourceSubscription(DataResourceSubscriptionBean bean)
Description copied from interface: DataResourceManager
Perform any required actions on the backend to unsubscribe to a role. Typically this method will do nothing as subscriptions have no meaning to the backend.

Parameters:
bean - A bean holding information about the subscription

getProperties

public Properties getProperties()


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