package stubs;

import java.util.Date;

import org.bench4q.master.infrastructure.communication.MonitorMessenger;
import org.bench4q.share.models.monitor.MemoryModel;
import org.bench4q.share.models.monitor.MonitorMain;
import org.bench4q.share.models.monitor.NetworkInterfaceModel;
import org.bench4q.share.models.monitor.PhysicalDiskModel;
import org.bench4q.share.models.monitor.ProcessModel;
import org.bench4q.share.models.monitor.ProcessorModel;
import org.springframework.stereotype.Component;

@Component
public class Mock_MonitorMessenger implements MonitorMessenger {

	@Override
	public MonitorMain monitorModel(String hostName, int port) {
		MonitorMain result = new MonitorMain();
		result.setFinished(false);
		result.setMemoryModel(new MemoryModel());
		result.setNetworkInterfaceModel(new NetworkInterfaceModel());
		result.setPhysicalDiskModel(new PhysicalDiskModel());
		result.setProcessModel(new ProcessModel());
		result.setProcessorModel(new ProcessorModel());
		result.setSamplingTime(new Date());
		return result;
	}

	@Override
	public PhysicalDiskModel physicalDisk(String hostName, int port) {
		return monitorModel(hostName, port).getPhysicalDiskModel();
	}

	@Override
	public MemoryModel memory(String hostName, int port) {
		return monitorModel(hostName, port).getMemoryModel();
	}

	@Override
	public ProcessorModel processor(String hostName, int port) {
		return monitorModel(hostName, port).getProcessorModel();
	}

	@Override
	public NetworkInterfaceModel networkInterface(String hostName, int port) {
		return monitorModel(hostName, port).getNetworkInterfaceModel();
	}

	@Override
	public ProcessModel process(String hostName, int port) {
		return monitorModel(hostName, port).getProcessModel();
	}

}
