Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

The Data Access Component (DAC) plays a new role in the FEWS system. It allows webservices that are deployed in the same servlet container as the DAC to communicate directly with the FEWS central database.The DAC makes use of the FEWS OpenAPI to communicate with the attached webservices.

The main functionality of the DAC is given below.

  • Allow webservice deployed in a Servlet container such as Tomcat to access the FEWS central database directly or through an instance of the DataStore component. Through the DataStore component it will be possible to access the following information:
    - read / write timeseries
    - read / log messages
    - read FEWS configuration
    - run workflows

Image Removed

Design

The Design of the FEWS data access component is directly linked to the FEWS database model. For more information on the design of the FEWS database model we refer to documentation of the Master Controller database.

The Data Access Components will make use of existing components such as the DataStore component currently used by the FEWS client instances (OC, FSS) and the ExtendedDataSource components used to connect to de Master Controller database.

Data Access Component

Is a java class that is configured as a Global Resource in a Servlet container and will be initialized as a Singleton for each database connection. The Data Access Component will implement an interface that will allow webservices to access the FEWS DataStore. In the future this interface can be expanded to provide more convenience methods and to reduce code duplication. All resources used by the Data Access Component will be added to the Tomcat class path. This way it is possible for other webservices deployed in the same Servlet container to access and use the DataStore without having to include all FEWS data access resources.

Each instance of the Data Access Component represents one database connection for one FEWS region.

DataStore

This component will be initialized once the Data Access Component is initialized. A DataStore requires an instance of a ExternalDataSource (connection to MC database) and a reference to a cache directory for storing the datastore cache files. This information is configured in the Global Resource of the Data Access Component.

ExternalDataSource

This is a component required by the DataStore. This component will be configured as a separate Global Resource within the Servlet container. Only one ExternalDataSource instance is allowed per Master Controller database.

FEWS Webservice

A FEWS webservice component that uses the Data Access Component can do so by performing a lookup from the InitialContext. Each webservice can use the FEWS configuration present in the central database. It is up to the webservice itself to decide how it wishes to publish the available information to the outside world. This can either be done by publishing Capabilities in the same way OGC standards do this (WMS, WFS, WaterML) or by configuration such as the FewsPiService does this.

Security

To secure access to the Data Access Component or to individual webservices there are standards provided by the Servlet container. We will make use of these standards wherever and whenever required.

Installation

Here follows a list of applications that need to be installed in order to use the DAC:

Java

Download the latest stable release for the JRE (version 1.6.23 or higher).

Tomcat

Download the latest stable release for Tomcat (version 6.0.35 or higher).

Fews bin + region home

Install a Fews bin directory and Region Home directory as you would for an Operator Client. Make sure these directories are accessible from the Tomcat installation. In the Region Home directory copy the files 'clientConfig.xml' and 'log4j.properties' shown below. Change the values in marked in pink to match the values of your system.

clientConfig.xml:

_

N.B.: The DAC is no longer available since FEWS 2017.02

The FEWS Data Access Component (DAC) is a web application that allows Webservices to directly access the FEWS system. The DAC communicates directly with the FEWS data store component. The database is created and updated by a FEWS Operator Client system.

Webservices hosted in a Tomcat container can access the DAC and exchange data with the underlying FEWS system.


code
Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>

<clientConfiguration xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/clientConfig.xsd">

    <databaseServer>                             

        <!—Keuze uit: postgresql, oracle of sqlserver -->

         <dbServerType>postgresql</dbServerType>                              

         <dbServerName>db_serverhostname</dbServerName>

         <dbServerPort>db_port </dbServerPort>

         <dbInstanceName>database name</dbInstanceName>

         <dbInstanceUser>user</dbInstanceUser>

         <!-- <dbInstancePassword>clear text password</dbInstancePassword> -->

         <dbInstanceEncryptedPassword>encrypted password</dbInstanceEncryptedPassword>

       </databaseServer>

</clientConfiguration>

...

	<databaseServer>
		<!--jdbc url. jdbc:postgresql://host:port/database OR jdbc:oracle:thin:@//host:port/service_name OR jdbc:oracle:thin:@host:port:SID OR jdbc:oracle:thin:@TNSName OR jdbc:jtds:sqlserver://host:port/database, use DBVisualizer to test the url-->
		<url>jdbc:oracle:thin:@dummy_hostname:1521:dummy_databasename</url>
		<user>dummy_username</user>
                <!-- use F12 in explorer to encrypt password--->
		<encryptedPassword>dummy_password_encrypted</encryptedPassword>
	</databaseServer>
	<!-- The JMSServer section is only required for the writing of timeseries
     For a read only instance this section must be omitted. -->
	<jmsServer>
		<appServerType>jboss</appServerType>
		<appServerName>dummy_hostname_2</appServerName>
		<appServerPort>1099</appServerPort>
		<rootJNDI>/wd/nz/mc00/</rootJNDI>
	</jmsServer>
	<localCacheSizeMB>500</localCacheSizeMB>
</clientConfiguration>