package envoy.server.processors;
import java.io.IOException;
import envoy.server.net.ObjectWriteProxy;
/**
* This interface defines methods for processing objects of a specific
* type incoming from a client.
*
* Project: envoy-server-standalone
* File: ObjectProcessor.java
* Created: 30.12.2019
*
* @author Kai S. K. Engelbart
* @param type of the request object
* @since Envoy Server Standalone v0.1-alpha
*/
public interface ObjectProcessor {
/**
* @return the class of the request object
* @since Envoy Server Standalone v0.1-alpha
*/
Class getInputClass();
/**
* @param input the request object
* @param socketID the ID of the socket from which the object was received
* @param writeProxy the object that allows writing to a client
* @throws IOException if something went wrong during processing
* @since Envoy Server Standalone v0.1-alpha
*/
void process(T input, long socketID, ObjectWriteProxy writeProxy) throws IOException;
}