package ari
This ari defines the key abstractions for automatic resource inclusion as well as GraphQL.
The system is split up into 3 distinct layers:
+---------------------------------------------------------------------+ | Presentation Layer | | GraphQL | Naptime HTTP | +------------------------------+--------------------------------------+ | | | Inclusion Engine | | | +---------------------------------------------------------------------+ | Data fetching | | Local execution | remote execution | +=====================================================================+ | | | Unmodified Naptime APIs | | | +---------------------------------------------------------------------+
A request enters the system via the presentation layer (typically parsed from the network). The presentation layer constructs a org.coursera.naptime.ari.Request and passes that to engine. The engine performs a number of validations against the schema, and then makes a number of requests to to the Data Fetching layer to assemble all of the (available) data required to construct a response. This is passed back to the presentation layer, which constructs a response to be sent out on the wire.
The API between the presentation layer and the inclusion engine is the org.coursera.naptime.ari.EngineApi
The API between the inclusion engine and the data fetching layer is defined by org.coursera.naptime.ari.FetcherApi.
BEWARE: This code is currently in a high state of flux. Do not depend upon it unless you are prepared for breakages!
- Alphabetic
- By Inheritance
- ari
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
FetcherApi extends AnyRef
The fetcher calls the Naptime APIs (either local or remote) to acquire all of the data necessary.
- case class FetcherError(code: Int, message: String, url: Option[String]) extends Product with Serializable
-
case class
FullSchema(resources: Set[Resource], types: Set[DataSchema]) extends Product with Serializable
Contains the complete set of static type information to fully specify a Naptime service.
Contains the complete set of static type information to fully specify a Naptime service.
- resources
The Resource schemas for all available resources.
- types
All of the data types that compose the service.
-
class
LocalSchemaProvider extends SchemaProvider with StrictLogging
Implements a default schema provider for local-only ARI operation.
-
case class
Request(requestHeader: RequestHeader, resource: ResourceName, arguments: Set[(String, JsValue)], authOverride: Option[AuthOverride]) extends Product with Serializable
This encapsulates all of the information needed to compute a response.
This encapsulates all of the information needed to compute a response.
- requestHeader
The request header is used for authentication parsing in the underlying requests made. Path and query parameters included in the request header are ignored in favor of the data within the topLevelRequests fields.
- resource
The name and version of the resource that this request is hitting
- arguments
A list of query parameters to be used on the request. These are used to differentiate between various endpoints (i.e. multiget, finder, etc.).
-
case class
Response(data: List[DataMap], pagination: ResponsePagination, url: Option[String]) extends Product with Serializable
This model represents a response from a Request, including elements and pagination
This model represents a response from a Request, including elements and pagination
- data
A list of elements in the response, in the order that they're returned
- pagination
The response pagination information (including total and next)
- url
The source url that was used to make the request. This is implementation specific by the fetcher, so it cannot be part of the Request.
-
trait
SchemaProvider extends AnyRef
Provides the metadata required to power the engine.
Provides the metadata required to power the engine.
For local-only operation, a LocalSchemaProvider implements this interface. For distributed operations, a more sophisticated SchemaProvider must be implemented.
Value Members
- object FullSchema extends Serializable
- object Response extends Serializable