|
|
@ -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();
|
|
|
|