package test.rewolucja.resources.manager.implementation; import java.util.ArrayList; import java.util.List; import java.util.Properties; import test.rewolucja.resources.ResourceType; import test.rewolucja.resources.exception.ResourceException; import test.rewolucja.resources.logical.base.LogicalResource; import test.rewolucja.resources.physical.base.ComputingResource; import test.rewolucja.resources.physical.implementation.Processor; import test.rewolucja.resources.physical.implementation.ComputingNode; public class ClusterResourceManager extends ResourceManager{ public ClusterResourceManager(List resources, List logicalLayers) { super(resources, logicalLayers); // TODO Auto-generated constructor stub } @SuppressWarnings("unchecked") public List getComputingNodes(){ try { return (List) getResourcesOfType(ResourceType.COMPUTING_NODE); } catch (ResourceException e) { return new ArrayList(); } } @SuppressWarnings("unchecked") public List getProcessors(){ try { return (List) getResourcesOfType(ResourceType.CPU); } catch (Exception e) { return new ArrayList(); } } @SuppressWarnings("unchecked") public List getComputingNodes(Properties properties){ properties.setProperty("type", ResourceType.COMPUTING_NODE.toString()); return (List) filterResources(properties); } }