SIF Context

A Context is optional Data Model-specific metadata that may accompany a service consumer request as a way of further scoping and/or restricting the possible service provider to respond to the request. For example, a supplied Context might indicate that the Student Schedule Provider Service being requested in Zone XYZ is the one dealing with next term’s data, rather than the current one.

A Context consists of a unique (name for a given type of Service in a given Zone), which is used by the Service Consumer when a request on that service is invoked. It also has an associated description and a set of parameter names and values, which may be defined by the Data Model the Service Provider conforms to and is contained in the entry for that service in the Provider Registry.

Contexts are not global: they apply only to a specific Service Provider instance assigned to a specific/single Zone.  A Zone can contain multiple Object Service Providers for the same data object, each offering its data in a differently named context.

Uniqueness

Taken together, the Zone, Service Type and Context combine to identify a unique Service Provider instance (included in the Service Provider Registry) which the Consumer can make requests of. There can be only one Service of a given type with a given Context in any one Zone.

The Consumer can include at most a single Context in any given request.  If there is no matching Service Provider that supports the specified Context for the specified Service Provider type in the specified (or default) Zone, the Request must fail with and HTTP status 404 (Not Found).

Default Context

The name of the default Context is DEFAULT, and that is unique as well. If a Service Instance has no Context defined, requests to that Service instance must either not include a Context Name element or have it set to DEFAULT in the request URL.  The Zone and Service type (and the lack of a Context) provide all the information needed to determine the destination for that request.


Conveying Context

A Service Consumer conveys the Context name in the form of a Matrix Parameter. The name of the matrix parameter is “contextId”.

Example: Getting all “future” students. The context name in this case is called “future”.

HTTP GET https://.../students;contextId=future