Class ExtractionPluginGrpcAdapter


  • public class ExtractionPluginGrpcAdapter
    extends Object
    Adapter that transforms incoming gRPC messages to clean API calls.
    Author:
    Netherlands Forensic Institute
    • 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 computation
        InterruptedException - when a thread gets interrupted
        IOException - 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 else
        logMessage - the logged message
      • error

        public Optional<Throwable> error()
        Returns the error set, if any.
        Returns:
        empty if no error was set, otherwise optional with the error set.