Interfaces and exception classes used by LAPPS.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main/java/org/lappsgrid/api
.gitignore
COPYRIGHT
LICENSE.txt
Makefile
README.md
pom.xml

README.md

The LAPPS Grid API

Interfaces and exception classes used by the LAPPS Grid.

Maven Central

Maven

	<dependency>
		<groupId>org.lappsgrid</groupId>
		<artifactId>api</artifactId>
		<version>2.0.1</version>
	</dependency>

The LAPPS Grid API defines a single main interface: WebService:

public interface WebService {
    String getMetadata();
    String execute(String input);
}

and two naming interfaces, that is, interfaces that extend WebService but do not add any methods of their own:

public interface DataSource extends WebService { }

public interface ProcessingService extends WebService { }

All LAPPS Grid services exchange Data object as JSON strings. The main difference between a DataSource and a ProcssingService is how the Data objects are interpreted in the execute method.

  • ProcessingServices accept an input document and produces an output document. The discriminator field is used to specify the format of the data in the payload.
  • DataSources provide data. The discriminator will be a URI specifying the action the DataSource is to perform. For example, the DataSource may be asked to return a single document or provide a list of ID values for all documents available from the DataSource.

For example:

DataSource source = ...
ProcessingService tokenizer = ...
Data<String> data = new Data<>("http://vocab.lappsgrid.org/ns/get", "MASC3-0202");
// Fetch some data.
String json = source.execute(data.asJson())
// Process some data.
String response = tokenizer.execute(json)