Package

org.coursera.naptime

ari

Permalink

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!

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ari
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait FetcherApi extends AnyRef

    Permalink

    The fetcher calls the Naptime APIs (either local or remote) to acquire all of the data necessary.

  2. case class FetcherError(code: Int, message: String, url: Option[String]) extends Product with Serializable

    Permalink
  3. case class FullSchema(resources: Set[Resource], types: Set[DataSchema]) extends Product with Serializable

    Permalink

    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.

  4. class LocalSchemaProvider extends SchemaProvider with StrictLogging

    Permalink

    Implements a default schema provider for local-only ARI operation.

  5. case class Request(requestHeader: RequestHeader, resource: ResourceName, arguments: Set[(String, JsValue)]) extends Product with Serializable

    Permalink

    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.).

  6. case class Response(data: List[DataMap], pagination: ResponsePagination, url: Option[String]) extends Product with Serializable

    Permalink

    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.

  7. trait SchemaProvider extends AnyRef

    Permalink

    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

  1. object FullSchema extends Serializable

    Permalink
  2. object Response extends Serializable

    Permalink
  3. package engine

    Permalink
  4. package fetcher

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped