mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Fixing code formatting.
This commit is contained in:
parent
058cb22358
commit
1aeede731f
@ -1,3 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, 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.services.android.bean;
|
package org.wso2.carbon.mdm.services.android.bean;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
@ -19,4 +37,5 @@ public class NotifierFrequency extends AndroidOperation implements Serializable
|
|||||||
public void setValue(int value) {
|
public void setValue(int value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,11 @@ package org.wso2.carbon.mdm.services.android.services.impl;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.device.mgt.common.*;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
|
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.InvalidDeviceException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
@ -125,16 +129,21 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
|
|||||||
for (Device device : deviceList) {
|
for (Device device : deviceList) {
|
||||||
deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(),device.getType()));
|
deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(),device.getType()));
|
||||||
}
|
}
|
||||||
NotifierFrequency notifierFrequency = new NotifierFrequency();
|
if (entry.getValue() != null) {
|
||||||
notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString()));
|
NotifierFrequency notifierFrequency = new NotifierFrequency();
|
||||||
ProfileOperation operation = new ProfileOperation();
|
notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString()));
|
||||||
operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY);
|
ProfileOperation operation = new ProfileOperation();
|
||||||
operation.setPayLoad(notifierFrequency.toJSON());
|
operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY);
|
||||||
operation.setType(Operation.Type.CONFIG);
|
operation.setPayLoad(notifierFrequency.toJSON());
|
||||||
operation.setEnabled(true);
|
operation.setType(Operation.Type.CONFIG);
|
||||||
AndroidAPIUtils.getDeviceManagementService().addOperation(
|
operation.setEnabled(true);
|
||||||
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID,
|
AndroidAPIUtils.getDeviceManagementService().addOperation(
|
||||||
operation, deviceIdList);
|
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID,
|
||||||
|
operation, deviceIdList);
|
||||||
|
} else {
|
||||||
|
return Response.status(Response.Status.BAD_REQUEST)
|
||||||
|
.entity("No value specified for notifierFrequency.").build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +152,6 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
|
|||||||
}
|
}
|
||||||
configuration.setConfiguration(configs);
|
configuration.setConfiguration(configs);
|
||||||
AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration);
|
AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration);
|
||||||
//AndroidAPIUtils.getGCMService().resetTenantConfigCache();
|
|
||||||
} catch (DeviceManagementException e) {
|
} catch (DeviceManagementException e) {
|
||||||
msg = "Error occurred while modifying configuration settings of Android platform";
|
msg = "Error occurred while modifying configuration settings of Android platform";
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
@ -154,11 +162,6 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
|
|||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
throw new UnexpectedServerErrorException(
|
throw new UnexpectedServerErrorException(
|
||||||
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
|
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
|
||||||
} catch (NullPointerException e) {
|
|
||||||
msg = "Error occurred while reading notifierFrequency value.";
|
|
||||||
log.error(msg, e);
|
|
||||||
throw new UnexpectedServerErrorException(
|
|
||||||
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
|
|
||||||
} catch (OperationManagementException e) {
|
} catch (OperationManagementException e) {
|
||||||
msg = "Error occurred while modifying configuration settings of Android platform.";
|
msg = "Error occurred while modifying configuration settings of Android platform.";
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
|
|||||||
@ -1,3 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, 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.services.android.bean;
|
package org.wso2.carbon.mdm.services.android.bean;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
@ -19,4 +37,5 @@ public class NotifierFrequency extends AndroidOperation implements Serializable
|
|||||||
public void setValue(int value) {
|
public void setValue(int value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -21,7 +21,11 @@ package org.wso2.carbon.mdm.services.android.services.impl;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.device.mgt.common.*;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
|
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.InvalidDeviceException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
@ -126,16 +130,21 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
|
|||||||
for (Device device : deviceList) {
|
for (Device device : deviceList) {
|
||||||
deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
|
||||||
}
|
}
|
||||||
NotifierFrequency notifierFrequency = new NotifierFrequency();
|
if (entry.getValue() != null) {
|
||||||
notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString()));
|
NotifierFrequency notifierFrequency = new NotifierFrequency();
|
||||||
ProfileOperation operation = new ProfileOperation();
|
notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString()));
|
||||||
operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY);
|
ProfileOperation operation = new ProfileOperation();
|
||||||
operation.setPayLoad(notifierFrequency.toJSON());
|
operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY);
|
||||||
operation.setType(Operation.Type.PROFILE);
|
operation.setPayLoad(notifierFrequency.toJSON());
|
||||||
operation.setEnabled(true);
|
operation.setType(Operation.Type.CONFIG);
|
||||||
AndroidAPIUtils.getDeviceManagementService().addOperation(
|
operation.setEnabled(true);
|
||||||
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID,
|
AndroidAPIUtils.getDeviceManagementService().addOperation(
|
||||||
operation, deviceIdList);
|
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID,
|
||||||
|
operation, deviceIdList);
|
||||||
|
} else {
|
||||||
|
return Response.status(Response.Status.BAD_REQUEST)
|
||||||
|
.entity("No value specified for notifierFrequency.").build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user