|
|
@ -24,6 +24,8 @@ import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.AppOperation;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.AppOperation;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationType;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationType;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.DeviceTypes;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.SubAction;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.SubsciptionType;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.SubsciptionType;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.SubscribingDeviceIdHolder;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.SubscribingDeviceIdHolder;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO;
|
|
|
@ -65,6 +67,7 @@ import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
|
|
|
|
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
|
|
|
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
@ -87,7 +90,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|
|
|
this.applicationDAO = ApplicationManagementDAOFactory.getApplicationDAO();
|
|
|
|
this.applicationDAO = ApplicationManagementDAOFactory.getApplicationDAO();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override public ApplicationInstallResponse installApplicationForDevices(String applicationUUID,
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public ApplicationInstallResponse installApplicationForDevices(String applicationUUID,
|
|
|
|
List<DeviceIdentifier> deviceIdentifiers) throws ApplicationManagementException {
|
|
|
|
List<DeviceIdentifier> deviceIdentifiers) throws ApplicationManagementException {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Install application which has UUID: " + applicationUUID + " to " + deviceIdentifiers.size()
|
|
|
|
log.debug("Install application which has UUID: " + applicationUUID + " to " + deviceIdentifiers.size()
|
|
|
@ -99,102 +103,94 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DeviceManagementProviderService deviceManagementProviderService = HelperUtil
|
|
|
|
|
|
|
|
.getDeviceManagementProviderService();
|
|
|
|
|
|
|
|
ApplicationDTO applicationDTO = getApplicationDTO(applicationUUID);
|
|
|
|
ApplicationDTO applicationDTO = getApplicationDTO(applicationUUID);
|
|
|
|
DeviceIDHolder filteredDeviceHolder = filterDeviceIdentifiers(applicationDTO, deviceIdentifiers);
|
|
|
|
DeviceIDHolder filteredDeviceHolder = filterDeviceIdentifiers(applicationDTO, deviceIdentifiers);
|
|
|
|
List<DeviceIdentifier> errorDeviceIdentifiers = filteredDeviceHolder.getErrorDeviceIdList();
|
|
|
|
List<DeviceIdentifier> errorDeviceIdentifiers = filteredDeviceHolder.getErrorDeviceIdList();
|
|
|
|
List<Device> filteredDeviceObjs = new ArrayList<>();
|
|
|
|
ApplicationInstallResponse applicationInstallResponse = performBulkAppInstallation(applicationUUID,
|
|
|
|
|
|
|
|
filteredDeviceHolder.getValidDeviceIDList(), SubsciptionType.DEVICE.toString());
|
|
|
|
//getting device objects by using device identifiers
|
|
|
|
|
|
|
|
for (DeviceIdentifier deviceIdentifier : filteredDeviceHolder.getValidDeviceIDList()) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Device device = deviceManagementProviderService.getDevice(deviceIdentifier, false);
|
|
|
|
|
|
|
|
if (device == null) {
|
|
|
|
|
|
|
|
String msg = "Couldn't found an device for device identifier " + deviceIdentifier.getId()
|
|
|
|
|
|
|
|
+ " and device type: " + deviceIdentifier.getType();
|
|
|
|
|
|
|
|
log.warn(msg);
|
|
|
|
|
|
|
|
errorDeviceIdentifiers.add(deviceIdentifier);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
filteredDeviceObjs.add(device);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred when getting device data for device identifier " + deviceIdentifier.getId()
|
|
|
|
|
|
|
|
+ " and device type " + deviceIdentifier.getType();
|
|
|
|
|
|
|
|
log.warn(msg);
|
|
|
|
|
|
|
|
errorDeviceIdentifiers.add(deviceIdentifier);
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ApplicationType.WEB_CLIP.toString().equals(applicationDTO.getType())) {
|
|
|
|
|
|
|
|
DeviceType deviceType = APIUtil.getDeviceTypeData(applicationDTO.getDeviceTypeId());
|
|
|
|
|
|
|
|
String deviceTypeName = deviceType.getName();
|
|
|
|
|
|
|
|
ApplicationInstallResponse applicationInstallResponse = installToDevices(deviceTypeName, filteredDeviceObjs,
|
|
|
|
|
|
|
|
applicationDTO, SubsciptionType.DEVICE.toString(), null);
|
|
|
|
|
|
|
|
applicationInstallResponse.setErrorDevices(errorDeviceIdentifiers);
|
|
|
|
|
|
|
|
return applicationInstallResponse;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//todo improve thos
|
|
|
|
|
|
|
|
ApplicationInstallResponse applicationInstallResponse = installToDevices(null, filteredDeviceObjs,
|
|
|
|
|
|
|
|
applicationDTO, SubsciptionType.DEVICE.toString(), null);
|
|
|
|
|
|
|
|
applicationInstallResponse.setErrorDevices(errorDeviceIdentifiers);
|
|
|
|
applicationInstallResponse.setErrorDevices(errorDeviceIdentifiers);
|
|
|
|
return applicationInstallResponse;
|
|
|
|
return applicationInstallResponse;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ApplicationInstallResponse addBulkApInstallation(String applicationUUID, List<String> subscriberList,
|
|
|
|
public <T> ApplicationInstallResponse performBulkAppInstallation(String applicationUUID, List<T> params,
|
|
|
|
String subType) throws ApplicationManagementException {
|
|
|
|
String subType) throws ApplicationManagementException {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Install application release which has UUID " + applicationUUID + " to " + subscriberList.size()
|
|
|
|
log.debug("Install application release which has UUID " + applicationUUID + " to " + params.size()
|
|
|
|
+ " users.");
|
|
|
|
+ " users.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (subscriberList.isEmpty()) {
|
|
|
|
if (params.isEmpty()) {
|
|
|
|
String msg = "In order to install application release which has UUID " + applicationUUID + ", you shou"
|
|
|
|
String msg = "In order to install application release which has UUID " + applicationUUID + ", you should"
|
|
|
|
+ "ld provide list of subscribers. But found an empty list of users.";
|
|
|
|
+ " provide list of subscribers. But found an empty list of users.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (SubsciptionType.USER.toString().equals(subType) && !SubsciptionType.ROLE.toString().equals(subType)
|
|
|
|
|
|
|
|
&& SubsciptionType.GROUP.toString().equals(subType)) {
|
|
|
|
boolean isValidSubType = Arrays.stream(SubsciptionType.values())
|
|
|
|
|
|
|
|
.anyMatch(sub -> sub.name().equalsIgnoreCase(subType));
|
|
|
|
|
|
|
|
if (!isValidSubType) {
|
|
|
|
String msg = "Found invalid subscription type to install application release witch has UUID: "
|
|
|
|
String msg = "Found invalid subscription type to install application release witch has UUID: "
|
|
|
|
+ applicationUUID + ". Subscription type is " + subType;
|
|
|
|
+ applicationUUID + ". Subscription type is " + subType;
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationDTO applicationDTO = getApplicationDTO(applicationUUID);
|
|
|
|
|
|
|
|
DeviceManagementProviderService deviceManagementProviderService = HelperUtil
|
|
|
|
DeviceManagementProviderService deviceManagementProviderService = HelperUtil
|
|
|
|
.getDeviceManagementProviderService();
|
|
|
|
.getDeviceManagementProviderService();
|
|
|
|
GroupManagementProviderService groupManagementProviderService = HelperUtil
|
|
|
|
GroupManagementProviderService groupManagementProviderService = HelperUtil
|
|
|
|
.getGroupManagementProviderService();
|
|
|
|
.getGroupManagementProviderService();
|
|
|
|
List<Device> filteredDevices = new ArrayList<>();
|
|
|
|
List<Device> filteredDevices = new ArrayList<>();
|
|
|
|
List<Device> subscriberDevices = new ArrayList<>();
|
|
|
|
List<Device> devices = new ArrayList<>();
|
|
|
|
for (String subscriber : subscriberList) {
|
|
|
|
List<String> subscribers = new ArrayList<>();
|
|
|
|
if (SubsciptionType.USER.toString().equals(subType)) {
|
|
|
|
|
|
|
|
subscriberDevices.addAll(deviceManagementProviderService.getDevicesOfUser(subscriber));
|
|
|
|
ApplicationDTO applicationDTO = getApplicationDTO(applicationUUID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (SubsciptionType.DEVICE.toString().equals(subType)) {
|
|
|
|
|
|
|
|
for (T param : params) {
|
|
|
|
|
|
|
|
DeviceIdentifier deviceIdentifier = (DeviceIdentifier) param;
|
|
|
|
|
|
|
|
devices.add(deviceManagementProviderService.getDevice(deviceIdentifier, false));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (SubsciptionType.USER.toString().equals(subType)) {
|
|
|
|
|
|
|
|
for (T param : params) {
|
|
|
|
|
|
|
|
String username = (String) param;
|
|
|
|
|
|
|
|
subscribers.add(username);
|
|
|
|
|
|
|
|
devices.addAll(deviceManagementProviderService.getDevicesOfUser(username));
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (SubsciptionType.ROLE.toString().equals(subType)) {
|
|
|
|
} else if (SubsciptionType.ROLE.toString().equals(subType)) {
|
|
|
|
subscriberDevices.addAll(deviceManagementProviderService.getAllDevicesOfRole(subscriber));
|
|
|
|
for (T param : params) {
|
|
|
|
|
|
|
|
String roleName = (String) param;
|
|
|
|
|
|
|
|
subscribers.add(roleName);
|
|
|
|
|
|
|
|
devices.addAll(deviceManagementProviderService.getAllDevicesOfRole(roleName));
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (SubsciptionType.GROUP.toString().equals(subType)) {
|
|
|
|
} else if (SubsciptionType.GROUP.toString().equals(subType)) {
|
|
|
|
subscriberDevices.addAll(groupManagementProviderService.getAllDevicesOfGroup(subscriber));
|
|
|
|
for (T param : params) {
|
|
|
|
|
|
|
|
String groupName = (String) param;
|
|
|
|
|
|
|
|
subscribers.add(groupName);
|
|
|
|
|
|
|
|
devices.addAll(groupManagementProviderService.getAllDevicesOfGroup(groupName));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!ApplicationType.WEB_CLIP.toString().equals(applicationDTO.getType())) {
|
|
|
|
if (!ApplicationType.WEB_CLIP.toString().equals(applicationDTO.getType())) {
|
|
|
|
DeviceType deviceType = APIUtil.getDeviceTypeData(applicationDTO.getDeviceTypeId());
|
|
|
|
DeviceType deviceType = APIUtil.getDeviceTypeData(applicationDTO.getDeviceTypeId());
|
|
|
|
String deviceTypeName = deviceType.getName();
|
|
|
|
String deviceTypeName = deviceType.getName();
|
|
|
|
for (Device device : subscriberDevices) {
|
|
|
|
for (Device device : devices) {
|
|
|
|
if (deviceTypeName.equals(device.getType())) {
|
|
|
|
if (deviceTypeName.equals(device.getType())) {
|
|
|
|
filteredDevices.add(device);
|
|
|
|
filteredDevices.add(device);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return installToDevices(deviceTypeName, filteredDevices, applicationDTO, subType, subscriberList);
|
|
|
|
// if (SubsciptionType.DEVICE.toString().equals(subType)) {
|
|
|
|
|
|
|
|
// return installToDevices(deviceTypeName, filteredDevices, applicationDTO, subType, null);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
return installToDevices(deviceTypeName, filteredDevices, applicationDTO, subType, subscribers);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//todo improve this
|
|
|
|
//todo improve this
|
|
|
|
return installToDevices(null, subscriberDevices, applicationDTO, subType, subscriberList);
|
|
|
|
// if (SubsciptionType.DEVICE.toString().equals(subType)) {
|
|
|
|
|
|
|
|
// return installToDevices(null, filteredDevices, applicationDTO, subType, null);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
return installToDevices(null, devices, applicationDTO, subType, subscribers);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
String msg = "Error occurred while getting devices of given users or given roles.";
|
|
|
|
String msg = "Error occurred while getting devices of given users or given roles.";
|
|
|
@ -207,6 +203,12 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<DeviceIdentifier> uninstallApplication(String applicationUUID,
|
|
|
|
|
|
|
|
List<DeviceIdentifier> deviceList) throws ApplicationManagementException {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ApplicationInstallResponse installToDevices(String deviceType, List<Device> devices,
|
|
|
|
private ApplicationInstallResponse installToDevices(String deviceType, List<Device> devices,
|
|
|
|
ApplicationDTO applicationDTO, String subType, List<String> subscribers)
|
|
|
|
ApplicationDTO applicationDTO, String subType, List<String> subscribers)
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
throws ApplicationManagementException {
|
|
|
@ -566,17 +568,12 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override public List<DeviceIdentifier> uninstallApplication(String applicationUUID,
|
|
|
|
|
|
|
|
List<DeviceIdentifier> deviceList) throws ApplicationManagementException {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Activity addAppInstallOperationToDevices(ApplicationDTO application,
|
|
|
|
private Activity addAppInstallOperationToDevices(ApplicationDTO application,
|
|
|
|
List<DeviceIdentifier> deviceIdentifierList, String deviceType) throws ApplicationManagementException {
|
|
|
|
List<DeviceIdentifier> deviceIdentifierList, String deviceType) throws ApplicationManagementException {
|
|
|
|
DeviceManagementProviderService deviceManagementProviderService = HelperUtil
|
|
|
|
DeviceManagementProviderService deviceManagementProviderService = HelperUtil
|
|
|
|
.getDeviceManagementProviderService();
|
|
|
|
.getDeviceManagementProviderService();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Operation operation = generateOperationPayloadByDeviceType(deviceType, application);
|
|
|
|
Operation operation = generateOperationPayloadByDeviceType(deviceType, application, null);
|
|
|
|
//todo refactor add operation code to get successful operations
|
|
|
|
//todo refactor add operation code to get successful operations
|
|
|
|
return deviceManagementProviderService.addOperation(deviceType, operation, deviceIdentifierList);
|
|
|
|
return deviceManagementProviderService.addOperation(deviceType, operation, deviceIdentifierList);
|
|
|
|
} catch (OperationManagementException e) {
|
|
|
|
} catch (OperationManagementException e) {
|
|
|
@ -602,7 +599,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|
|
|
.collect(Collectors.groupingBy(DeviceIdentifier::getType));
|
|
|
|
.collect(Collectors.groupingBy(DeviceIdentifier::getType));
|
|
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<String, List<DeviceIdentifier>> entry : deviceTypeIdentifierMap.entrySet()) {
|
|
|
|
for (Map.Entry<String, List<DeviceIdentifier>> entry : deviceTypeIdentifierMap.entrySet()) {
|
|
|
|
Operation operation = generateOperationPayloadByDeviceType(entry.getKey(), application);
|
|
|
|
Operation operation = generateOperationPayloadByDeviceType(entry.getKey(), application, null);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Activity activity = deviceManagementProviderService
|
|
|
|
Activity activity = deviceManagementProviderService
|
|
|
|
.addOperation(entry.getKey(), operation, entry.getValue());
|
|
|
|
.addOperation(entry.getKey(), operation, entry.getValue());
|
|
|
@ -643,11 +640,57 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Operation generateOperationPayloadByDeviceType(String deviceType, ApplicationDTO application) {
|
|
|
|
private Operation generateOperationPayloadByDeviceType(String deviceType, ApplicationDTO application, String action) {
|
|
|
|
ProfileOperation operation = new ProfileOperation();
|
|
|
|
ProfileOperation operation = new ProfileOperation();
|
|
|
|
operation.setCode(INSTALL_APPLICATION);
|
|
|
|
operation.setCode(INSTALL_APPLICATION);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) {
|
|
|
|
|
|
|
|
// if (ApplicationType.ENTERPRISE.toString().equalsIgnoreCase(application.getType())) {
|
|
|
|
|
|
|
|
// if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else if (ApplicationType.PUBLIC.toString().equalsIgnoreCase(application.getType())) {
|
|
|
|
|
|
|
|
// if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// } else if (ApplicationType.WEB_CLIP.toString().equalsIgnoreCase(application.getType())) {
|
|
|
|
|
|
|
|
// if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else if (DeviceTypes.IOS.toString().equalsIgnoreCase(deviceType)) {
|
|
|
|
|
|
|
|
// if (ApplicationType.ENTERPRISE.toString().equalsIgnoreCase(application.getType())) {
|
|
|
|
|
|
|
|
// if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else if (ApplicationType.PUBLIC.toString().equalsIgnoreCase(application.getType())) {
|
|
|
|
|
|
|
|
// if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else if (ApplicationType.WEB_CLIP.toString().equalsIgnoreCase())
|
|
|
|
|
|
|
|
// application.getType() {
|
|
|
|
|
|
|
|
// if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
|
|
|
|
|
|
|
|
// log.error("aaaa");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//todo: generate operation payload correctly for all types of devices.
|
|
|
|
//todo: generate operation payload correctly for all types of devices.
|
|
|
|
operation.setPayLoad(
|
|
|
|
operation.setPayLoad(
|
|
|
|
"{'type':'enterprise', 'url':'" + application.getApplicationReleaseDTOs().get(0).getInstallerName()
|
|
|
|
"{'type':'enterprise', 'url':'" + application.getApplicationReleaseDTOs().get(0).getInstallerName()
|
|
|
|