IResourceContext

Provides access to request-specific context (eg HTTP headers), session-specific context (eg authentication) and global context (eg configuration settings).

API

IResourceContext.java
interface IResourceContext {
  String restfulUrlFor(String url)     (1)
  String applicationUrlFor(String url)     (2)
  List<MediaType> getAcceptableMediaTypes()     (3)
  InteractionInitiatedBy getInteractionInitiatedBy()     (4)
  Where getWhere()
  ObjectAdapterLinkTo getObjectAdapterLinkTo()
  List<List<String>> getFollowLinks()
  boolean isValidateOnly()
  Restfulobjects config()
  boolean canEagerlyRender(ManagedObject objectAdapter)     (5)
  RepresentationService.Intent getIntent()     (6)
  Optional<ManagedObject> getObjectAdapterForOidFromHref(String oidFromHref)
}
1 restfulUrlFor(String)

Prepends with the servlet’s base URI

2 applicationUrlFor(String)

Prepends with the application’s base URI.

3 getAcceptableMediaTypes()

Returns the HttpHeaders#getAcceptableMediaTypes() acceptable media types as obtained from HttpHeaders .

4 getInteractionInitiatedBy()

Whether this interaction was initiated directly by a InteractionInitiatedBy#USER user (or indirectly by the InteractionInitiatedBy#FRAMEWORK framework .

5 canEagerlyRender(ManagedObject)

To avoid infinite loops when eagerly rendering graphs of objects as DomainObjectReprRenderer#asEventSerialization() events .

6 getIntent()

Applies only when rendering a domain object.

Members

restfulUrlFor(String)

Prepends with the servlet’s base URI

applicationUrlFor(String)

Prepends with the application’s base URI.

getAcceptableMediaTypes()

Returns the HttpHeaders#getAcceptableMediaTypes() acceptable media types as obtained from HttpHeaders .

getInteractionInitiatedBy()

Whether this interaction was initiated directly by a InteractionInitiatedBy#USER user (or indirectly by the InteractionInitiatedBy#FRAMEWORK framework .

canEagerlyRender(ManagedObject)

To avoid infinite loops when eagerly rendering graphs of objects as DomainObjectReprRenderer#asEventSerialization() events .

getIntent()

Applies only when rendering a domain object.