|
|
@ -275,7 +275,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
Device currentDevice = deviceDAO.getDevice(deviceIdentifier, tenantId);
|
|
|
|
Device currentDevice = deviceDAO.getDevice(deviceIdentifier, tenantId);
|
|
|
|
device.setId(currentDevice.getId());
|
|
|
|
device.setId(currentDevice.getId());
|
|
|
|
device.getEnrolmentInfo().setId(currentDevice.getEnrolmentInfo().getId());
|
|
|
|
device.getEnrolmentInfo().setId(currentDevice.getEnrolmentInfo().getId());
|
|
|
|
|
|
|
|
if (device.getName() == null) {
|
|
|
|
|
|
|
|
device.setName(currentDevice.getName());
|
|
|
|
|
|
|
|
}
|
|
|
|
deviceDAO.updateDevice(device, tenantId);
|
|
|
|
deviceDAO.updateDevice(device, tenantId);
|
|
|
|
enrollmentDAO.updateEnrollment(device.getEnrolmentInfo());
|
|
|
|
enrollmentDAO.updateEnrollment(device.getEnrolmentInfo());
|
|
|
|
DeviceManagementDAOFactory.commitTransaction();
|
|
|
|
DeviceManagementDAOFactory.commitTransaction();
|
|
|
@ -366,7 +368,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
throw new DeviceManagementException("Error occurred while obtaining the enrollment information device for" +
|
|
|
|
throw new DeviceManagementException("Error occurred while obtaining the enrollment information device for" +
|
|
|
|
"id '" + deviceId.getId() + "'", e);
|
|
|
|
"id '" + deviceId.getId() + "'", e);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
|
|
|
|
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -877,7 +879,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
if (device == null) {
|
|
|
|
if (device == null) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("No device is found upon the type '" + deviceId.getType() + "' and id '" +
|
|
|
|
log.debug("No device is found upon the type '" + deviceId.getType() + "' and id '" +
|
|
|
|
deviceId.getId() + "'");
|
|
|
|
deviceId.getId() + "'");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -890,7 +892,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
device.setApplications(applications);
|
|
|
|
device.setApplications(applications);
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
throw new DeviceManagementException("Error occurred while obtaining the device for id " +
|
|
|
|
throw new DeviceManagementException("Error occurred while obtaining the device for id " +
|
|
|
|
"'" + deviceId.getId() + "'", e);
|
|
|
|
"'" + deviceId.getId() + "'", e);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
|
|
|
|
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
|
|
|
|
} catch (DeviceDetailsMgtDAOException e) {
|
|
|
|
} catch (DeviceDetailsMgtDAOException e) {
|
|
|
@ -904,7 +906,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
if (deviceManager == null) {
|
|
|
|
if (deviceManager == null) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Device Manager associated with the device type '" + deviceId.getType() + "' is null. " +
|
|
|
|
log.debug("Device Manager associated with the device type '" + deviceId.getType() + "' is null. " +
|
|
|
|
"Therefore, not attempting method 'getDevice'");
|
|
|
|
"Therefore, not attempting method 'getDevice'");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return device;
|
|
|
|
return device;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1861,7 +1863,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
throw new DeviceManagementException("Error occurred while obtaining the enrollment information device for" +
|
|
|
|
throw new DeviceManagementException("Error occurred while obtaining the enrollment information device for" +
|
|
|
|
"id '" + deviceId.getId() + "' and user : " + user, e);
|
|
|
|
"id '" + deviceId.getId() + "' and user : " + user, e);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
|
|
|
|
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
@ -1929,8 +1931,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Checks for the default group existence and create group based on device ownership
|
|
|
|
* Checks for the default group existence and create group based on device ownership
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param service {@link GroupManagementProviderService} instance.
|
|
|
|
* @param service {@link GroupManagementProviderService} instance.
|
|
|
|
* @param groupName of the group to create.
|
|
|
|
* @param groupName of the group to create.
|
|
|
|
* @return Group with details.
|
|
|
|
* @return Group with details.
|
|
|
|
* @throws GroupManagementException
|
|
|
|
* @throws GroupManagementException
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|