Interface DoipProcessor


  • public interface DoipProcessor
    A DoipProcessor encapsulates the request-processing logic of a DOIP server. When a request comes to the listener of a DoipServer, the process(DoipServerRequest, DoipServerResponse) method of the DoipProcessor will be called with an object representing the incoming request and an object representing the outgoing response. The request object may be inspected and the response object may be populated to provide the response. When the process method returns the server will close the request and response objects as necessary, while generally leaving the socket open for other requests.
    • Method Detail

      • process

        void process​(DoipServerRequest req,
                     DoipServerResponse resp)
              throws java.io.IOException
        Process a request and provide a response. The supplied request object may be inspected for the details of the request, and the supplied response object may be called to populate the response. It is not necessary to close these objects in this method.
        Parameters:
        req - the request object
        resp - the response object
        Throws:
        java.io.IOException - if something goes wrong reading or writing, which will cause the DoipServer to end the connection
      • shutdown

        default void shutdown()
        Shuts down the DoipProcessor. This method may be overridden to clean up any resources used by the DoipProcessor instance. It will be called by the DoipServer if the DoipServer was constructed using DoipServer(DoipServerConfig).