forked from community/device-mgt-plugins
parent
cb05d53510
commit
7e253156f6
6
components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java → components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java
6
components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java → components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManager.java
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.DeviceManagementException;
|
||||
import org.wso2.carbon.device.mgt.common.Feature;
|
||||
import org.wso2.carbon.device.mgt.common.FeatureManagementException;
|
||||
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.FeatureDAO;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.FeatureManagementDAOException;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.FeatureManagementDAOFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AndroidFeatureManager implements FeatureManager {
|
||||
|
||||
private FeatureDAO featureDAO;
|
||||
|
||||
public AndroidFeatureManager() {
|
||||
this.featureDAO = FeatureManagementDAOFactory.getFeatureDAO();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addFeature(Feature feature) throws DeviceManagementException {
|
||||
try {
|
||||
featureDAO.addFeature(feature);
|
||||
return true;
|
||||
} catch (FeatureManagementDAOException e) {
|
||||
throw new DeviceManagementException("Error occurred while adding the feature", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Feature getFeature(String name) throws DeviceManagementException {
|
||||
try {
|
||||
return featureDAO.getFeature(name);
|
||||
} catch (FeatureManagementDAOException e) {
|
||||
throw new DeviceManagementException("Error occurred while retrieving the feature", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Feature> getFeatures() throws DeviceManagementException {
|
||||
try {
|
||||
return featureDAO.getFeatures();
|
||||
} catch (FeatureManagementDAOException e) {
|
||||
throw new DeviceManagementException("Error occurred while retrieving the list of features registered " +
|
||||
"for Android platform", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeFeature(String name) throws DeviceManagementException {
|
||||
try {
|
||||
featureDAO.removeFeature(name);
|
||||
return true;
|
||||
} catch (FeatureManagementDAOException e) {
|
||||
throw new DeviceManagementException("Error occurred while removing the feature", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.dao;
|
||||
|
||||
import org.wso2.carbon.device.mgt.common.Feature;
|
||||
import org.wso2.carbon.device.mgt.common.FeatureManagementException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FeatureDAO {
|
||||
|
||||
void addFeature(Feature feature) throws FeatureManagementDAOException;
|
||||
|
||||
void removeFeature(String name) throws FeatureManagementDAOException;
|
||||
|
||||
Feature getFeature(String name) throws FeatureManagementDAOException;
|
||||
|
||||
List<Feature> getFeatures() throws FeatureManagementDAOException;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.dao;
|
||||
|
||||
public class FeatureManagementDAOException extends Exception {
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.dao;
|
||||
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.impl.FeatureDAOImpl;
|
||||
|
||||
public class FeatureManagementDAOFactory {
|
||||
|
||||
public static FeatureDAO getFeatureDAO() {
|
||||
return new FeatureDAOImpl();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you 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.dao.impl;
|
||||
|
||||
import org.wso2.carbon.device.mgt.common.Feature;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.FeatureDAO;
|
||||
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.FeatureManagementDAOException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FeatureDAOImpl implements FeatureDAO {
|
||||
|
||||
@Override
|
||||
public void addFeature(Feature feature) throws FeatureManagementDAOException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFeature(String name) throws FeatureManagementDAOException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Feature getFeature(String name) throws FeatureManagementDAOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Feature> getFeatures() throws FeatureManagementDAOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
4
components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java → components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java
4
components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java → components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java
Loading…
Reference in new issue