|
SPASE Registry Server
The SPASE Registry Server is a java application which can harvest resource descriptions
expressed in SPASE XML and provide a search service for this descriptions. It can also chain
to other registry servers and aggregate all results, returning all matches in a self-organized network
of registry servers. It can be run as either a servlet or bean. It uses the
SPASE XML Parser packge to harvest resource descriptions.
Try the demonstration registry server.
Documentation
Application
registry.jar
(also igpp.jar,
parser120.jar,
servlet.jar)
Source, documentation and compiled classes that implement the parser.
After downloading, running the command:
java -Djava.ext.dirs="." spase.registry.Manager
from the same directory where the files were downloaded will read all the descriptions
at the location specified in the default configuration file and run a blank query
against the harvested descriptions. This will display a set of ResourceProfile descriptions for each resource.
If you place the jar files in the default search directory in the CLASSPATH then the '-Djava.ext.dirs="."' can be omitted.
This has been done for subsequent example for simplicity.
To run the manager with a specific configuration file use the command:
java spase.registry.Manager registry.conf
which will use the configuration file "registry.conf"
Note: The class files were compiled using JDK1.5 and the source code uses features found only in JDK1.5 and above.
You will also need the IGPP support jar file: igpp.jar
the SPASE XML parser for verion 1.2.0 of the data model: parser120.jar,
and the Sun Java Servlet jar file: Available here
Deploying the Registry Service
The registry service can be deployed in multiple environments.
- It can run from the command line with:
java spase.registry.Manager
- Run as bean in a JSP page with:
<%@ page language="java" contentType="text/html"
import="spase.registry.Manager"
%><jsp:useBean id="registry" class="spase.registry.Manager" scope="application"><% registry.init(application.getRealPath(""), null); %></jsp:useBean><%
// We pack this import and bean tags into "one" line
// so that we can download files when needed
registry.doAction(request, response);
%>
- Run as a servlet
Configuration file
The Registry server is configurable. The configuartion information can be stored in
any file, but the default name for this file is "registry.conf". It is an XML file with the following tags:
| ID | : The identifier for this registry.
| | Path | : The path to the where resource descriptions are stored.
This location is scanned for "srd" files. |
| ReloadTrigger | : If a file name with this value appears at ResourcePath
then all resources are reloaded and the reload trigger
file is removed. (Default: reload.txt) |
| Extension | : The file name extension for resource descriptions.
(Default: .srd) |
| Description | : A brief description of this registry. |
| NextRegistry | : The URL to other registries to search. |
|
| ID | : The identifier for this registry. |
| URL | : The web location of the registry service. |
|
An example configuration file is: (download)
<?xml version="1.0" encoding="UTF-8"?>
<Registry>
<ID>Local</ID>
<Path>./data</Path>
<ReloadTrigger>reload.txt</ReloadTrigger>
<Extension>.xml</Extension>
<Description>Local resource descriptions</Description>
<NextRegistry>
<ID>SPASE</ID>
<URL>http://www.spase-group.org/tools/registry/demo.jsp</URL>
</NextRegistry>
</Registry>
This configuration file will
- look in the "data" directory in the directory where the Registry server is run for registry descriptions.
- When the file "reload.txt" appears in this directory the contents will be reloaded by the registry server.
- All files with the extension ".xml" will be considered resource descriptions and will be parsed.
- After looking at local resources the request will be passed on to the next registry located at the SPASE web site.
Registry Search Results
Search results come in two forms. The first is a ResourceProfile which is a summary of a Resource description.
A ResourceProfile has the form:
<ResourceProfile>
<RegistryID></RegistryID>
<ResourceType></ResourceType>
<ResourceID></ResourceID>
<ResourceName></ResourceName>
<ReleaseDate></ReleaseDate>
<StartDate></StartDate>
<StopDate></StopDate>
<Score></Score>
<AccessURL></AccessURL>
<Description></Description>
<ParentID></ParentID>
</ResourceProfile>
The other is a full Resource description which is described XML Schema
for the SPASE Data Model.
All search results are wrapped in a <Response> tag.
Also included in the response are
- A list of registries visited. The ID of each registry is placed in <Visited> tags.
- A count of the number of matches in <Matches> tags.
- A setting for the maximum number of matches to return in <TopLimit> tags.
- A count of the number seconds which have elapsed while processing the request in <Elapsed> tags.
- A list of the words matched in <Words> tags.
Other command line examples:
After downloading the command:
java spase.registry.Manager registry.conf Words="Mangetosphere Online"
will return ResourceIndex descriptions for all resources which contain the words "Magnetometer" and "Online".
java spase.registry.Manager registry.conf Words="Mangetometer Online" match=any
will return ResourceIndex descriptions for all resources which contain the words "Magnetometer" or "Online".
java spase.registry.Manager registry.conf ResourceName=Galileo
will return ResourceIndex descriptions for all resources with a ResourceName of "Galileo".
java spase.registry.Manager registry.conf ResourceID=spase://vmo/Observatory/Galileo
will return full Resource description the resource with the ID of "spase://vmo/Observatory/Galileo".
|