public class RestContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected JAXRSApplication |
mApplication |
protected atg.service.jaxrs.ETagService |
mETagService
A reference to an ETag service component.
|
protected boolean |
mGenerateETags
Flag when true we will generate ETags for responses we build
|
protected boolean |
mGetForUpdate
property: getForUpdate
|
protected java.lang.Object |
mOutputObject |
protected java.util.Stack<java.lang.String> |
mRelPath
property: relPath
|
protected RestException |
mRestException
rest exception if any occurred in this context
|
Constructor and Description |
---|
RestContext()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSupplementaryPayloadSchemaPropertyName(java.lang.String pName)
Adds a name to the set the supplementary schema property names property.
|
ListingRequest |
buildListingRequest()
Uses the RestContextBuilder to build a ListingRequest object that contains
the query params from the request.
|
atg.service.payloadschema.filter.FilteringContext |
createFilteringContext()
Creates a filtering context object based on this current rest context
|
JAXRSApplication |
getApplication()
Gets the jaxrs application that is in context for the current request.
|
Link |
getCollectionLink()
Returns the link for the current collection in context
This can then be used by member resources for their 'collection' link.
|
static RestContext |
getCurrentContext()
Returns the JAXRSContext associated with the current thread.
|
java.lang.String |
getDeveloperOverrideFilterId()
Returns the id for the filter set by the developer on the representation model
to override the default filter for the current resource
|
org.json.JSONArray |
getEmbeddedETag()
Returns property embeddedETag.
|
java.lang.String |
getEndpointFilterId()
Gets the filter id configured in the Endpoint annotation for the current resource
|
java.lang.Object |
getEndpointProxy()
Returns EndpointProxy
|
RestResourceRegistry.EndpointSettings |
getEndpointSettings()
get EndpointSettings
|
atg.service.jaxrs.ETagService |
getETagService()
Returns a reference to an ETag service component
|
java.lang.String |
getETagValue()
get ETagValue
|
java.util.Set<java.lang.String> |
getExclude()
Getter for the set of string names of properties or relations the response should definitely exclude.
|
java.util.Set<java.lang.String> |
getExpandResources()
Returns a set of the expand parameters set on the URL
|
java.util.Set<java.lang.String> |
getFields()
Getter for the set of string names of properties or relations the response should be constrained to.
|
int |
getFilterDepth()
Returns the depth at which to filter the current resource
|
int |
getFilterDepthForContext()
Gets the depth with which to filter the current resource to.
|
java.lang.String |
getFilterId()
Gets the filter id for the current resource
|
org.json.JSONObject |
getInputJson()
Returns property inputJson.
|
java.util.Set<java.lang.String> |
getLinks()
Returns a set of the link parameters set on the URL
|
LinkUtils |
getLinkUtils()
Reference to the current context
LinkUtils component. |
ListingRequest |
getListingRequest()
Returns ListingRequest
|
ListingResponse |
getListingResponse()
Returns ListingResponse
|
java.io.Serializable |
getLockKey()
Return the current lock key
|
java.lang.Object |
getLockOwner()
Return the current lock owner
|
atg.service.jaxrs.RestLockService.LockType |
getLockType()
get LockType
|
int |
getNestingDepth()
Returns the current nesting depth relative to the root resource
|
java.lang.Object |
getOutputObject()
Returns the output object.
|
java.lang.String |
getOverrideFilterId()
Returns the id for the filter to override the default filter for
the current resource
|
java.util.Stack<java.lang.String> |
getRelPath()
Stack of rel names leading to the current resource in context.
|
java.util.Set<java.lang.String> |
getRequestAccepts()
Set of string Accept media types for the current request
|
ContainerRequestContext |
getRequestContext()
Returns property requestContext.
|
<any> |
getRequestHeaders()
Returns property headers.
|
ResourceInfo |
getResourceInfo()
Returns property resourceInfo.
|
java.lang.String |
getResourceKey()
Sets the unique string that identifies a specific endpoint method
It is determined from the hash of the Method itself.
|
protected atg.service.jaxrs.RestUpdateInfo.RestResourceUpdateInfo |
getResourceUpdateInfo()
Returns a ResourceUpdateInfo object containing
property values changes from validated message input
|
int |
getResourceVersion()
Returns the current version of a resource
|
java.lang.Object |
getResponse()
Gets the response.
|
MediaType |
getResponseMediaType()
Returns the media type for the response
|
RestException |
getRestException()
Getter for the rest exception if any occurred in this context
|
RestResourceRegistry |
getRestResourceRegistry()
Reference to the current context
RestResourceRegistry component. |
RestUtils |
getRestUtils()
Reference to the current context
RestUtils component. |
static int |
getStackSize()
Returns the context thread local stack size
|
java.util.Set<java.lang.String> |
getSupplementaryPayloadSchemaPropertyNames()
Gets the supplementary schema property names property.
|
java.lang.String |
getUriPath()
get UriPath
|
boolean |
isBypassTokenSecurity()
Returns the bypass token security property.
|
boolean |
isGenerateETags()
Getter for a flag which when true we will generate ETags for response resources we output for this request.
|
boolean |
isGetForUpdate()
Returns true if the getForUpdate query parameter was passed in for this request as true.
|
boolean |
isJsonRequest()
Examines the headers sent on the request to see if the data sent
was a JSON payload.
|
boolean |
isRepresentationModelResponse()
Checks if a representation model response has been set
|
static RestContext |
popCurrentContext()
Removes the JAXRSContext associated with the current thread from the stack
|
static RestContext |
popCurrentContext(boolean pOnlyIfTop) |
void |
setApplication(JAXRSApplication pApplication)
Sets the jaxrs application that is in context for the current request.
|
void |
setBypassTokenSecurity(boolean pBypassTokenSecurity)
Sets the bypass token security property.
|
void |
setCollectionLink(Link pCollectionLink)
Sets the link for the current collection in context
This can then be used by member resources for their 'collection' link.
|
static void |
setCurrentContext(RestContext pContext)
set the JAXRSContext associated with the current thread.
|
void |
setDeveloperOverrideFilterId(java.lang.String pDeveloperOverrideFilterId)
Sets the id of the filter set by the developer on the representation model
to override the default filter for the current resource
|
void |
setEmbeddedETag(org.json.JSONArray pEmbeddedETag)
Sets property embeddedETag.
|
void |
setEndpointProxy(java.lang.Object pEndpointProxy)
Sets property EndpointProxy.
|
void |
setEndpointSettings(RestResourceRegistry.EndpointSettings pEndpointSettings)
set EndpointSettings
|
void |
setETagService(atg.service.jaxrs.ETagService pETagService)
Sets a reference to an ETag service component
|
void |
setETagValue(java.lang.String pETagValue)
set ETagValue
|
void |
setExclude(java.util.Set<java.lang.String> pExclude)
Setter for the list of string names of properties or relations the response should definitely exclude.
|
void |
setExpandResources(java.util.Set<java.lang.String> pExpandResources)
Sets the set of expand parameters passed via the URL
|
void |
setFields(java.util.Set<java.lang.String> pFields)
Setter for the set of string names of properties or relations the response should be constrained to.
|
void |
setFilterDepth(int pFilterDepth)
Sets the depth at which the current resource is to be filtered.
|
void |
setGenerateETags(boolean pGenerateETags)
Setter for a flag which when true we will generate ETags for response resources we output for this request.
|
void |
setGetForUpdate(boolean pGetForUpdate)
Set to true if the getForUpdate query parameter was passed in for this request as true.
|
void |
setInputJson(org.json.JSONObject pInputJson)
Sets property inputJson.
|
void |
setLinks(java.util.Set<java.lang.String> pLinks)
Sets the list of link parameters passed via the URL
|
void |
setLockKey(java.io.Serializable pLockKey)
Set the current lock key
|
void |
setLockOwner(java.lang.Object pLockOwner)
Set the current lock owner
|
void |
setLockType(atg.service.jaxrs.RestLockService.LockType pLockType)
set LockType
|
void |
setOutputObject(java.lang.Object pOutputObject)
Sets the output object.
|
void |
setOverrideFilterId(java.lang.String pOverrideFilterId)
Sets the id of the filter to override the default filter for the
current resource
|
void |
setRelPath(java.util.Stack<java.lang.String> pRelPath)
Stack of rel names leading to the current resource in context.
|
void |
setRequestContext(ContainerRequestContext pRequestContext)
Sets property requestContext.
|
void |
setRequestHeaders(<any> pRequestHeaders)
Sets property request headers.
|
void |
setResourceInfo(ResourceInfo pResourceInfo)
Sets property resourceInfo.
|
void |
setResourceKey(java.lang.String pResourceKey)
Sets the unique string that identifies a specific endpoint method.
|
void |
setResourceUpdateInfo(atg.service.jaxrs.RestUpdateInfo.RestResourceUpdateInfo pRequestUpdateInfo)
Sets a ResourceUpdateInfo object containing
property values changes from validated message input
|
void |
setResourceVersion(int pResourceVersion)
Sets the version of the resource to use it in the Embedded ETag generation.
|
void |
setResponse(java.lang.Object pResponse)
Sets the response.
|
void |
setResponseMediaType(MediaType pResponseMediaType)
Sets the media type for the response
|
void |
setRestException(RestException pRestException)
Setter for the rest exception if any occurred in this context
|
void |
setRestResourceRegistry(JAXRSApplication pApplication)
Sets the jaxrs application that is in context for the current request.
|
void |
setSupplementaryPayloadSchemaPropertyNames(java.util.Set<java.lang.String> pSupplementaryPayloadSchemaPropertyNames)
Sets the supplementary schema property names property.
|
void |
setUriPath(java.lang.String pUriPath)
set UriPath
|
public static final java.lang.String CLASS_VERSION
protected JAXRSApplication mApplication
protected java.lang.Object mOutputObject
protected boolean mGenerateETags
protected boolean mGetForUpdate
protected atg.service.jaxrs.ETagService mETagService
protected java.util.Stack<java.lang.String> mRelPath
protected RestException mRestException
public void setRestResourceRegistry(JAXRSApplication pApplication)
pApplication
- the jaxrs application currently in contextpublic JAXRSApplication getApplication()
public void setApplication(JAXRSApplication pApplication)
pApplication
- the jaxrs application currently in contextpublic RestResourceRegistry getRestResourceRegistry()
RestResourceRegistry
component.public LinkUtils getLinkUtils()
LinkUtils
component.
LinkUtils provides utility methods for managing links and resource references.
Default implementation is to get the LinkUtils reference from the rest resource registry.public RestUtils getRestUtils()
RestUtils
component.
RestUtils provides utility methods for endpoint developers.
Default implementation is to get the RestUtils reference from the rest resource registry.public void setRequestHeaders(<any> pRequestHeaders)
pRequestHeaders
- the request headers.public <any> getRequestHeaders()
public boolean isJsonRequest()
public void setResourceInfo(ResourceInfo pResourceInfo)
pResourceInfo
- the resource information object.public ResourceInfo getResourceInfo()
ResourceInfo
public void setRequestContext(ContainerRequestContext pRequestContext)
pRequestContext
- the request contextContainerRequestContext
public ContainerRequestContext getRequestContext()
ContainerRequestContext
public void setInputJson(org.json.JSONObject pInputJson)
pInputJson
- the input JSONJSONObject
public org.json.JSONObject getInputJson()
JSONObject
public java.lang.Object getOutputObject()
public void setOutputObject(java.lang.Object pOutputObject)
pOutputObject
- the output objectpublic void setGenerateETags(boolean pGenerateETags)
generateEmbeddedETags
query parameter to false.pGenerateETags
- true to generate ETags for response resources we output for this request.public boolean isGenerateETags()
generateEmbeddedETags
query parameter to false.public void setETagValue(java.lang.String pETagValue)
pETagValue
- the ETagValuepublic java.lang.String getETagValue()
public void setLockType(atg.service.jaxrs.RestLockService.LockType pLockType)
pLockType
- the LockTypepublic atg.service.jaxrs.RestLockService.LockType getLockType()
public boolean isGetForUpdate()
public void setGetForUpdate(boolean pGetForUpdate)
pGetForUpdate
- true if getForUpdate query parameter is truepublic void setResourceKey(java.lang.String pResourceKey)
pResourceKey
- the ResourceKeypublic java.lang.String getResourceKey()
public void setUriPath(java.lang.String pUriPath)
pUriPath
- the UriPathpublic java.lang.String getUriPath()
public void setEndpointSettings(RestResourceRegistry.EndpointSettings pEndpointSettings)
pEndpointSettings
- the EndpointSettingspublic RestResourceRegistry.EndpointSettings getEndpointSettings()
public void setResourceVersion(int pResourceVersion)
pResourceVersion
- the ResourceVersionpublic int getResourceVersion()
public atg.service.jaxrs.ETagService getETagService()
public void setETagService(atg.service.jaxrs.ETagService pETagService)
pETagService
- ETag service to use for the requestpublic void setEmbeddedETag(org.json.JSONArray pEmbeddedETag)
pEmbeddedETag
- The embedded ETag.public org.json.JSONArray getEmbeddedETag()
public java.lang.Object getLockOwner()
public void setLockOwner(java.lang.Object pLockOwner)
pLockOwner
- The lock owner.public java.io.Serializable getLockKey()
public void setLockKey(java.io.Serializable pLockKey)
pLockKey
- The lock key.public java.lang.String getOverrideFilterId()
public void setOverrideFilterId(java.lang.String pOverrideFilterId)
pOverrideFilterId
- id of the override filterpublic java.lang.String getDeveloperOverrideFilterId()
public void setDeveloperOverrideFilterId(java.lang.String pDeveloperOverrideFilterId)
pDeveloperOverrideFilterId
- id of the developer override filterpublic int getFilterDepth()
public void setFilterDepth(int pFilterDepth)
pFilterDepth
- the depth to which the current resource is filtered.public int getNestingDepth()
public java.util.Stack<java.lang.String> getRelPath()
public void setRelPath(java.util.Stack<java.lang.String> pRelPath)
pRelPath
- stack of string rel names leading to the current resource in contextpublic java.util.Set<java.lang.String> getExpandResources()
public void setExpandResources(java.util.Set<java.lang.String> pExpandResources)
pExpandResources
- list of expand parametersprotected atg.service.jaxrs.RestUpdateInfo.RestResourceUpdateInfo getResourceUpdateInfo()
public void setResourceUpdateInfo(atg.service.jaxrs.RestUpdateInfo.RestResourceUpdateInfo pRequestUpdateInfo)
pRequestUpdateInfo
- ResourceUpdateInfo containing property value changespublic java.util.Set<java.lang.String> getRequestAccepts()
public MediaType getResponseMediaType()
public void setResponseMediaType(MediaType pResponseMediaType)
pResponseMediaType
- the response media typepublic java.util.Set<java.lang.String> getLinks()
public void setLinks(java.util.Set<java.lang.String> pLinks)
pLinks
- list of link parameterspublic Link getCollectionLink()
public void setCollectionLink(Link pCollectionLink)
pCollectionLink
- link to the collectionpublic java.util.Set<java.lang.String> getFields()
public void setFields(java.util.Set<java.lang.String> pFields)
pFields
- set of property names or relation namespublic java.util.Set<java.lang.String> getExclude()
public void setExclude(java.util.Set<java.lang.String> pExclude)
pExclude
- set of exclude property names or relation namespublic static int getStackSize()
public static void setCurrentContext(RestContext pContext)
pContext
- represents the current context in the threadpublic static RestContext getCurrentContext()
public static RestContext popCurrentContext()
public static RestContext popCurrentContext(boolean pOnlyIfTop)
public void setEndpointProxy(java.lang.Object pEndpointProxy)
pEndpointProxy
- the endpoint proxy instancepublic java.lang.Object getEndpointProxy()
public ListingRequest getListingRequest()
public ListingResponse getListingResponse()
public ListingRequest buildListingRequest() throws RestException
RestException
- if an issue occurs while building the list.public java.lang.Object getResponse()
public void setResponse(java.lang.Object pResponse)
pResponse
- the new responsepublic boolean isRepresentationModelResponse()
public boolean isBypassTokenSecurity()
public void setBypassTokenSecurity(boolean pBypassTokenSecurity)
pBypassTokenSecurity
- the bypass token security flagpublic java.util.Set<java.lang.String> getSupplementaryPayloadSchemaPropertyNames()
public void setSupplementaryPayloadSchemaPropertyNames(java.util.Set<java.lang.String> pSupplementaryPayloadSchemaPropertyNames)
pSupplementaryPayloadSchemaPropertyNames
- the
supplementary schema property namespublic void addSupplementaryPayloadSchemaPropertyName(java.lang.String pName)
pName
- Name of the property name to add to the
set of supplementary schema propertiespublic atg.service.payloadschema.filter.FilteringContext createFilteringContext()
public int getFilterDepthForContext()
RestException
- if context or endpoint settings not setpublic java.lang.String getFilterId()
public java.lang.String getEndpointFilterId()
public RestException getRestException()
public void setRestException(RestException pRestException)
pRestException
- RestException that has been created in a request using this context