KnetMiner consists of several _common _components in the common/
folder. They are:
- server-datasource-api : containing shared definitions and data structures for all parts of KnetMiner
- server-datasource-ondexlocal : an Ondex-specific in-memory implementation of server-datasource
- server-datasource : an abstract definition of how a KnetMiner data source should function
- server-base : the abstract base code used to build and deploy a KnetMiner server
- ws-example : an example implementation of a KnetMiner server/ web services
- client-base : the abstract base code used to build and deploy a KnetMiner client
The fundamental unit of KnetMiner is a datasource
. These are implementations of the KnetminerDataSource
abstract class from the API. Implementing classes must be in the package rres.knetminer.datasource.provider
or any sub-package of it.
The most basic data source can extend this class directly. Others may have common requirements, such as an Ondex index, which can be provided by implementing an intermediate class then extending that instead. An example of this intermediate approach is the server-datasource-ondexlocal
package which provides OndexLocalDataSource
. Intermediate classes do not have to be in the correct package as long as the final implementing class is.
Note that one data source implementation can in principle provide several data sources, specified in the constructor then checked in the name of the datasource passed to its methods at runtime.
Each datasource
is built into a maven package. These maven packages are then declared as dependencies in the server, i.e. in the ws-example pom.xml file. The server is then compiled into a WAR. The declared depdendent datasources are _auto-detected _at runtime when the server WAR is deployed into Tomcat. Multiple server WARs can be installed into the _same _Tomcat as long as their datasource names do _not _conflict.
This project is just an example implementation of server-base. It should be renamed for production use and cloned as many times as necessary for each local instance required, e.g, in the species folders as in wheat/ws
, etc.. The datasources it provides are configured in its pom.xml
file.
The server is controlled via KnetminerServer in server-base. New endpoints can be added here by adjusting the pattern recognition or adding new methods with appropriate annotations. Incoming data is always JSON
, the format of which is allowed for by KnetminerRequest
in server-datasource-api
. This one class contains all possible input parameters and suitable non-null defaults for each, regardless of which ones are used by which request. Responses are always JSON
and defined by implementations of KnetminerResponse
in server-datasource-api
.