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

	 protected boolean reclassifyDevice(Device device)
	 {
		 // first classify all entities of this device
		 if (device == null) {
			 logger.debug("In reclassify for null device");
			 return false;
		 }
		 boolean needToReclassify = false;
		 for (Entity entity : device.entities) {
			 IEntityClass entityClass =
					 this.entityClassifier.classifyEntity(entity);
			 if (entityClass == null || device.getEntityClass() == null) {
				 needToReclassify = true;
				 break;
			 }
			 if (!entityClass.getName().
					 equals(device.getEntityClass().getName())) {
				 needToReclassify = true;
				 break;
			 }
		 }
		 if (needToReclassify == false) {
			 return false;
		 }

		 cntDeviceReclassifyDelete.increment();
		 LinkedList<DeviceUpdate> deviceUpdates =
				 new LinkedList<DeviceUpdate>();
		 // delete this device and then re-learn all the entities
		 this.deleteDevice(device);
		 deviceUpdates.add(new DeviceUpdate(device,
				 DeviceUpdate.Change.DELETE, null));
		 if (!deviceUpdates.isEmpty())
			 processUpdates(deviceUpdates);
		 for (Entity entity: device.entities ) {
			 this.learnDeviceByEntity(entity);
		 }
		 // Since reclassifyDevices() is not called in the packet-in pipeline,
		 // debugEvents need to be flushed explicitly
		 debugEventService.flushEvents();
		 return true;
	 }

}