42 lines
1.0 KiB
Java
42 lines
1.0 KiB
Java
package clientP2P;
|
|
import clientP2P.ClientManagement;
|
|
import tools.Logger;
|
|
import tools.LogLevel;
|
|
|
|
/** Implementation of P2P-JAVA-PROJECT CLIENT interface
|
|
* @author Louis Royer
|
|
* @author Flavien Haas
|
|
* @author JS Auge
|
|
* @version 1.0
|
|
*/
|
|
public abstract class ClientInterface implements Runnable {
|
|
protected ClientManagement clientManagement;
|
|
private Logger logger;
|
|
|
|
/** Constructor with clientManagement and logger.
|
|
* @param clientManagement ClientManagement used
|
|
* @param logger Logger used
|
|
*/
|
|
public ClientInterface(ClientManagement clientManagement, Logger logger) {
|
|
this.clientManagement = clientManagement;
|
|
this.logger = logger;
|
|
}
|
|
|
|
/** Implementation of writeLog
|
|
* @param text Text to log
|
|
* @param logLevel level of logging
|
|
*/
|
|
protected void writeLog(String text, LogLevel logLevel) {
|
|
logger.write(text, logLevel);
|
|
}
|
|
|
|
/** Implementation of writeLog
|
|
* @param e exception to log
|
|
* @param logLevel level of logging
|
|
*/
|
|
protected void writeLog(Exception e, LogLevel logLevel) {
|
|
logger.write(e, logLevel);
|
|
}
|
|
|
|
}
|