Class RequestContextManager
java.lang.Object
es.kukenan.smartfi.common.context.RequestContextManager
Used as single access point for request context metadata, currently:
- RequestID - used to correlate actions and events.
- EntityID - identified the company at a multi-tenant environment.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ContextPropagationPropertiesContext propagation related configuration properties.static final StringChannel for scheduled tasks.static final StringConstant used to designate third party provider channel. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAll()Retrieve all the entries at the request context.Get the context.Patch the actual context with non-null values in a given input context information.voidreset()Completely clear the request context.voidSet all the entries at the request context.private voidsetRequestProperty(String name, String value) Set the value of a request context entry.voidsetScheduledContext(String svcName, String requestId, String companyId, String sessionId) Initialize the execution context for a scheduled task.voidsetThirdPartyCallbackContext(String tppName, String requestId, String companyId, String sessionId) Initialize the execution context for a third party provider call.voidRegister the context.
-
Field Details
-
TPP_CHANNEL
Constant used to designate third party provider channel.- See Also:
-
SCHEDULEDTASK_CHANNEL
Channel for scheduled tasks.- See Also:
-
propagationConfig
Context propagation related configuration properties.
-
-
Constructor Details
-
RequestContextManager
public RequestContextManager()
-
-
Method Details
-
getContext
Get the context.- Returns:
- the context.
-
patchContext
public RequestContextManager.WalletContext patchContext(RequestContextManager.WalletContext context) Patch the actual context with non-null values in a given input context information.- Parameters:
context- the context, if null any previous value will be removed from the context.- Returns:
- the actual context after patch.
-
updateContext
Register the context.- Parameters:
context- the context, if null any previous value will be removed from the context.
-
setThirdPartyCallbackContext
public void setThirdPartyCallbackContext(String tppName, String requestId, String companyId, String sessionId) Initialize the execution context for a third party provider call.- Parameters:
tppName- the third party provider name.requestId- request identifier. If null, a new requestId will be generated.companyId- company identifier. If null, it is left as null.sessionId- session identifier. If null, it will be left as null.
-
setScheduledContext
public void setScheduledContext(String svcName, String requestId, String companyId, String sessionId) Initialize the execution context for a scheduled task.- Parameters:
svcName- the service name.requestId- request identifier. If null, a new requestId will be generated.companyId- company identifier. If null, it is left as null.sessionId- session identifier. If null, it will be left as null.
-
reset
public void reset()Completely clear the request context. -
getAll
Retrieve all the entries at the request context.- Returns:
- a map with all the entries at the request context.
-
setAll
Set all the entries at the request context.- Parameters:
entries- the entries to set at request context.
-
setRequestProperty
Set the value of a request context entry.- Parameters:
name- the name of the request context entry.value- tha new value for the entry.
-