forked from community/device-mgt-plugins
parent
532f66ebc5
commit
16d9338dce
6
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/adminoperations/beans/Device.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/common/beans/Device.java
6
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/adminoperations/beans/Device.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/common/beans/Device.java
7
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/adminoperations/beans/OperationRequest.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/common/beans/OperationRequest.java
7
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/adminoperations/beans/OperationRequest.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/common/beans/OperationRequest.java
6
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/ConfigurationMgtService.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/ConfigurationMgtService.java
6
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/ConfigurationMgtService.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/ConfigurationMgtService.java
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 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.mdm.mobileservices.windows.services;
|
||||
|
||||
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsDeviceEnrolmentException;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Interface for Admin operations persisting. This interface accepts operations added via UI.
|
||||
*/
|
||||
@Path("/admin/devices")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public interface DeviceManagementAdminService {
|
||||
|
||||
@POST
|
||||
@Path("/lock-devices")
|
||||
Response lock(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws WindowsDeviceEnrolmentException;
|
||||
|
||||
@POST
|
||||
@Path("/disenroll-devices")
|
||||
Response disenroll(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws WindowsDeviceEnrolmentException;
|
||||
|
||||
@POST
|
||||
@Path("/wipe-devices")
|
||||
Response wipe(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws WindowsDeviceEnrolmentException;
|
||||
|
||||
@POST
|
||||
@Path("/ring-devices")
|
||||
Response ring(@HeaderParam("Accept") String headerParam, List<String> deviceIds) throws WindowsDeviceEnrolmentException;
|
||||
|
||||
@POST
|
||||
@Path("/lockreset-devices")
|
||||
Response lockReset(@HeaderParam("Accept") String acceptHeader, List<String> deviceIds)
|
||||
throws WindowsDeviceEnrolmentException;
|
||||
}
|
12
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/devicemgtservice/DeviceManagementService.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/DeviceManagementService.java
12
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/devicemgtservice/DeviceManagementService.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/DeviceManagementService.java
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 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.mdm.mobileservices.windows.services;
|
||||
|
||||
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
||||
import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message;
|
||||
|
||||
import javax.jws.WebService;
|
||||
import javax.ws.rs.*;
|
||||
|
||||
/**
|
||||
* Endpoint for Enforce Effective Policy.
|
||||
*/
|
||||
@WebService
|
||||
@Produces({ "application/json", "application/xml"})
|
||||
@Consumes({"application/json", "application/xml"})
|
||||
public interface PolicyManagementService {
|
||||
|
||||
/**
|
||||
* Get the applicable effective policy for an enrolled windows device.
|
||||
*
|
||||
* @param deviceId Device Id
|
||||
* @return Returns retrieved devices.
|
||||
* @throws WindowsConfigurationException occurred while retrieving all the devices from DB.
|
||||
*/
|
||||
@GET
|
||||
@Path("{deviceId}")
|
||||
Message getEffectivePolicy(@HeaderParam("Accept") String acceptHeader,
|
||||
@PathParam("deviceId") String deviceId) throws WindowsConfigurationException;
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* 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.mdm.mobileservices.windows.services.adminoperations;
|
||||
|
||||
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsDeviceEnrolmentException;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Interface for Admin operations persisting. This interface accepts operations added via UI.
|
||||
*/
|
||||
@Path("/operation")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
||||
public interface Operations {
|
||||
|
||||
@POST
|
||||
@Path("/devicelock")
|
||||
Response lock(@HeaderParam("Accept") String headerParam, List<String> deviceids) throws WindowsDeviceEnrolmentException;
|
||||
|
||||
@POST
|
||||
@Path("/devicedisenroll")
|
||||
Response disenroll(@HeaderParam("Accept") String headerParam, List<String> deviceids) throws WindowsDeviceEnrolmentException;
|
||||
|
||||
@POST
|
||||
@Path("/devicewipe")
|
||||
Response wipe(@HeaderParam("Accept") String headerParam, List<String> deviceids) throws WindowsDeviceEnrolmentException;
|
||||
|
||||
@POST
|
||||
@Path("/devicering")
|
||||
Response ring(@HeaderParam("Accept") String headerParam, List<String> deviceids) throws WindowsDeviceEnrolmentException;
|
||||
|
||||
@POST
|
||||
@Path("/lockreset")
|
||||
Response lockReset(@HeaderParam("Accept") String acceptHeader, List<String> deviceids)
|
||||
throws WindowsDeviceEnrolmentException;
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 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.mdm.mobileservices.windows.services.adminoperations.util;
|
||||
//
|
||||
//import com.google.gson.Gson;
|
||||
//import org.apache.commons.logging.Log;
|
||||
//import org.apache.commons.logging.LogFactory;
|
||||
//import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
//import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||
//import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||
//import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||
//import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
||||
//import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
||||
//import org.wso2.carbon.device.mgt.core.operation.mgt.ConfigOperation;
|
||||
//import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
||||
//import org.wso2.carbon.mdm.mobileservices.windows.common.SyncmlCommandType;
|
||||
//import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsDeviceEnrolmentException;
|
||||
//import org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans.Device;
|
||||
//import org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans.OperationRequest;
|
||||
//import org.wso2.carbon.mdm.mobileservices.windows.services.syncml.beans.Wifi;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//
|
||||
//public class OperationStore {
|
||||
//
|
||||
// private static Log log = LogFactory.getLog(OperationStore.class);
|
||||
//
|
||||
// public static boolean storeOperation(OperationRequest operationRequest, Operation.Type type,
|
||||
// String commandType) throws
|
||||
// WindowsDeviceEnrolmentException {
|
||||
//
|
||||
// List<Device> devices = operationRequest.getDeviceList();
|
||||
// List<DeviceIdentifier> deviceIdentifiers = new ArrayList<DeviceIdentifier>();
|
||||
// DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
|
||||
//
|
||||
// Operation operation = transformBasicOperation(operationRequest, type, commandType);
|
||||
//
|
||||
// for (int i = 0; i < devices.size(); i++) {
|
||||
// try {
|
||||
// deviceIdentifier.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||
// deviceIdentifier.setId(devices.get(i).getID());
|
||||
// deviceIdentifiers.add(deviceIdentifier);
|
||||
// getDeviceManagementServiceProvider().getDevice(deviceIdentifier);
|
||||
//
|
||||
// } catch (DeviceManagementException e) {
|
||||
// log.error("Cannot validate device ID: " + devices.get(i).getID());
|
||||
// deviceIdentifiers.remove(i);
|
||||
// }
|
||||
// }
|
||||
// try {
|
||||
// getDeviceManagementServiceProvider().addOperation(operation, deviceIdentifiers);
|
||||
// } catch (OperationManagementException e) {
|
||||
// String msg = "Failure occurred while storing command operation.";
|
||||
// log.error(msg);
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// private static DeviceManagementProviderService getDeviceManagementServiceProvider() {
|
||||
// DeviceManagementProviderService deviceManager;
|
||||
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
||||
// deviceManager =
|
||||
// (DeviceManagementProviderService) ctx.getOSGiService(DeviceManagementProviderService.class, null);
|
||||
//
|
||||
// if (deviceManager == null) {
|
||||
// String msg = "Device management service is not initialized.";
|
||||
// log.error(msg);
|
||||
// }
|
||||
// return deviceManager;
|
||||
// }
|
||||
//
|
||||
// private static Operation transformBasicOperation(OperationRequest operationRequest, Operation.Type type,
|
||||
// String commandType) throws WindowsDeviceEnrolmentException {
|
||||
//
|
||||
// Operation operation = new Operation();
|
||||
// operation.setCode(commandType);
|
||||
// operation.setType(type);
|
||||
// Gson gson = new Gson();
|
||||
//
|
||||
// if (commandType == SyncmlCommandType.WIFI.getValue()) {
|
||||
//
|
||||
// operation = new ConfigOperation();
|
||||
// operation.setCode(commandType);
|
||||
// operation.setType(type);
|
||||
//
|
||||
// Wifi wifiObject = (Wifi) operationRequest.getBasicOperation();
|
||||
// operation.setPayLoad(gson.toJson(wifiObject));
|
||||
// } else {
|
||||
// // no operation.....
|
||||
// }
|
||||
//
|
||||
// return operation;
|
||||
// }
|
||||
//}
|
7
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/ConfigurationMgtServiceImpl.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/impl/ConfigurationMgtServiceImpl.java
7
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/configurationmgtservice/ConfigurationMgtServiceImpl.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/impl/ConfigurationMgtServiceImpl.java
12
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/adminoperations/impl/OperationsImpl.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/impl/DeviceManagementAdminServiceImpl.java
12
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/adminoperations/impl/OperationsImpl.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/impl/DeviceManagementAdminServiceImpl.java
18
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/devicemgtservice/impl/DeviceManagementServiceImpl.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/impl/DeviceManagementServiceImpl.java
18
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/devicemgtservice/impl/DeviceManagementServiceImpl.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/impl/DeviceManagementServiceImpl.java
25
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/policymgtservice/PolicyMgtService.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/impl/PolicyManagementServiceImpl.java
25
components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/policymgtservice/PolicyMgtService.java → components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/services/impl/PolicyManagementServiceImpl.java
Loading…
Reference in new issue