public class ExternalComponentMessageHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FUNCTION_CALL_REQUEST_NOT_FOUND
Message when a message is of type FUNCTION_CALL, but the request to call the function is not found.
|
static String |
FUNCTION_CALL_SUCESS
Message when a function is executed with success
|
static String |
FUNCTION_EXECUTION_ERROR_FOUND
Default message when there was an error executing the function.
|
static String |
FUNCTION_NOT_FOUND
Message when a requested function is not found
|
| Constructor and Description |
|---|
ExternalComponentMessageHelper() |
| Modifier and Type | Method and Description |
|---|---|
Optional<ExternalFilterRequest> |
filterRequest(ExternalComponentMessage message)
Extract filter request from messages coming from the component.
|
Optional<FunctionCallRequest> |
functionCallRequest(ExternalComponentMessage message)
Retrieves a function call object from a message.
|
Optional<String> |
getComponentId(ExternalComponentMessage message)
Extract the component Id from a message.
|
Optional<String> |
getConfigurationIssue(ExternalComponentMessage message) |
boolean |
isInit(ExternalComponentMessage message)
Check if the given message is an INIT message.
|
ExternalComponentMessageType |
messageType(ExternalComponentMessage message) |
ExternalComponentMessage |
newDataSetMessage(ExternalDataSet ds,
Map<String,Object> componentProperties)
Builds a message that contains dataset and component properties.
|
ExternalComponentMessage |
newFunctionError(FunctionCallRequest functionCallRequest,
String errorMessage) |
ExternalComponentMessage |
newFunctionNotFound(FunctionCallRequest functionCallRequest)
Produces a message to respond function call requests here the function could not be found.
|
ExternalComponentMessage |
newFunctionRequestNotFound()
Generate messages for function call message types that does not specify a function call request.
|
ExternalComponentMessage |
newFunctionSuccess(FunctionCallRequest functionCallRequest,
Object result)
Messages to sent when a function is called with success
|
ExternalComponentMessage |
newInitMessage(Map<String,Object> componentProperties)
Creates a message of type INIT, which is the first message sent to the component.
|
void |
withId(ExternalComponentMessage message,
String componentId)
Add the component runtime ID to a message
|
public static final String FUNCTION_NOT_FOUND
public static final String FUNCTION_CALL_SUCESS
public static final String FUNCTION_CALL_REQUEST_NOT_FOUND
public static final String FUNCTION_EXECUTION_ERROR_FOUND
public Optional<ExternalFilterRequest> filterRequest(ExternalComponentMessage message)
message - The message sent by the component.public Optional<FunctionCallRequest> functionCallRequest(ExternalComponentMessage message)
message - public ExternalComponentMessage newDataSetMessage(ExternalDataSet ds, Map<String,Object> componentProperties)
ds - The dataset that will be sent to clientcomponentProperties - All the component propertiespublic ExternalComponentMessage newInitMessage(Map<String,Object> componentProperties)
componentProperties - The initial properties.public ExternalComponentMessage newFunctionError(FunctionCallRequest functionCallRequest, String errorMessage)
public ExternalComponentMessage newFunctionNotFound(FunctionCallRequest functionCallRequest)
functionCallRequest - public ExternalComponentMessage newFunctionRequestNotFound()
public ExternalComponentMessage newFunctionSuccess(FunctionCallRequest functionCallRequest, Object result)
functionCallRequest - result - The function execution result.public void withId(ExternalComponentMessage message, String componentId)
message - The message which the ID should be setcomponentId - The component unique ID. It should be used by components to send messages to DB.public Optional<String> getComponentId(ExternalComponentMessage message)
message - The target message to have the component id removed.public Optional<String> getConfigurationIssue(ExternalComponentMessage message)
public boolean isInit(ExternalComponentMessage message)
message - The message to be checked.public ExternalComponentMessageType messageType(ExternalComponentMessage message)
Copyright © 2012–2021 JBoss by Red Hat. All rights reserved.