Skip to content

Commit 31c4d53

Browse files
committed
Revise the intro and the architecture chapters
1 parent 4ee6eca commit 31c4d53

File tree

4 files changed

+95
-54
lines changed

4 files changed

+95
-54
lines changed

figure-source/queryProcess.odg

19.3 KB
Binary file not shown.

source/img/queryProcess.png

312 KB
Loading

source/intro.rst

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
1+
2+
This document describes the implementation and installation of a VAMDC-TAP node using the Java Node Software. It is organized to follow the node development path.
3+
Each chapter corresponds to an individual development task.
4+
5+
In the :ref:`intro`, a brief description of the components employed in the java node software implementation is given.
6+
7+
:ref:`plugin` chapter presents the architecture of the Java Node Software and gives the details on the interaction interfaces between the node software parts.
8+
9+
Setting up the development environment with the TAPValidator program is described in the :ref:`plugintest` chapter.
10+
11+
The first development task is to access the data in the database. Apache Cayenne library is used to perform this task. The process is briefly described in the
12+
chapter :ref:`datamodel`.
13+
Once the access to the data is established, one may proceed to building the XSAMS elements from the database objects, as described in the chapter :ref:`XSAMSGen`.
14+
The last development task is to define the mapping between the incoming VSS2 queries and the internal database queries.
15+
The chapter :ref:`QueryHandling` describes that mapping in detail.
16+
17+
By this moment, node plugin should be capable of producing the XSAMS documents in response to incoming queries.
18+
Final development task is to implement special queries used to estimate if the database contains data for a given VSS2 request.
19+
It is described in the :ref:`metrics` chapter.
20+
21+
The last chapter and last task is to install the node web service (:ref:`deploy`).
22+
23+
24+
125
.. _intro:
226

27+
328
Introduction
429
=============
530

631
Java implementation of the VAMDC-TAP node software was created in parallel with the Python version to pursue several objectives:
732

833
* Insure that standards are complete and contain no implementation-specific elements
934

10-
* Give a choice of the implementation to database maintainers
35+
* Give a choice of an implementation to node maintainers
1136

1237
* Employ the schema-based DOM XML generator to ensure the document validity.
1338
It presents an alternative approach to the keywords dictionary as used in Python/Django node software - see below the :ref:`diff` section
@@ -43,14 +68,16 @@ Additional libraries were developed within the VAMDC project are part of Java VA
4368
providing object-oriented view on a query string;
4469

4570
* Query mapping library,
46-
providing basic support for queries mapping to node database queries using Apache Cayenne objects.
71+
providing basic support for mapping of incoming queries to the node database queries using Apache Cayenne objects.
4772

4873
* XSAMS helper library,
4974
providing convenience methods for output XML generator implementation;
5075

51-
* Web application, .war archive integrating all libraries
76+
* Web application,
77+
.war archive integrating all libraries
5278

53-
* VAMDC-TAP service validation tool, may be used for node software testing
79+
* TAPValidator,
80+
VAMDC-TAP service validation tool that may be used for node plugin testing on all phases of development.
5481

5582

5683
Node-specific components
@@ -59,23 +86,17 @@ Node-specific components
5986
In Java node software each node installation requires creating two libraries:
6087

6188
#. Database Access Objects using Apache Cayenne.
62-
This task is well described in the Apache Cayenne documentation [CAYDOC]_ . A fancy graphical tool is provided.
89+
This task is well described in the Apache Cayenne documentation [CAYDOC]_ .
90+
A graphical tool is provided allowing to define the database structure and relations.
91+
Java classes corresponding to table entities are generated using this tool.
6392

6493
#. Node plugin,
6594
A piece of software that implements the node plugin interfaces and integrates with Java VAMDC Node Software application.
6695
Node plugin is responsible for a query translation into the database-specific queries and for building the appropriate XSAMS tree
6796
from the fetched database access objects.
6897

6998

70-
This document is dedicated mostly to describe how to implement and deploy a node plugin.
71-
72-
For the approximate estimation of the required amount of node-specific code, the following numbers should be considered:
7399

74-
* BASECOL node plugin - total of ~1600 lines of code;
75-
76-
* KIDA node plugin - total of ~1500 lines of code;
77-
78-
For all nodes those numbers do not include the autogenerated database model classes.
79100

