public class JwtBasedRequestContextExecutor extends BaseRequestContextExecutor<JwtBasedRequestContextExecutor>
Callable
or Executable
as if it would have been
invoked via a HttpServletRequest
with the given JWT bearer as part of the "Authorization" header.Constructor and Description |
---|
JwtBasedRequestContextExecutor() |
Modifier and Type | Method and Description |
---|---|
protected JwtBasedRequestContextExecutor |
getThis()
Getter needed to allow for a type safe return in the builder methods.
|
JwtBasedRequestContextExecutor |
withJwt(String encodedJwt)
The given JWT is used to initialize the
RequestContext as if it was called from
HttpServletRequest . |
JwtBasedRequestContextExecutor |
withJwt(String encodedJwt,
String refreshToken)
The given JWT is used to initialize the
RequestContext as if it was called from
HttpServletRequest . |
JwtBasedRequestContextExecutor |
withXsuaaServiceJwt()
Retrieves a JWT from the bound XSUAA service and initialize this RequestContextExecutor with it.
|
execute, execute, withListeners, withoutDefaultListeners, withoutListener, withoutListeners, withParentRequestContext, withRequestContext
@Nonnull public JwtBasedRequestContextExecutor withJwt(@Nonnull String encodedJwt)
RequestContext
as if it was called from
HttpServletRequest
.encodedJwt
- The encoded JWT to be used.@Nonnull public JwtBasedRequestContextExecutor withJwt(@Nonnull String encodedJwt, @Nonnull String refreshToken)
RequestContext
as if it was called from
HttpServletRequest
. Also takes a refresh token to refresh the given JWT if expired.encodedJwt
- The encoded JWT to be used.refreshToken
- The refresh token to be used to refresh the JWT if necessary.@Nonnull public JwtBasedRequestContextExecutor withXsuaaServiceJwt()
Probable use cases for this are tasks that should run without any request, so e.g. start-up tasks and handling of received messages.
@Nonnull protected JwtBasedRequestContextExecutor getThis()
BaseRequestContextExecutor
protected ImplementingType getThis() { return this; }in the subclasses.
getThis
in class BaseRequestContextExecutor<JwtBasedRequestContextExecutor>
Copyright © 2019 SAP SE. All rights reserved.