Remove delete device type from DB when un register plugin

This commit is contained in:
manoj 2015-05-15 12:04:01 +05:30
parent a774bc89aa
commit f4b8e4bb74
2 changed files with 1 additions and 7 deletions

View File

@ -45,12 +45,6 @@ public class DeviceManagementRepository {
public void removeDeviceManagementProvider(DeviceMgtService provider) throws DeviceManagementException {
String deviceType = provider.getProviderType();
try {
DeviceManagerUtil.unregisterDeviceType(deviceType);
} catch (DeviceManagementException e) {
throw new DeviceManagementException("Error occurred while removing device management provider '" +
deviceType + "'", e);
}
providers.remove(deviceType);
}

View File

@ -142,7 +142,7 @@ public final class DeviceManagerUtil {
try {
DeviceTypeDAO deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO();
DeviceType deviceType = deviceTypeDAO.getDeviceType(typeName);
if (deviceType == null) {
if (deviceType != null) {
DeviceType dt = new DeviceType();
dt.setName(typeName);
deviceTypeDAO.removeDeviceType(typeName);