Added debug logs

revert-dabc3590
harshanL 10 years ago
parent 2dc1fe240f
commit dcbfd06075

@ -29,6 +29,7 @@ public interface MobileDeviceDAO {
/** /**
* Fetches a MobileDevice from MDM database. * Fetches a MobileDevice from MDM database.
*
* @param mblDeviceId Id of the Mobile-Device. * @param mblDeviceId Id of the Mobile-Device.
* @return MobileDevice corresponding to given device-id. * @return MobileDevice corresponding to given device-id.
* @throws MobileDeviceManagementDAOException * @throws MobileDeviceManagementDAOException
@ -37,6 +38,7 @@ public interface MobileDeviceDAO {
/** /**
* Adds a new MobileDevice to the MDM database. * Adds a new MobileDevice to the MDM database.
*
* @param mobileDevice MobileDevice to be added. * @param mobileDevice MobileDevice to be added.
* @return The status of the operation. * @return The status of the operation.
* @throws MobileDeviceManagementDAOException * @throws MobileDeviceManagementDAOException
@ -45,6 +47,7 @@ public interface MobileDeviceDAO {
/** /**
* Updates MobileDevice information in MDM database. * Updates MobileDevice information in MDM database.
*
* @param mobileDevice MobileDevice to be updated. * @param mobileDevice MobileDevice to be updated.
* @return The status of the operation. * @return The status of the operation.
* @throws MobileDeviceManagementDAOException * @throws MobileDeviceManagementDAOException
@ -53,6 +56,7 @@ public interface MobileDeviceDAO {
/** /**
* Deletes a given MobileDevice from MDM database. * Deletes a given MobileDevice from MDM database.
*
* @param mblDeviceId Id of MobileDevice to be deleted. * @param mblDeviceId Id of MobileDevice to be deleted.
* @return The status of the operation. * @return The status of the operation.
* @throws MobileDeviceManagementDAOException * @throws MobileDeviceManagementDAOException

@ -52,6 +52,9 @@ public class AndroidDeviceManagerService implements DeviceManagerService {
boolean status; boolean status;
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device); MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
try { try {
if (log.isDebugEnabled()) {
log.debug("Enrolling a new Android device : " + device.getDeviceIdentifier());
}
status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO().addMobileDevice( status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO().addMobileDevice(
mobileDevice); mobileDevice);
} catch (MobileDeviceManagementDAOException e) { } catch (MobileDeviceManagementDAOException e) {
@ -68,6 +71,9 @@ public class AndroidDeviceManagerService implements DeviceManagerService {
boolean status; boolean status;
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device); MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
try { try {
if (log.isDebugEnabled()) {
log.debug("Modifying the Android device enrollment data");
}
status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO() status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO()
.updateMobileDevice(mobileDevice); .updateMobileDevice(mobileDevice);
} catch (MobileDeviceManagementDAOException e) { } catch (MobileDeviceManagementDAOException e) {
@ -83,6 +89,9 @@ public class AndroidDeviceManagerService implements DeviceManagerService {
public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException { public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
boolean status; boolean status;
try { try {
if (log.isDebugEnabled()) {
log.debug("Dis-enrolling Android device : " + deviceId);
}
status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO() status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO()
.deleteMobileDevice(deviceId.getId()); .deleteMobileDevice(deviceId.getId());
} catch (MobileDeviceManagementDAOException e) { } catch (MobileDeviceManagementDAOException e) {
@ -97,6 +106,9 @@ public class AndroidDeviceManagerService implements DeviceManagerService {
public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException { public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException {
boolean isEnrolled = false; boolean isEnrolled = false;
try { try {
if (log.isDebugEnabled()) {
log.debug("Checking the enrollment of Android device : " + deviceId.getId());
}
MobileDevice mobileDevice = MobileDevice mobileDevice =
MobileDeviceManagementDAOFactory.getMobileDeviceDAO().getMobileDevice( MobileDeviceManagementDAOFactory.getMobileDeviceDAO().getMobileDevice(
deviceId.getId()); deviceId.getId());
@ -127,6 +139,9 @@ public class AndroidDeviceManagerService implements DeviceManagerService {
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException { public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
Device device; Device device;
try { try {
if (log.isDebugEnabled()) {
log.debug("Getting the details of Android device : " + deviceId.getId());
}
MobileDevice mobileDevice = MobileDeviceManagementDAOFactory.getMobileDeviceDAO(). MobileDevice mobileDevice = MobileDeviceManagementDAOFactory.getMobileDeviceDAO().
getMobileDevice(deviceId.getId()); getMobileDevice(deviceId.getId());
device = MobileDeviceManagementUtil.convertToDevice(mobileDevice); device = MobileDeviceManagementUtil.convertToDevice(mobileDevice);
@ -149,6 +164,9 @@ public class AndroidDeviceManagerService implements DeviceManagerService {
boolean status; boolean status;
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device); MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
try { try {
if (log.isDebugEnabled()) {
log.debug("updating the details of Android device : " + device.getDeviceIdentifier());
}
status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO() status = MobileDeviceManagementDAOFactory.getMobileDeviceDAO()
.updateMobileDevice(mobileDevice); .updateMobileDevice(mobileDevice);
} catch (MobileDeviceManagementDAOException e) { } catch (MobileDeviceManagementDAOException e) {
@ -163,6 +181,9 @@ public class AndroidDeviceManagerService implements DeviceManagerService {
public List<Device> getAllDevices() throws DeviceManagementException { public List<Device> getAllDevices() throws DeviceManagementException {
List<Device> devices = null; List<Device> devices = null;
try { try {
if (log.isDebugEnabled()) {
log.debug("Fetching the details of all Android devices");
}
List<MobileDevice> mobileDevices = List<MobileDevice> mobileDevices =
MobileDeviceManagementDAOFactory.getMobileDeviceDAO(). MobileDeviceManagementDAOFactory.getMobileDeviceDAO().
getAllMobileDevices(); getAllMobileDevices();

Loading…
Cancel
Save