6.2.2.
Integrating Different Data Resource Types
Up one level
Overview
In order to add a completely different data resource to the service, implementations for several interfaces must be written. The implementations are loaded through the ImplementationFactory and the implementing classes must be defined in the implementationfactory.properties file.
The GRIA OGSA-DAI service makes the distinction between connecting and creating data resources and data resource roles (e.g. databases and database users). The term "connecting" means configuring the service to make use of pre-existing data resources or users. The term "creating" refers to the service instructing the back-end system to create new data resources or users. A new implementation may want to just provide the facility to connect to existing data resources.
Method
Implement a DataResourceManager
The abstract class OgsaDaiDataResourceManager is the OGSA-DAI service's implementation of the DataResourceManager interface. It contains convenience functions useful for handling OGSA-DAI configuration files. It must be extended by a class specific to the back-end system. The only class that extends it so far is the RDBMSDataResourceManager.
One of the functions of the DataResourceManager is to connect an existing data resource. In order to do this, a new OGSA-DAI instance must be created and deployed. The RDBMSDataResourceManager creates the configuration files of the new OGSA-DAI instance by using template files contained within WEB-INF/etc/skeletons in the GRIA OGSA-DAI webapp. The templates are transformed into complete configuration files and written into the defined configuration directory of the GRIA OGSA-DAI service.
Two of the methods of DataResourceManager are createDataResource and connectDataResource
- Loaded by the ImplementationFactory
- OgsaDaiDataResourceManager Javadoc
- RDBMSDataResourceManager Javadoc
Implement the Presentation Interface
This is used by both the web interface and SOAP clients to provide presentation information about the OgsaDaiDataResourceManager subclass that is being used. The only class that implements it so far is RDBMSPresentation, which through the implementation of the DataResourceManager (see above) also saves the configuration data entered in the web interface. When extending OgsaDaiDataResourceManager another implementation for this class must also be written.
- Loaded by the ImplementationFactory
- Presentation Javadoc
- RDBMSPresentation Javadoc
Implement the OGSA-DAI RoleMapper Interface
The OGSA-DAI RoleMapper provides the OGSA-DAI SQL activities with credentials for data resources they need to access. The interface defined by OGSA-DAI takes a string defining the credentials and a string defining the database to be used and returns an OGSA-DAI Role object containing whatever is required to log in to the database.
For the GRIA OGSA-DAI service RDBMSSubscriptionRoleMapper has been written. It takes a DataResourceSubscription ID for the credentials and a DataResource ID for the database specifier. As the DataResourceSubscription is already in the context of a user on a database, it just uses the DataResourceSubscription to retrieve the username and password from the parent DataResourceRole object and returns them in the OGSA-DAI DatabaseRole object (a standard implementation of Role).
It is suggested that custom OGSA-DAI activities also use the RoleMapper system for obtaining login credentials. If the database login only requires a username and password then the existing implementation (RDBMSSubscriptionRoleMapper) will be sufficient, otherwise another implementation for this class and for the OGSA-DAI Role class must also be written.
- Loaded by specifying a class name in the OGSA-DAI configuration files.
- RoleMapper Javadoc
- Role Javadoc
- DatabaseRole Javadoc
- RDBMSSubscriptionRoleMapper Javadoc
Supporting Additional Activities
A whitelist of permitted OGSA-DAI activities is specified in the activityConfig.xml file in OGSA-DAI's configuration directory. This file is generated by RDBMSDataResourceManager from a template (WEB-INF/etc/skeletons/activityConfigRelational.xml in the webapp). In order to support new types of activity, a replacement for RDBMSDataResourceManager would have to be created to generate these different configuration files (see above). This new implementation would also need to interface differently with whatever back-end it used (RDBMS has a BackendHelper to do this). It would likely still be able to use OgsaDaiInstance (a protected field inherited from OgsaDaiDataResourceManager) to deploy and undeploy data resources on OGSA-DAI.
Modifying the Client Plug-in
The GRIA OGSA-DAI service client plug-in provides maangement abilities for OGSA-DAI resources. For subscription resources it also has menu options for executing SQL select and update statements. These methods are provided just for convenience and it is not expected that anyone would use them for serious work. It would be possible to write an alternative client plug-in that provided similar convenience methods for whatever operations were useful for the alternative back-end.
