JDBC Data Resource Configuration Document
Data resource configuration involves specifying information about a data resource including its location, its metadata and its driver classes. Configuration is done using a data resource configuration document.
Data resource configuration documents are written by OGSA-DAI service deployers.
A data resource configuration document includes information on the following:
- The location of the data resource and the database or collection within that data resource to be exposed.
- The database driver used to manage connections with the data resource.
- Information to allow metadata to be extracted dynamically from the data resource (e.g. database schema).
- The location of a role map document specifying authorisation information for the data resource.
For the remainder of this page we give an overview of the general format of the data resource configuration document used by a JDBC data resource accessor.
Example
<?xml version="1.0" encoding="UTF-8"?>
<dataResourceConfig
xmlns="https://ogsadai.org.uk/namespaces/2005/10/config">
<documentation>
This is an example data resource configuration document for a
MySQL relational data resource.
</documentation>
<!-- Metadata about the data resource -->
<metaData>
<!-- This element and its contents are optional. -->
<productInfo>
<productName>MySQL</productName>
<productVersion>4</productVersion>
<vendorName>MySQL</vendorName>
</productInfo>
<!-- Custom metadata -->
<keywordlist>
<keyword> frogs <keyword>
<keyword> genome <keyword>
</keywordlist>
</metaData>
<!-- Data resource authorisation information - Role Map -->
<roleMap name="Name"
implementation="uk.org.ogsadai.common.rolemap.SimpleFileRoleMapper"
configuration="SomeDataResource/DatabaseRoles.xml"/>
<!-- Manager of the connection to the DBMS -->
<dataResource>
<driver implementation="org.gjt.mm.mysql.Driver">
<uri>jdbc:mysql://localhost:3306/ogsadai</uri>
</driver>
</dataResource>
</dataResourceConfig>
Specification
Element dataResourceConfig:
- Element documentation (zero or more) - human-readable description of the data resource.
- Element metaData (required) - data resource metadata that can be accessed by clients via OGSA-DAI services.
- Element productInfo (optional) - description of the data resource product.
- Element productName (required) - name.
- Element productVersion (required) - version.
- Element vendorName (required) - vendor.
- Application-specific metadata. The name of the element can be used by clients to access this metadata.
- Element roleMap (one or more) - information on authorising client access to the data resource:
- Attribute name (optional) - name for this particular entry.
- Attribute implementation (required) - Java class that implements role mapping:
- OGSA-DAI provides the class uk.org.ogsadai.common.rolemap.SimpleFileRoleMapper - this expects role map documents to be in a standard OGSA-DAI format which is described later.
- Attribute configuration (optional) - location of a role map configuration document. This can be a relative or absolute path. Relative pathnames will be resolved against the home directory of the web application of a Web services hosting container, for example CONTAINER/webapps/ogsa.
- If the OGSA-DAI role map class is used then a value for the configuration attribute must be given and this must be consistent with the OGSA-DAI standard role map document formats (which are described later in this guide).
- Element dataResource (required) - element which specifies the database driver and related information:
- Attribute name (optional) - name for this particular entry.
- Element driver (required) - information on the database driver.
- Attribute implementation (required) - Java database driver class.
- Element uri (required) - URI used by the database driver to connect to the database.
XML Schema
OGSA-DAI/schema/ogsadai/xsd/data_resource_config.xsd