80101
Comparison with the python/django node software
81102
----------------------------------------------------
@@ -153,33 +174,30 @@ Node implementation
153174

154175
Implementing a node with the Java Node Software would require the following steps:
155176

156-
* Create database model and classes, as described in the :ref:`datamodel` section.
177+
* The database model and classes should be created, as described in the :ref:`datamodel` section.
157178

158179
After completing this step you will be able to access your database in a convenient way
159180
from any Java software you develop. For the details, see the Apache Cayenne documentation. [CAYDOC]_
160181

161-
* Set up the project for your plugin, understand the query process and interaction of the node and the plugin.
162-
See the :ref:`plugin` section.
163-
164-
* Create XSAMS tree blocks constructors and builders, as described in the :ref:`XSAMSGen` section
182+
* The development environment for the plugin should be deployed.
183+
The query process and the interaction of the node and the plugin should be understood.
184+
See the :ref:`plugin` section for the details.
165185

166-
Here you might need help from the person responsible for database to figure out what XSAMS elements
167-
are appropriate for your database content.
186+
* XSAMS tree builders should be created, as described in the :ref:`XSAMSGen` section.
187+
This work should be performed in collaboration with a person responsible for the scientific content of the
188+
database to establish the correspondance of the XSAMS elements and the database content.
168189

169-
During this step you will be able to test your node plugin: :ref:`plugintest`.
170-
Try to eliminate any validation errors.
171-
The result would be the same for all queries, but it is normal.
190+
At this step the node plugin may be tested according to the procedure described in the section :ref:`plugintest`.
191+
XSAMS generation should be verified and all the validation errors should be eliminated at this step.
172192

173-
* Define the supported restrictables and create mapping classes as described in the :ref:`QueryHandling` section.
193+
* The supported restrictables and corresponding mappings should be defined, as described in the :ref:`QueryHandling` section.
174194

175-
When this step will be accomplished, you are more than half way through the implementation process.
176-
You can test different queries and check if you are getting relevant XSAMS documents as the result.
195+
Once this step is accomplished, it becomes possible to send different queries to the node.
196+
It should be checked if all the produced XSAMS documents are valid against the schema.
177197

178-
* The last development step would be to implement the query metrics
179-
to be fully compliant with the VAMDC-TAP standard.
180-
See the :ref:`metrics` section for the implementation details.
198+
* The last development step would be to implement the query metrics that are used to estimate quickly if the node has the data
199+
for a particular query or not. See the :ref:`metrics` section for the implementation details.
181200

182-
* After the node plugin is working, ask your servers manager to deploy the Java Node software
183-
on the application server, as it is described in the :ref:`deploy` section.
184-
Test again using the VAMDC-TAP Validator in the network mode.
201+
* Once the node plugin is tested and working, it may be deployed on the web server, as described in the :ref:`deploy` section.
202+
The node should be tested again with the VAMDC-TAP Validator working in the network mode.
185203

source/plugin-arch.rst

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,77 @@
11
.. _plugin:
22

3-
Database plugin
3+
Node architecture
44
=========================
55

6+
Java implementation of VAMDC-TAP node software is a web-service application implementing a RESTful interface according to VAMDC-TAP standard specification.
7+
8+
It is accessible using the HTTP protocol, with URLs like *http://node.name.tld/vamdc-tap/12_07/VOSI/capabilities* or
9+
*http://node.name.tld/vamdc-tap/12_07/TAP/sync?query=select%20species&lang=VSS2&format=XSAMS*.
10+
Here *http://node.name.tld/vamdc-tap/12_07/* is the node base url,
11+
**/VOSI/capabilities** and **/TAP/sync** are endpoint addresses, and
12+
*?query=select%20species&lang=VSS2&format=XSAMS* are HTTP request parameters.
13+
14+
For the complete list of endpoint addresses implemented please refer to section :ref:`endpoints`.
15+
16+
617
.. _requestflow:
718

819
Request processing
920
--------------------
1021

11-
In the course of normal operation, node software receives *HTTP GET* and *HTTP HEAD* requests to the */TAP/sync*
22+
In the course of normal operation, node software receives *HTTP GET* and *HTTP HEAD* requests to the **/TAP/sync**
1223
endpoint and must respond to them with valid XSAMS documents or only response headers respectively.
1324

