Package com.sap.cds.services.request
Interface RequestContext
public interface RequestContext
Interface to provide access to request-specific information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestContextgetCurrent(CdsRuntime runtime) Gives access to either the currentRequestContext, or if this does not exist to a helperRequestContextthat itself ensures that there is always aRequestContextopened.com.sap.cds.reflect.CdsModelgetModel()Returns the tenant-specificCdsModel.Returns theServiceCatalog, populated with all availableServiceinstances.static booleanisActive()
-
Method Details
-
isActive
static boolean isActive()- Returns:
- true, if a
RequestContextis currently active
-
getCurrent
Gives access to either the currentRequestContext, or if this does not exist to a helperRequestContextthat itself ensures that there is always aRequestContextopened. This method will throw aNullPointerException, if the passedCdsRuntimewas null, but guarantees that it will never returnnull- Parameters:
runtime- A reference to the underlyingCdsRuntimeinstance.- Returns:
- the current
RequestContextor 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 availableServiceinstances.- Returns:
- the
ServiceCatalog
-
getParameterInfo
ParameterInfo getParameterInfo()- Returns:
- the
ParameterInfoof this request
-
getUserInfo
UserInfo getUserInfo()- Returns:
- the
UserInfoof this request
-
getAuthenticationInfo
AuthenticationInfo getAuthenticationInfo()- Returns:
- the
AuthenticationInfoof this request
-
getFeatureTogglesInfo
FeatureTogglesInfo getFeatureTogglesInfo()- Returns:
- the
FeatureTogglesInfofor this request
-
getMessages
Messages getMessages()- Returns:
- the
Messagesattached to this request
-