Class ExtractionPluginGrpcAdapter
java.lang.Object
org.hansken.plugin.extraction.runtime.grpc.client.ExtractionPluginGrpcAdapter
Adapter that transforms incoming gRPC messages to clean API calls.
- Author:
- Netherlands Forensic Institute
-
Constructor Summary
ConstructorsConstructorDescriptionExtractionPluginGrpcAdapter(ClientTrace trace, ClientDataContext context, ExtractionPluginDataReader reader) ExtractionPluginGrpcAdapter(ClientTrace trace, ClientDataContext context, ExtractionPluginDataReader reader, TraceSearcher searcher) -
Method Summary
-
Constructor Details
-
ExtractionPluginGrpcAdapter
public ExtractionPluginGrpcAdapter(ClientTrace trace, ClientDataContext context, ExtractionPluginDataReader reader) -
ExtractionPluginGrpcAdapter
public ExtractionPluginGrpcAdapter(ClientTrace trace, ClientDataContext context, ExtractionPluginDataReader reader, TraceSearcher searcher)
-
-
Method Details
-
execute
public Optional<com.google.protobuf.Any> execute(com.google.protobuf.Any message) throws ExecutionException, InterruptedException, IOException Processes a gRPC message, and calls the corresponding clean API.- Parameters:
message- Message received from client over gRPC- Returns:
- A response as result of the message execution, empty if there is no response.
- Throws:
ExecutionException- when an exception occurs during computationInterruptedException- when a thread gets interruptedIOException- when an I/O exception occurs
-
error
Callback for errors. One can check whether errors have been set by using the error-method. The error will be logged with a default logMessage- Parameters:
error- an error thrown somewhere else
-
error
Callback for errors. One can check whether errors have been set by using the error-method.- Parameters:
error- an error thrown somewhere elselogMessage- the logged message
-
error
Returns the error set, if any.- Returns:
- empty if no error was set, otherwise optional with the error set.
-