class DeviceManagerImpl implements IDeviceService, IOFMessageListener, ITopologyListener, IFloodlightModule, IEntityClassListener, IInfoProvider {

	@Override
	public IDevice findDevice(MacAddress macAddress, VlanVid vlan,
			IPv4Address ipv4Address, DatapathId switchDPID,
			OFPort switchPort)
					throws IllegalArgumentException {
		if (vlan != null && vlan.getVlan() <= 0)
			vlan = null;
		if (ipv4Address != null && ipv4Address.getInt() == 0)
			ipv4Address = null;
		Entity e = new Entity(macAddress, vlan, ipv4Address, switchDPID,
				switchPort, null);
		if (!allKeyFieldsPresent(e, entityClassifier.getKeyFields())) {
			throw new IllegalArgumentException("Not all key fields specified."
					+ " Required fields: " + entityClassifier.getKeyFields());
		}
		return findDeviceByEntity(e);
	}

}