IResourceContext
Provides access to request-specific context (eg HTTP headers), session-specific context (eg authentication) and global context (eg configuration settings).
API
interface IResourceContext {
String restfulUrlFor(String url) (1)
String applicationUrlFor(String url) (2)
List<MediaType> acceptableMediaTypes() (3)
InteractionInitiatedBy interactionInitiatedBy() (4)
Where where()
ObjectAdapterLinkTo objectAdapterLinkTo()
List<List<String>> followLinks()
boolean isValidateOnly()
Restfulobjects config()
boolean canEagerlyRender(ManagedObject objectAdapter) (5)
RepresentationService.Intent intent() (6)
Optional<ManagedObject> objectAdapterForOidFromHref(String oidFromHref)
}
| 1 | restfulUrlFor(String)
Prepends with the servlet’s base URI |
| 2 | applicationUrlFor(String)
Prepends with the application’s base URI. |
| 3 | acceptableMediaTypes()
Returns the HttpHeaders#getAccept() acceptable media types as obtained from HttpHeaders . |
| 4 | interactionInitiatedBy()
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 | intent()
Applies only when rendering a domain object. |
Members
acceptableMediaTypes()
Returns the HttpHeaders#getAccept() acceptable media types as obtained from HttpHeaders .
interactionInitiatedBy()
Whether this interaction was initiated directly by a InteractionInitiatedBy#USER user (or indirectly by the InteractionInitiatedBy#FRAMEWORK framework .