Class ExtractionPluginGrpcAdapter
- java.lang.Object
-
- org.hansken.plugin.extraction.runtime.grpc.client.ExtractionPluginGrpcAdapter
-
public class ExtractionPluginGrpcAdapter extends Object
Adapter that transforms incoming gRPC messages to clean API calls.- Author:
- Netherlands Forensic Institute
-
-
Constructor Summary
Constructors Constructor Description ExtractionPluginGrpcAdapter(ClientTrace trace, ClientDataContext context, ExtractionPluginDataReader reader)ExtractionPluginGrpcAdapter(ClientTrace trace, ClientDataContext context, ExtractionPluginDataReader reader, TraceSearcher searcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Throwable>error()Returns the error set, if any.voiderror(Throwable error)Callback for errors.voiderror(Throwable error, String logMessage)Callback for errors.Optional<com.google.protobuf.Any>execute(com.google.protobuf.Any message)Processes a gRPC message, and calls the corresponding clean API.
-
-
-
Constructor Detail
-
ExtractionPluginGrpcAdapter
public ExtractionPluginGrpcAdapter(ClientTrace trace, ClientDataContext context, ExtractionPluginDataReader reader)
-
ExtractionPluginGrpcAdapter
public ExtractionPluginGrpcAdapter(ClientTrace trace, ClientDataContext context, ExtractionPluginDataReader reader, TraceSearcher searcher)
-
-
Method Detail
-
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
public void error(Throwable 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
public void error(Throwable error, String logMessage)
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
-
-