Package com.sap.cds.services.request
Interface RequestContext
public interface RequestContext
Interface to provide access to request-specific information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestContext
getCurrent
(CdsRuntime runtime) Gives access to either the currentRequestContext
, or if this does not exist to a helperRequestContext
that itself ensures that there is always aRequestContext
opened.com.sap.cds.reflect.CdsModel
getModel()
Returns the tenant-specificCdsModel
.Returns theServiceCatalog
, populated with all availableService
instances.static boolean
isActive()
-
Method Details
-
isActive
static boolean isActive()- Returns:
- true, if a
RequestContext
is currently active
-
getCurrent
Gives access to either the currentRequestContext
, or if this does not exist to a helperRequestContext
that itself ensures that there is always aRequestContext
opened. This method will throw aNullPointerException
, if the passedCdsRuntime
was null, but guarantees that it will never returnnull
- Parameters:
runtime
- A reference to the underlyingCdsRuntime
instance.- Returns:
- the current
RequestContext
or a helperRequestContext
-
getModel
com.sap.cds.reflect.CdsModel getModel()Returns the tenant-specificCdsModel
. The tenant is determined based on the request-context and the tenant information available inUserInfo
. If no tenant is specified, or if no tenant-specific model exists, the base model is returned.- Returns:
- the (tenant-specific)
CdsModel
-
getServiceCatalog
ServiceCatalog getServiceCatalog()Returns theServiceCatalog
, populated with all availableService
instances.- Returns:
- the
ServiceCatalog
-
getParameterInfo
ParameterInfo getParameterInfo()- Returns:
- the
ParameterInfo
of this request
-
getUserInfo
UserInfo getUserInfo()- Returns:
- the
UserInfo
of this request
-
getAuthenticationInfo
AuthenticationInfo getAuthenticationInfo()- Returns:
- the
AuthenticationInfo
of this request
-
getFeatureTogglesInfo
FeatureTogglesInfo getFeatureTogglesInfo()- Returns:
- the
FeatureTogglesInfo
for this request
-
getMessages
Messages getMessages()- Returns:
- the
Messages
attached to this request
-