From db9505695223aab8c3c5027477c3e31e4075d9d2 Mon Sep 17 00:00:00 2001 From: harshanL Date: Thu, 4 Dec 2014 14:45:02 +0530 Subject: [PATCH] Added Mobile-platform specific DeviceManagerService implementations. --- .../mgt/common/spi/DeviceManagerService.java | 4 +- .../android/AndroidDeviceManagerService.java | 78 +++++++++++++++++++ .../MobileDeviceMgtServiceComponent.java | 23 ++++++ .../impl/ios/IOSDeviceManagerService.java | 77 ++++++++++++++++++ .../windows/WindowsDeviceManagerService.java | 77 ++++++++++++++++++ 5 files changed, 257 insertions(+), 2 deletions(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceMgtServiceComponent.java create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java index e73a0af766..45b674228e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java @@ -31,7 +31,7 @@ public interface DeviceManagerService { * @param device Metadata corresponding to the device being enrolled * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device */ - void enrolDevice(Device device) throws DeviceManagementException; + void enrollDevice(Device device) throws DeviceManagementException; /** * Method to modify the metadata corresponding to device enrollment @@ -39,7 +39,7 @@ public interface DeviceManagerService { * @throws DeviceManagementException If some unusual behaviour is observed while modify the enrollment of a * device */ - void modifyEnrolment(Device device) throws DeviceManagementException; + void modifyEnrollment(Device device) throws DeviceManagementException; /** * Method to disenroll a particular device from CDM. diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java new file mode 100644 index 0000000000..74a046cba3 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.impl.android; + +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; + +import java.util.List; + +/** + * This represents the Android implementation of DeviceManagerService. * + */ +public class AndroidDeviceManagerService implements DeviceManagerService { + + @Override + public void enrollDevice(Device device) throws DeviceManagementException { + + } + + @Override + public void modifyEnrollment(Device device) throws DeviceManagementException { + + } + + @Override + public void disEnrollDevice(String type, String deviceId) + throws DeviceManagementException { + + } + + @Override + public boolean isRegistered(String type, String deviceId) + throws DeviceManagementException { + return false; + } + + @Override + public boolean isActive(String type, String deviceId) + throws DeviceManagementException { + return false; + } + + @Override + public void setActive(boolean status) throws DeviceManagementException { + + } + + @Override + public List getAllDeviceInfo(String type) throws DeviceManagementException { + return null; + } + + @Override + public Device getDeviceInfo(String type, String deviceId) + throws DeviceManagementException { + return null; + } + + @Override + public void setOwnership(String ownershipType) throws DeviceManagementException { + + } +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceMgtServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceMgtServiceComponent.java new file mode 100644 index 0000000000..e1a8817952 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceMgtServiceComponent.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.impl.internal; + +/** + * Created by harshan on 12/4/14. + */ +public class MobileDeviceMgtServiceComponent { +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java new file mode 100644 index 0000000000..1907f2636e --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.impl.ios; + +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; + +import java.util.List; + +/** + * This represents the iOS implementation of DeviceManagerService. * + */ +public class IOSDeviceManagerService implements DeviceManagerService { + @Override + public void enrollDevice(Device device) throws DeviceManagementException { + + } + + @Override + public void modifyEnrollment(Device device) throws DeviceManagementException { + + } + + @Override + public void disEnrollDevice(String type, String deviceId) + throws DeviceManagementException { + + } + + @Override + public boolean isRegistered(String type, String deviceId) + throws DeviceManagementException { + return false; + } + + @Override + public boolean isActive(String type, String deviceId) + throws DeviceManagementException { + return false; + } + + @Override + public void setActive(boolean status) throws DeviceManagementException { + + } + + @Override + public List getAllDeviceInfo(String type) throws DeviceManagementException { + return null; + } + + @Override + public Device getDeviceInfo(String type, String deviceId) + throws DeviceManagementException { + return null; + } + + @Override + public void setOwnership(String ownershipType) throws DeviceManagementException { + + } +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java new file mode 100644 index 0000000000..98a339448b --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.wso2.carbon.device.mgt.mobile.impl.windows; + +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; + +import java.util.List; + +/** + * This represents the Windows implementation of DeviceManagerService. + */ +public class WindowsDeviceManagerService implements DeviceManagerService{ + @Override + public void enrollDevice(Device device) throws DeviceManagementException { + + } + + @Override + public void modifyEnrollment(Device device) throws DeviceManagementException { + + } + + @Override + public void disEnrollDevice(String type, String deviceId) + throws DeviceManagementException { + + } + + @Override + public boolean isRegistered(String type, String deviceId) + throws DeviceManagementException { + return false; + } + + @Override + public boolean isActive(String type, String deviceId) + throws DeviceManagementException { + return false; + } + + @Override + public void setActive(boolean status) throws DeviceManagementException { + + } + + @Override + public List getAllDeviceInfo(String type) throws DeviceManagementException { + return null; + } + + @Override + public Device getDeviceInfo(String type, String deviceId) + throws DeviceManagementException { + return null; + } + + @Override + public void setOwnership(String ownershipType) throws DeviceManagementException { + + } +}