Difference between revisions of "Database resource"

From Gcube Wiki
Jump to: navigation, search
(Created page with '= Introduction = = Model = = Client library =')
 
(Model)
Line 2: Line 2:
  
 
= Model =
 
= Model =
 +
Database resource model is based on the Runtime Resource resource. The guidelines are explained through an example:
 +
 +
<source lang="xml">
 +
 +
<Resource version="0.4.x">
 +
  <ID>15398010-c13a-11e2-a1ec-f54c9ec8d8f1</ID>
 +
  <Type>RuntimeResource</Type>
 +
  <Scopes>
 +
      <Scope>/gcube/devsec</Scope>
 +
  </Scopes>
 +
  <Profile>
 +
      <Category>Database</Category>
 +
      <Name>TabularData Database</Name>
 +
      <Description />
 +
      <!-- Specify database technology name and version -->
 +
      <Platform>
 +
        <Name>PostgreSQL</Name>
 +
        <Version>9</Version>
 +
        <MinorVersion>2</MinorVersion>
 +
        <RevisionVersion>4</RevisionVersion>
 +
        <BuildVersion>0</BuildVersion>
 +
      </Platform>
 +
      <RunTime>
 +
        <HostedOn>pc-fortunati.isti.cnr.it:5432</HostedOn> <!-- This field must include the hostname and the port through wich the DB service is accessible -->
 +
        <GHN UniqueID="" />
 +
        <Status>READY</Status>
 +
      </RunTime>
 +
      <AccessPoint>
 +
        <Description>Tabular Data Database endpoint for data (tables) storage (Admin user)</Description>
 +
        <Interface>
 +
            <!-- The endpoint EntryName should give a hint of the database being point and the privileges granted within the credentials -->
 +
            <!--
 +
                As a rule of thumb please follow this naming convention:
 +
                "${DBName}-${Privileges}"
 +
                where:
 +
                * ${DBName} is a name that describe the DB
 +
                * ${Privileges} describe the privileges granted with the account provided.
 +
-->
 +
            <Endpoint EntryName="Data-Admin">jdbc:postgresql://pc-fortunati.isti.cnr.it:5432/tabulardata</Endpoint>
 +
        </Interface>
 +
        <AccessData>
 +
            <Username>luigi</Username>
 +
            <Password>2cf1YRdE5TeiuhQpZUuAOw==</Password> <!-- Passwords are encrypted. In order to decrypt them you should have the scope symm key on your classpath. Refer to common-encryption for further details. -->
 +
        </AccessData>
 +
        <!-- An additional number of optional properties can be embedded within the endpoint -->
 +
        <Properties>
 +
            <Property>
 +
              <Name>driver</Name>
 +
              <Value encrypted="false">org.postgresql.Driver</Value>
 +
            </Property>
 +
        </Properties>
 +
      </AccessPoint>
 +
      <AccessPoint>
 +
        <Description>Tabular Data Database endpoint for data (tables) storage (Unprivileged user)</Description>
 +
        <Interface>
 +
            <Endpoint EntryName="Data-User">jdbc:postgresql://pc-fortunati.isti.cnr.it:5432/tabulardata</Endpoint>
 +
        </Interface>
 +
        <AccessData>
 +
            <Username>client</Username>
 +
            <Password>CSnMl38Vjfs7+2KYRG9b/g==</Password>
 +
        </AccessData>
 +
        <Properties>
 +
            <Property>
 +
              <Name>driver</Name>
 +
              <Value encrypted="false">org.postgresql.Driver</Value>
 +
            </Property>
 +
        </Properties>
 +
      </AccessPoint>
 +
      <AccessPoint>
 +
        <Description>Tabular Data Database endpoint for metadata storage (Admin user)</Description>
 +
        <Interface>
 +
            <Endpoint EntryName="Metadata-Admin">jdbc:postgresql://pc-fortunati.isti.cnr.it:5432/tabularmetadata</Endpoint>
 +
        </Interface>
 +
        <AccessData>
 +
            <Username>luigi</Username>
 +
            <Password>2cf1YRdE5TeiuhQpZUuAOw==</Password>
 +
        </AccessData>
 +
        <Properties>
 +
            <Property>
 +
              <Name>eclipselink.target-database</Name>
 +
              <Value encrypted="false">org.eclipse.persistence.platform.database.PostgreSQLPlatform</Value>
 +
            </Property>
 +
            <Property>
 +
              <Name>driver</Name>
 +
              <Value encrypted="false">org.postgresql.Driver</Value>
 +
            </Property>
 +
        </Properties>
 +
      </AccessPoint>
 +
  </Profile>
 +