25+
The figure below presents a request flow and what components are involved in the request processing.
26+
1427
.. image:: img/queryProcess.png
1528

16-
The following steps are performed to achieve that, Java VAMDC-TAP implementation (**Framework**)
17-
is responsible for some of them.
18-
Node **Plugin** is responsible for the others.
19-
The Apache Cayenne object-relational mapping framework is used to access the **Database**.
29+
During the request processing the few steps are performed.
30+
Java VAMDC-TAP implementation (**Framework**) handles the steps that are common for all VAMDC-TAP nodes.
31+
Node **Plugin** is responsible for the steps that are essentially node-specific.
32+
To access the **database**, the Apache Cayenne object-relational mapping framework is used.
2033

21-
* On the query reception, **framework** asks the **plugin** for the list of supported **keywords**.
34+
* On the query reception, the **framework** asks the **plugin** for the list of supported **keywords** (Restrictables).
2235

23-
* **Framework** is parsing the incoming query, checking it's validity and converting it
24-
into a group of easily accessible :ref:`Query` objects.
36+
* The **Framework** parses the incoming query. The validity of the query is checked.
37+
A tree of objects is constructed, representing the logical structure of the query.
38+
For more details please refer to the :ref:`Query` section.
2539

2640
* **Framework** asks **Plugin** to construct the document by calling the :ref:`databasePlug` buildXSAMS() method.
2741

28-
* **Plugin** maps the incoming query to one or more **Database** queries,
29-
as described in the :ref:`QueryMap`.
42+
* **Plugin** maps the incoming query logical tree into one or more **Database** queries,
43+
as described in the :ref:`QueryMap` section.
3044

31-
* Before executing or mapping the queries, **Plugin** *should* check
32-
if the user actually requested the certain branch of XSAMS document to be built.
33-
See the :ref:`RequestInterface` checkBranch() method for the details.
34-
35-
* **Plugin** receives objects from the **Database**, builds **XSAMS** blocks from them and
36-
gives those blocks to the **Framework**. See the :ref:`XSAMSGen` section for the details.
45+
* **Plugin** queries the **database** and retreives **Apache Cayenne** data objects.
46+
**XSAMS** elements are built from those data objects and are attached to the XSAMS document tree.
47+
See the :ref:`XSAMSGen` section for the details.
3748

3849
* When the document tree is built, **Plugin** returns the control to the **Framework**.
3950

40-
* **Framework** does the final checks on the document tree, calculates accurate metrics for the document.
51+
* The **Framework** does the final checks on the document tree and calculates the accurate metrics for the document.
52+
53+
* The **Framework** converts the document tree into XML stream and sends it to the client.
54+
55+
56+
.. _Interfaces:
57+
Plugin and Framework Interfaces
58+
---------------------------------
4159

42-
* **Framework** converts the document tree into XML stream and sends it to the user.
60+
Interaction between the database plugin and the Java node software is performed through two interfaces:
4361

62+
* :ref: `DatabasePlug`
63+
defined in the **org.vamdc.tapservice.api.DatabasePlug** java interface and implemented by the node developer.
64+
Methods of this interface are called by the node software upon the arrival of a VAMDC-TAP request or during the initial startup and operation checks.
4465

45-
Interaction between the database plugin and the Java node software is performed through two compact interfaces.
66+
* :ref: `RequestInterface`
67+
defined in the **org.vamdc.tapservice.api.RequestInterface** java interface and implemented in the web-service framework.
68+
This interface is available to the node plugin to get the request information and feed the XSAMS blocks constructed.
4669

4770

4871
.. _DatabasePlug:
4972

5073
DatabasePlugin interface
51-
------------------------
74+
++++++++++++++++++++++++++++
5275

5376
Each and every node plugin must implement the **org.vamdc.tapservice.api.DatabasePlug**
5477
interface, defining the following methods:
@@ -95,7 +118,7 @@ interface, defining the following methods:
95118
.. _RequestInterface:
96119

97120
RequestInterface interface
98-
-------------------------------
121+
+++++++++++++++++++++++++++++++
99122

100123
Calls to the node database plugin through :ref:`DatabasePlug` get as a parameter an object
101124
implementing the **org.vamdc.tapservice.api.RequestInterface**, providing access to the request information and

0 commit comments

Comments
 (0)