2019-12-30 14:53:40 +01:00
|
|
|
package envoy.server;
|
|
|
|
|
|
|
|
/**
|
2019-12-30 15:15:25 +01:00
|
|
|
* This interface defines methods for processing objects of a specific
|
|
|
|
* type incoming from a client.<br>
|
|
|
|
* <br>
|
2019-12-30 14:53:40 +01:00
|
|
|
* Project: <strong>envoy-server-standalone</strong><br>
|
|
|
|
* File: <strong>ObjectProcessor.java</strong><br>
|
|
|
|
* Created: <strong>30.12.2019</strong><br>
|
2019-12-30 15:15:25 +01:00
|
|
|
*
|
2019-12-30 14:53:40 +01:00
|
|
|
* @author Kai S. K. Engelbart
|
2019-12-30 15:15:25 +01:00
|
|
|
* @param <T> type of the request object
|
|
|
|
* @param <U> type of the response object
|
2019-12-30 14:53:40 +01:00
|
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
|
|
*/
|
|
|
|
public interface ObjectProcessor<T, U> {
|
|
|
|
|
2019-12-30 15:15:25 +01:00
|
|
|
/**
|
|
|
|
* @return the Class of the request object
|
|
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
|
|
*/
|
2019-12-30 14:53:40 +01:00
|
|
|
Class<T> getInputClass();
|
2019-12-30 15:15:25 +01:00
|
|
|
|
|
|
|
/**
|
2020-01-03 17:11:38 +01:00
|
|
|
* @param input the request object
|
|
|
|
* @param socketId the ID of the socket from which the object was received
|
2019-12-30 15:15:25 +01:00
|
|
|
* @return the response object
|
|
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
|
|
*/
|
2020-01-03 17:11:38 +01:00
|
|
|
U process(T input, long socketId);
|
2019-12-30 14:53:40 +01:00
|
|
|
}
|