</Resource>
 +
 +
</source>
  
 
= Client library =
 
= Client library =

Revision as of 11:30, 4 June 2013

Introduction

Model

Database resource model is based on the Runtime Resource resource. The guidelines are explained through an example:

<Resource version="0.4.x">
   <ID>15398010-c13a-11e2-a1ec-f54c9ec8d8f1</ID>
   <Type>RuntimeResource</Type>
   <Scopes>
      <Scope>/gcube/devsec</Scope>
   </Scopes>
   <Profile>
      <Category>Database</Category>
      <Name>TabularData Database</Name>
      <Description />
      <!-- Specify database technology name and version -->
      <Platform>
         <Name>PostgreSQL</Name>
         <Version>9</Version>
         <MinorVersion>2</MinorVersion>
         <RevisionVersion>4</RevisionVersion>
         <BuildVersion>0</BuildVersion>
      </Platform>
      <RunTime>
         <HostedOn>pc-fortunati.isti.cnr.it:5432</HostedOn> <!-- This field must include the hostname and the port through wich the DB service is accessible -->
         <GHN UniqueID="" />
         <Status>READY</Status>
      </RunTime>
      <AccessPoint>
         <Description>Tabular Data Database endpoint for data (tables) storage (Admin user)</Description>
         <Interface>
            <!-- The endpoint EntryName should give a hint of the database being point and the privileges granted within the credentials -->
            <!-- 
                As a rule of thumb please follow this naming convention:
                "${DBName}-${Privileges}" 
                where:
                * ${DBName} is a name that describe the DB
                * ${Privileges} describe the privileges granted with the account provided. 
-->
            <Endpoint EntryName="Data-Admin">jdbc:postgresql://pc-fortunati.isti.cnr.it:5432/tabulardata</Endpoint>
         </Interface>
         <AccessData>
            <Username>luigi</Username>
            <Password>2cf1YRdE5TeiuhQpZUuAOw==</Password> <!-- Passwords are encrypted. In order to decrypt them you should have the scope symm key on your classpath. Refer to common-encryption for further details. -->
         </AccessData>
         <!-- An additional number of optional properties can be embedded within the endpoint -->
         <Properties>
            <Property>
               <Name>driver</Name>
               <Value encrypted="false">org.postgresql.Driver</Value>
            </Property>
         </Properties>
      </AccessPoint>
      <AccessPoint>
         <Description>Tabular Data Database endpoint for data (tables) storage (Unprivileged user)</Description>
         <Interface>
            <Endpoint EntryName="Data-User">jdbc:postgresql://pc-fortunati.isti.cnr.it:5432/tabulardata</Endpoint>
         </Interface>
         <AccessData>
            <Username>client</Username>
            <Password>CSnMl38Vjfs7+2KYRG9b/g==</Password>
         </AccessData>
         <Properties>
            <Property>
               <Name>driver</Name>
               <Value encrypted="false">org.postgresql.Driver</Value>
            </Property>
         </Properties>
      </AccessPoint>
      <AccessPoint>
         <Description>Tabular Data Database endpoint for metadata storage (Admin user)</Description>
         <Interface>
            <Endpoint EntryName="Metadata-Admin">jdbc:postgresql://pc-fortunati.isti.cnr.it:5432/tabularmetadata</Endpoint>
         </Interface>
         <AccessData>
            <Username>luigi</Username>
            <Password>2cf1YRdE5TeiuhQpZUuAOw==</Password>
         </AccessData>
         <Properties>
            <Property>
               <Name>eclipselink.target-database</Name>
               <Value encrypted="false">org.eclipse.persistence.platform.database.PostgreSQLPlatform</Value>
            </Property>
            <Property>
               <Name>driver</Name>
               <Value encrypted="false">org.postgresql.Driver</Value>
            </Property>
         </Properties>
      </AccessPoint>
   </Profile>
</Resource>

Client library