public class DetectorClientRpcModule extends AbstractXmlRpcModule<DetectorRequestDTO,DetectorResponseDTO>
SyncServiceDetector
and AsyncServiceDetector
detectors.
When running on OpenNMS, detectors are executed in provisiond's scanExecutor thread pool.
When running on Minion, detectors are executed in a caching thread pool created by the blueprint.Modifier and Type | Field and Description |
---|---|
static String |
RPC_MODULE_ID |
MINION_HEADERS_MODULE
Constructor and Description |
---|
DetectorClientRpcModule() |
Modifier and Type | Method and Description |
---|---|
DetectorResponseDTO |
createResponseWithException(Throwable ex)
Called when the
RpcModule throws an exception while executing a request. |
CompletableFuture<DetectorResponseDTO> |
execute(DetectorRequestDTO request) |
String |
getId()
Used to route the request/responses to the appropriate module.
|
void |
setExecutor(Executor executor) |
void |
setServiceDetectorRegistry(ServiceDetectorRegistry serviceDetectorRegistry) |
marshalRequest, marshalResponse, unmarshalRequest, unmarshalResponse
public static final String RPC_MODULE_ID
public CompletableFuture<DetectorResponseDTO> execute(DetectorRequestDTO request)
public DetectorResponseDTO createResponseWithException(Throwable ex)
RpcModule
RpcModule
throws an exception while executing a request.
This function should return a new RpcResponse
that stores a string-based representation
of the exception that occurred and make this available via RpcResponse.getErrorMessage()
once un-marshaled.ex
- the exception that occurredRpcResponse
that stores the exceptionpublic String getId()
RpcModule
public void setServiceDetectorRegistry(ServiceDetectorRegistry serviceDetectorRegistry)
public void setExecutor(Executor executor)
Copyright © 2020. All rights reserved.