public interface CdsRuntime
Service
instances and CdsModel
.
It can be used to define Request and ChangeSet boundaries.Modifier and Type | Method and Description |
---|---|
ChangeSetContextRunner |
changeSetContext()
Starts a new
ChangeSetContext which defines the transactional boundaries |
com.sap.cds.reflect.CdsModel |
getCdsModel() |
com.sap.cds.reflect.CdsModel |
getCdsModel(String tenant) |
ParameterInfo |
getProvidedParameterInfo() |
UserInfo |
getProvidedUserInfo() |
ServiceCatalog |
getServiceCatalog() |
RequestContextRunner |
requestContext()
Starts a new
RequestContext which defines the context of parameters (reflecting the user, request parameters etc.) |
default void |
runInChangeSetContext(Consumer<ChangeSetContext> changeSetHandler)
Deprecated.
|
<T> T |
runInChangeSetContext(Function<ChangeSetContext,T> changeSetHandler)
Deprecated.
|
default void |
runInRequestContext(Request request,
Consumer<RequestContext> requestHandler)
Deprecated.
|
<T> T |
runInRequestContext(Request request,
Function<RequestContext,T> requestHandler)
Deprecated.
|
ServiceCatalog getServiceCatalog()
ServiceCatalog
containing all registered Service
instancescom.sap.cds.reflect.CdsModel getCdsModel()
CdsModel
as read from CSN filecom.sap.cds.reflect.CdsModel getCdsModel(String tenant)
tenant
- the tenanttenant
is null
ParameterInfo getProvidedParameterInfo()
ParameterInfo
retrieved from the registered ParameterInfoProvider
or an empty ParameterInfo
.UserInfo getProvidedUserInfo()
UserInfo
retrieved from the registered UserInfoProvider
or an anonymous UserInfo
.@Deprecated <T> T runInRequestContext(Request request, Function<RequestContext,T> requestHandler)
RequestContext
and runs the given handler within its scope.
The RequestContext
will be propagated to all
EventContext
instances in the service call
hierarchy.T
- The type of the responserequest
- A Request
object describing the context of the request like parameters, user etc.requestHandler
- The handler for processing the request within the context@Deprecated default void runInRequestContext(Request request, Consumer<RequestContext> requestHandler)
RequestContext
and runs the given handler within its scope.
The RequestContext
will be propagated to all
EventContext
instances in the service call
hierarchy.request
- A Request
object describing the context of the request like parameters, user etc.requestHandler
- The handler for processing the request within the contextRequestContextRunner requestContext()
RequestContext
which defines the context of parameters (reflecting the user, request parameters etc.)RequestContextRunner
used to open the context.@Deprecated <T> T runInChangeSetContext(Function<ChangeSetContext,T> changeSetHandler)
ChangeSetContext
and runs the given handler within its scope.
The ChangeSetContext
marks a scope in which all opened transactions
etc. are committed cancelled together. Note that single transactions may fail
during commit but others might be successful.
The ChangeSetContext
will be propagated to all
EventContext
instances in the service call
hierarchy.
T
- The type of the responsechangeSetHandler
- The handler for processing the request within the context@Deprecated default void runInChangeSetContext(Consumer<ChangeSetContext> changeSetHandler)
ChangeSetContext
and runs the given handler within its scope.
The ChangeSetContext
marks a scope in which all opened transactions
etc. are committed cancelled together. Note that single transactions may fail
during commit but others might be successful.
The ChangeSetContext
will be propagated to all
EventContext
instances in the service call
hierarchy.
changeSetHandler
- The handler for processing the request within the contextChangeSetContextRunner changeSetContext()
ChangeSetContext
which defines the transactional boundariesChangeSetContextRunner
used to open the context.Copyright © 2021. All rights reserved.