@@ -19,10 +19,10 @@ For the complete list of endpoint addresses implemented please refer to section
19
19
Request processing
20
20
--------------------
21
21
22
- In the course of normal operation, node software receives *HTTP GET * and *HTTP HEAD * requests to the **/TAP/sync **
23
- endpoint and must respond to them with valid XSAMS documents or only response headers respectively .
22
+ During normal operation, node software receives *HTTP GET * and *HTTP HEAD * requests to the **/TAP/sync **
23
+ endpoint. As a response to a request a valid XSAMS document and/ or the HTTP response headers are sent .
24
24
25
- The figure below presents a request flow and what components are involved in the request processing.
25
+ The figure below presents the request flow, * highlighting * the components involved in the request processing.
26
26
27
27
.. image :: img/queryProcess.png
28
28
@@ -37,7 +37,9 @@ To access the **database**, the Apache Cayenne object-relational mapping framewo
37
37
A tree of objects is constructed, representing the logical structure of the query.
38
38
For more details please refer to the :ref: `Query ` section.
39
39
40
- * **Framework ** asks **Plugin ** to construct the document by calling the :ref: `databasePlug ` buildXSAMS() method.
40
+ * **Framework ** asks **Plugin ** to construct the document by calling the :ref: `databasePlug `
41
+ buildXSAMS(RequestInterface incomingRequest) method. All the query information is accessible via the
42
+ RequestInterface object passed as a parameter.
41
43
42
44
* **Plugin ** maps the incoming query logical tree into one or more **Database ** queries,
43
45
as described in the :ref: `QueryMap ` section.
@@ -60,7 +62,7 @@ Plugin and Framework Interfaces
60
62
Interaction between the database plugin and the Java node software is performed through two interfaces:
61
63
62
64
* :ref: `DatabasePlug `
63
- defined in the **org.vamdc.tapservice.api.DatabasePlug ** java interface and implemented by the node developer.
65
+ defined in the **org.vamdc.tapservice.api.DatabasePlugin ** java interface and implemented by the node developer.
64
66
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.
65
67
66
68
* :ref: `RequestInterface `
@@ -73,34 +75,32 @@ Interaction between the database plugin and the Java node software is performed
73
75
DatabasePlugin interface
74
76
++++++++++++++++++++++++++++
75
77
76
- Each and every node plugin must implement the **org.vamdc.tapservice.api.DatabasePlug **
78
+ Each and every node plugin must implement the **org.vamdc.tapservice.api.DatabasePlugin **
77
79
interface, defining the following methods:
78
80
79
81
* **public abstract Collection<Restrictable> getRestrictables(); **
80
82
81
- get restrictables supported by this node.
82
- Must return a collection of **org.vamdc.dictionary.Restrictable ** dictionary elements.
83
+ Must return a collection of **org.vamdc.dictionary.Restrictable ** dictionary keys that are supported by the node.
83
84
This method is called once per each request to the */TAP/sync * and */VOSI/capabilities * endpoints.
84
85
85
86
* **public abstract void buildXSAMS (RequestInterface userRequest); **
86
87
87
- Build XSAMS document tree from the user request.
88
+ Build the XSAMS document tree corresponding to the incoming request.
88
89
Object implementing :ref: `RequestInterface `
89
90
is passed as a parameter. No return is expected.
90
91
This method is called every time the node software is receiving an *HTTP GET * request to the */TAP/sync? * endpoint.
91
92
92
- **WARNING! ** Node plugin object is instantiated only once when the node is started,
93
+ **WARNING! ** Node plugin class is instantiated only once when the node is started,
93
94
all calls to buildXSAMS should be thread-safe to handle concurrent requests correctly.
94
95
95
96
Implementation details are covered in the :ref: `XSAMSGen ` section.
96
97
97
98
* **public abstract Map<Dictionary.HeaderMetrics,Integer> getMetrics(RequestInterface userRequest); **
98
99
99
- Get query metrics. This method is called every time
100
- the node receives the HEAD request to the */TAP/sync? * endpoint.
100
+ Get the metrics corresponding to a query. This method is called for every incoming HEAD request to the */TAP/sync? * endpoint.
101
101
*RequestInterface userRequest * parameter is identical to the one passed to buildXSAMS method.
102
102
This method should return a map of VAMDC-COUNT-* HTTP header names and their estimate values.
103
- For the header names and meaning, see [VAMDC-TAP ]_ documentation
103
+ For header names and meaning, see the [VAMDC-TAP ]_ documentation section DataAccessProtocol.
104
104
105
105
106
106
* **public abstract boolean isAvailable(); **
@@ -120,27 +120,28 @@ interface, defining the following methods:
120
120
RequestInterface interface
121
121
+++++++++++++++++++++++++++++++
122
122
123
- Calls to the node database plugin through :ref: `DatabasePlug ` get as a parameter an object
124
- implementing the **org.vamdc.tapservice.api.RequestInterface **, providing access to the request information and
125
- node software facilities.
123
+ When the incoming request arrives to Java Node Software, methods of the :ref: `DatabasePlug ` are called,
124
+ as described earlier. Methods of that interface accept as a parameter an object
125
+ implementing the **org.vamdc.tapservice.api.RequestInterface **. That interface provides the access
126
+ to the request information and the Java Node Software facilities.
126
127
127
- Following methods are part of that interface:
128
+ Following methods are part of this interface:
128
129
129
130
* **public abstract boolean isValid(); **
130
131
this method returns **true ** if the incoming request is valid and should be processed.
131
-
132
- In case of the **false ** return, node plugin should not do any processing. Query string may be saved for logging
133
- purposes.
132
+ If the returned value is **false **, the request should be considered as invalid, no processing is required.
133
+ Query string may be obtained by calling the getQueryString method and saved by the node plugin for the logging purposes.
134
134
135
135
* **public abstract Query getQuery(); **
136
- This method returns the base object of the QueryParser library. Query interface is described
137
- in the :ref: `query ` section of this document. A few shortcut methods are provided.
138
-
139
- * **public abstract LogicNode getRestrictsTree (); **
140
- The shortcut method to get the logic tree of the incoming query.
136
+ This method returns the base object of the QueryParser library, implementing the Query interface.
137
+ That interface is described in detail in the :ref: `query ` section of this document.
138
+
139
+ * **public abstract LogicNode getQueryTree (); **
140
+ This is the shortcut method returning the root element of the logic tree corresponding to the incoming query.
141
141
142
- * **public abstract Collection<RestrictExpression> getRestricts(); **
143
- The shortcut method to get all the keywords of the query, omitting the keywords relation logic.
142
+ * **public abstract Collection<RestrictExpression> getQueryKeywords(); **
143
+ This is an another shortcut method, allowing to get a collection of the keywords used in the incoming query.
144
+ The keywords relation logic is omitted.
144
145
145
146
**WARNING! ** This method should not be used as the main source of data for the query mapping since
146
147
it completely looses the query relation logic. Imagine the query::
@@ -169,22 +170,19 @@ Following methods are part of that interface:
169
170
the section **Requestables **
170
171
171
172
* **public abstract ObjectContext getCayenneContext(); **
172
- Get Apache Cayenne object context. That is the main endpoint of the Cayenne ORM library.
173
+ Returns the Apache Cayenne object context. That is the main endpoint of the Cayenne ORM library.
173
174
For more information on using the Apache Cayenne look in the sections :ref: `datamodel ` and :ref: `QueryMap `.
174
175
175
176
176
177
* **public abstract XSAMSManager getXsamsManager(); **
177
- Get XSAMS tree manager, containing several helper methods.
178
- All XSAMS branches built by the node plugin should be attached to it.
179
-
180
- * **public abstract Logger getLogger(Class<?> classname); **
181
-
182
- Get the **org.slf4j.Logger ** object. All messages/errors reporting should be done with it.
183
-
178
+ Get an instance of the XSAMS document manager. This manager contains several helper methods for building the XSAMS document.
179
+ All XSAMS branches built by the node plugin should be attached to it. Check the :ref: `XSAMSGen ` section for more details.
180
+
184
181
* **public abstract void setLastModified(Date date); **
185
182
186
- Set the last-modified header of the response. May be called anywhere during request processing
187
- for any number of times. If called more than once, the last modification date is updated only if
188
- the subsequent date is newer than communicated before.
183
+ Sets the last-modified header of the response.
184
+ This method may be called several times during the request processing.
185
+ If called more than once, the last modification date is updated only if
186
+ the subsequent date is newer than the value communicated before.
189
187
190
188
0 commit comments