package schedframe.resources.computing.profiles.energy.airthroughput; import schedframe.resources.StandardResourceType; import schedframe.resources.computing.ComputingResource; import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; import schedframe.resources.computing.profiles.energy.airthroughput.ui.ComputingResourceAirflowInterface; import schedframe.resources.devices.PhysicalResource; import schedframe.resources.devices.DeviceAirflowInterface; import schedframe.resources.devices.coolemall.FanAirflowInterface; public class AirflowInterfaceFactory { public static AirflowInterface createAirflowInterface(PhysicalResource resource, AirflowProfile atp){ if(atp == null) return null; AirflowInterface airflowInterface = null; if(resource.getType().getName().equals(StandardResourceType.CRAH.getName())) airflowInterface = new DeviceAirflowInterface(resource, atp); else if(resource.getType().getName().equals(StandardResourceType.Fan.getName())) airflowInterface = new FanAirflowInterface(resource, atp); else if(resource.getType().getName().equals(StandardResourceType.Inlet.getName())) airflowInterface = new FanAirflowInterface(resource, atp); else if(resource.getType().getName().equals(StandardResourceType.Outlet.getName())) airflowInterface = new FanAirflowInterface(resource, atp); else if(resource.getType().getName().equals(StandardResourceType.CoolingDevice.getName())) airflowInterface = new DeviceAirflowInterface(resource, atp); else airflowInterface = new ComputingResourceAirflowInterface((ComputingResource)resource, atp); return airflowInterface; } }