Merge pull request #1169 from charithag/master

Implemented operation response publishing to analytics
revert-70aa11f8
Charitha Goonetilleke 7 years ago committed by GitHub
commit 57a52ffa4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,39 +25,128 @@
</JndiLookupDefinition> </JndiLookupDefinition>
</DataSourceConfiguration> </DataSourceConfiguration>
</ManagementRepository> </ManagementRepository>
<EmailClientConfiguration> <PushNotificationConfiguration>
<minimumThread>8</minimumThread> <SchedulerBatchSize>1000</SchedulerBatchSize>
<maximumThread>100</maximumThread> <SchedulerBatchDelayMills>60000</SchedulerBatchDelayMills>
<keepAliveTime>20</keepAliveTime> <SchedulerTaskInitialDelay>60000</SchedulerTaskInitialDelay>
<ThreadQueueCapacity>1000</ThreadQueueCapacity> <SchedulerTaskEnabled>true</SchedulerTaskEnabled>
</EmailClientConfiguration> <PushNotificationProviders>
<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.FCMBasedPushNotificationProvider</Provider>
<!--<Provider>org.wso2.carbon.device.mgt.mobile.impl.ios.apns.APNSBasedPushNotificationProvider</Provider>-->
<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.MQTTBasedPushNotificationProvider</Provider>
<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.HTTPBasedPushNotificationProvider</Provider>
<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.XMPPBasedPushNotificationProvider</Provider>
</PushNotificationProviders>
</PushNotificationConfiguration>
<PullNotificationConfiguration>
<Enabled>false</Enabled>
</PullNotificationConfiguration>
<IdentityConfiguration> <IdentityConfiguration>
<ServerUrl>https://localhost:9443</ServerUrl> <ServerUrl>https://localhost:9443</ServerUrl>
<AdminUsername>admin</AdminUsername> <AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword> <AdminPassword>admin</AdminPassword>
</IdentityConfiguration> </IdentityConfiguration>
<KeyManagerConfiguration>
<ServerUrl>https://localhost:9443</ServerUrl>
<AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword>
</KeyManagerConfiguration>
<PolicyConfiguration> <PolicyConfiguration>
<monitoringClass>org.wso2.carbon.policy.mgt</monitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<monitoringEnable>true</monitoringEnable> <MonitoringEnable>true</MonitoringEnable>
<monitoringFrequency>60000</monitoringFrequency> <MonitoringFrequency>60000</MonitoringFrequency>
<maxRetries>5</maxRetries> <MaxRetries>5</MaxRetries>
<minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable> <MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable>
<minRetriesToMarkInactive>20</minRetriesToMarkInactive> <MinRetriesToMarkInactive>20</MinRetriesToMarkInactive>
<!--<PolicyEvaluationPoint>Simple</PolicyEvaluationPoint>--> <!--Set the policy evaluation point name-->
<!--Simple -> Simple policy evaluation point-->
<!--Merged -> Merged policy evaluation point -->
<PolicyEvaluationPoint>Simple</PolicyEvaluationPoint> <PolicyEvaluationPoint>Simple</PolicyEvaluationPoint>
<CacheEnable>true</CacheEnable> <CacheEnable>true</CacheEnable>
</PolicyConfiguration> </PolicyConfiguration>
<!--This specifies whether to enable the DeviceStatus Task in this node.--> <!-- Default Page size configuration for paginated DM APIs-->
<PaginationConfiguration>
<DeviceListPageSize>20</DeviceListPageSize>
<GroupListPageSize>20</GroupListPageSize>
<NotificationListPageSize>20</NotificationListPageSize>
<ActivityListPageSize>20</ActivityListPageSize>
<OperationListPageSize>20</OperationListPageSize>
<TopicListPageSize>20</TopicListPageSize>
</PaginationConfiguration>
<!--This specifies whether to enable the DeviceStatus Task in this node. In clustered setup only master node
should have to run this task.-->
<DeviceStatusTaskConfig> <DeviceStatusTaskConfig>
<Enable>true</Enable> <Enable>true</Enable>
</DeviceStatusTaskConfig> </DeviceStatusTaskConfig>
<!--This controls the in-memory device cache which is local to this node. Setting it enable will activate the
device caching for upto configured expiry-time in seconds. In clustered setup all worker nodes can enable the
device-cache to improve performance. -->
<DeviceCacheConfiguration>
<Enable>true</Enable>
<ExpiryTime>600</ExpiryTime>
<!--This configuration specifies the number of cache entries in device cache. default capacity is 10000 entries.
This can be configured to higher number if cache eviction happens due to large number of devices in the
server environment-->
<Capacity>10000</Capacity>
</DeviceCacheConfiguration>
<CertificateCacheConfiguration> <CertificateCacheConfiguration>
<Enable>true</Enable> <Enable>true</Enable>
<ExpiryTime>86400</ExpiryTime> <ExpiryTime>86400</ExpiryTime>
</CertificateCacheConfiguration> </CertificateCacheConfiguration>
<DeviceCacheConfiguration> <ArchivalConfiguration>
<Enable>true</Enable> <DataSourceConfiguration>
<ExpiryTime>300</ExpiryTime> <JndiLookupDefinition>
</DeviceCacheConfiguration> <Name>jdbc/DM_ARCHIVAL_DS</Name>
</JndiLookupDefinition>
</DataSourceConfiguration>
<ArchivalTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivalTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 0 1/1 * ? *</CronExpression>
<!-- How many days of data should we keep in transactional tables? Must be in number of days -->
<RetentionPeriod>30</RetentionPeriod>
<ExecutionBatchSize>1000</ExecutionBatchSize>
<PurgingTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivedDataDeletionTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 3 1/1 * ? *</CronExpression>
<!-- After this number of days, data will be permanently deleted from archival tables.
Data retention period must be in number of DAYS -->
<RetentionPeriod>365</RetentionPeriod>
</PurgingTask>
</ArchivalTask>
</ArchivalConfiguration>
<GeoLocationConfiguration>
<Enabled>false</Enabled>
</GeoLocationConfiguration>
<OperationAnalyticsConfiguration>
<PublishLocationResponse>false</PublishLocationResponse>
<PublishDeviceInfoResponse>false</PublishDeviceInfoResponse>
<PublishOperationResponse>
<Enabled>false</Enabled>
<Operations>
<!-- Publish specific operation responses -->
<!--
<Operation>BATTERY_LEVEL</Operation>
<Operation>CHECK_LOCK_STATUS</Operation>
-->
<!-- use wildcard '*' to publish all responses -->
<Operation>*</Operation>
</Operations>
</PublishOperationResponse>
</OperationAnalyticsConfiguration>
<!--This configuration used to configure the options for remote device control feature -->
<RemoteSessionConfiguration>
<Enabled>true</Enabled>
<RemoteSessionServerUrl>wss://localhost:9443</RemoteSessionServerUrl>
<MaximumHTTPConnectionPerHost>2</MaximumHTTPConnectionPerHost>
<MaximumTotalHTTPConnections>100</MaximumTotalHTTPConnections>
<MaximumMessagesPerSecond>20</MaximumMessagesPerSecond>
<SessionIdleTimeOut>15</SessionIdleTimeOut>
<MaximumMessageBufferSize>640</MaximumMessageBufferSize>
</RemoteSessionConfiguration>
<DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

@ -170,7 +170,6 @@
<dependency> <dependency>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId> <artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
<scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>

@ -17,11 +17,11 @@
*/ */
package org.wso2.carbon.device.mgt.core.config; package org.wso2.carbon.device.mgt.core.config;
import org.wso2.carbon.device.mgt.core.config.analytics.OperationAnalyticsConfiguration;
import org.wso2.carbon.device.mgt.core.config.archival.ArchivalConfiguration; import org.wso2.carbon.device.mgt.core.config.archival.ArchivalConfiguration;
import org.wso2.carbon.device.mgt.core.config.cache.CertificateCacheConfiguration; import org.wso2.carbon.device.mgt.core.config.cache.CertificateCacheConfiguration;
import org.wso2.carbon.device.mgt.core.config.geo.location.GeoLocationConfiguration;
import org.wso2.carbon.device.mgt.core.config.geo.location.OperationAnalyticsConfiguration;
import org.wso2.carbon.device.mgt.core.config.cache.DeviceCacheConfiguration; import org.wso2.carbon.device.mgt.core.config.cache.DeviceCacheConfiguration;
import org.wso2.carbon.device.mgt.core.config.geo.location.GeoLocationConfiguration;
import org.wso2.carbon.device.mgt.core.config.identity.IdentityConfigurations; import org.wso2.carbon.device.mgt.core.config.identity.IdentityConfigurations;
import org.wso2.carbon.device.mgt.core.config.keymanager.KeyManagerConfigurations; import org.wso2.carbon.device.mgt.core.config.keymanager.KeyManagerConfigurations;
import org.wso2.carbon.device.mgt.core.config.pagination.PaginationConfiguration; import org.wso2.carbon.device.mgt.core.config.pagination.PaginationConfiguration;

@ -0,0 +1,63 @@
/*
* 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.device.mgt.core.config.analytics;
import org.wso2.carbon.device.mgt.core.config.analytics.operation.OperationResponseConfigurations;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* This class represents the information related to Device Operation Analytics configuration.
*/
@XmlRootElement(name = "OperationAnalyticsConfiguration")
public class OperationAnalyticsConfiguration {
private boolean isPublishDeviceInfoResponseEnabled;
private boolean isPublishLocationResponseEnabled;
private OperationResponseConfigurations operationResponseConfigurations;
public boolean isPublishDeviceInfoResponseEnabled() {
return isPublishDeviceInfoResponseEnabled;
}
@XmlElement(name = "PublishDeviceInfoResponse", required = true)
public void setPublishDeviceInfoResponseEnabled(boolean publishDeviceInfoResponseEnabled) {
this.isPublishDeviceInfoResponseEnabled = publishDeviceInfoResponseEnabled;
}
public boolean isPublishLocationResponseEnabled() {
return isPublishLocationResponseEnabled;
}
@XmlElement(name = "PublishLocationResponse", required = true)
public void setPublishLocationResponseEnabled(boolean publishLocationResponseEnabled) {
this.isPublishLocationResponseEnabled = publishLocationResponseEnabled;
}
public OperationResponseConfigurations getOperationResponseConfigurations() {
return operationResponseConfigurations;
}
@XmlElement(name = "PublishOperationResponse", required = true)
public void setOperationResponseConfigurations(
OperationResponseConfigurations operationResponseConfigurations) {
this.operationResponseConfigurations = operationResponseConfigurations;
}
}

@ -0,0 +1,53 @@
/*
* 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.device.mgt.core.config.analytics.operation;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
/**
* This class represents the information related to Operation response configuration.
*/
@XmlRootElement(name = "PublishOperationResponse")
public class OperationResponseConfigurations {
private boolean enabled;
private List<String> operations;
public boolean isEnabled() {
return enabled;
}
@XmlElement(name = "Enabled", required = true)
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public List<String> getOperations() {
return operations;
}
@XmlElementWrapper(name = "Operations", required = true)
@XmlElement(name = "Operation", required = true)
public void setOperations(List<String> operations) {
this.operations = operations;
}
}

@ -1,50 +0,0 @@
/*
* Copyright (c) 2017, 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.core.config.geo.location;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* This class represents the information related to Device Operation Analytics configuration.
*/
@XmlRootElement(name = "OperationAnalyticsConfiguration")
public class OperationAnalyticsConfiguration {
private boolean publishDeviceInfoResponse;
private boolean publishLocationResponse;
public boolean getPublishDeviceInfoResponse() {
return publishDeviceInfoResponse;
}
@XmlElement(name = "PublishDeviceInfoResponse", required = true)
public void setPublishDeviceInfoResponse(boolean publishDeviceInfoResponse) {
this.publishDeviceInfoResponse = publishDeviceInfoResponse;
}
public boolean getPublishLocationResponse() {
return publishLocationResponse;
}
@XmlElement(name = "PublishLocationResponse", required = true)
public void setPublishLocationResponse(boolean publishLocationResponse) {
this.publishLocationResponse = publishLocationResponse;
}
}

@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
@ -87,6 +88,7 @@ import org.wso2.carbon.user.api.UserStoreException;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
@ -100,6 +102,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
PluginInitializationListener { PluginInitializationListener {
private static Log log = LogFactory.getLog(DeviceManagementProviderServiceImpl.class); private static Log log = LogFactory.getLog(DeviceManagementProviderServiceImpl.class);
private static final String OPERATION_RESPONSE_EVENT_STREAM_DEFINITION = "org.wso2.iot.OperationResponseStream";
private DeviceDAO deviceDAO; private DeviceDAO deviceDAO;
private DeviceDetailsDAO deviceInfoDAO; private DeviceDetailsDAO deviceInfoDAO;
private DeviceTypeDAO deviceTypeDAO; private DeviceTypeDAO deviceTypeDAO;
@ -1447,6 +1450,34 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
public void updateOperation(DeviceIdentifier deviceId, Operation operation) throws OperationManagementException { public void updateOperation(DeviceIdentifier deviceId, Operation operation) throws OperationManagementException {
pluginRepository.getOperationManager(deviceId.getType(), this.getTenantId()) pluginRepository.getOperationManager(deviceId.getType(), this.getTenantId())
.updateOperation(deviceId, operation); .updateOperation(deviceId, operation);
try {
if (DeviceManagerUtil.isPublishOperationResponseEnabled()) {
List<String> permittedOperations = DeviceManagerUtil.getEnabledOperationsForResponsePublish();
if (permittedOperations.contains(operation.getCode())
|| permittedOperations.contains("*")) {
Object[] metaData = {deviceId.getId(), deviceId.getType()};
Object[] payload = new Object[]{
Calendar.getInstance().getTimeInMillis(),
operation.getId(),
operation.getCode(),
operation.getType() != null ? operation.getType().toString() : null,
operation.getStatus() != null ? operation.getStatus().toString() : null,
operation.getOperationResponse()
};
DeviceManagerUtil.getEventPublisherService().publishEvent(
OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
);
}
}
} catch (DeviceManagementException e) {
String msg = "Error occurred while reading configs.";
log.error(msg, e);
throw new OperationManagementException(msg, e);
} catch (DataPublisherConfigurationException e) {
String msg = "Error occurred while publishing event.";
log.error(msg, e);
throw new OperationManagementException(msg, e);
}
} }
@Override @Override

@ -419,7 +419,7 @@ public final class DeviceManagerUtil {
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance(). DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().
getDeviceManagementConfig(); getDeviceManagementConfig();
if (deviceManagementConfig != null) { if (deviceManagementConfig != null) {
return deviceManagementConfig.getOperationAnalyticsConfiguration().getPublishLocationResponse(); return deviceManagementConfig.getOperationAnalyticsConfiguration().isPublishLocationResponseEnabled();
} else { } else {
throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " + throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " +
"cdm-config.xml file."); "cdm-config.xml file.");
@ -430,7 +430,31 @@ public final class DeviceManagerUtil {
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance(). DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().
getDeviceManagementConfig(); getDeviceManagementConfig();
if (deviceManagementConfig != null) { if (deviceManagementConfig != null) {
return deviceManagementConfig.getOperationAnalyticsConfiguration().getPublishDeviceInfoResponse(); return deviceManagementConfig.getOperationAnalyticsConfiguration().isPublishDeviceInfoResponseEnabled();
} else {
throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " +
"cdm-config.xml file.");
}
}
public static boolean isPublishOperationResponseEnabled() throws DeviceManagementException {
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().
getDeviceManagementConfig();
if (deviceManagementConfig != null) {
return deviceManagementConfig.getOperationAnalyticsConfiguration()
.getOperationResponseConfigurations().isEnabled();
} else {
throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " +
"cdm-config.xml file.");
}
}
public static List<String> getEnabledOperationsForResponsePublish() throws DeviceManagementException {
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().
getDeviceManagementConfig();
if (deviceManagementConfig != null) {
return deviceManagementConfig.getOperationAnalyticsConfiguration()
.getOperationResponseConfigurations().getOperations();
} else { } else {
throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " + throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " +
"cdm-config.xml file."); "cdm-config.xml file.");

@ -46,6 +46,11 @@
<AdminUsername>admin</AdminUsername> <AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword> <AdminPassword>admin</AdminPassword>
</IdentityConfiguration> </IdentityConfiguration>
<KeyManagerConfiguration>
<ServerUrl>https://localhost:9443</ServerUrl>
<AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword>
</KeyManagerConfiguration>
<PolicyConfiguration> <PolicyConfiguration>
<MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<MonitoringEnable>true</MonitoringEnable> <MonitoringEnable>true</MonitoringEnable>
@ -88,6 +93,31 @@
<Enable>false</Enable> <Enable>false</Enable>
<ExpiryTime>86400</ExpiryTime> <ExpiryTime>86400</ExpiryTime>
</CertificateCacheConfiguration> </CertificateCacheConfiguration>
<ArchivalConfiguration>
<DataSourceConfiguration>
<JndiLookupDefinition>
<Name>jdbc/DM_ARCHIVAL_DS</Name>
</JndiLookupDefinition>
</DataSourceConfiguration>
<ArchivalTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivalTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 0 1/1 * ? *</CronExpression>
<!-- How many days of data should we keep in transactional tables? Must be in number of days -->
<RetentionPeriod>30</RetentionPeriod>
<ExecutionBatchSize>1000</ExecutionBatchSize>
<PurgingTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivedDataDeletionTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 3 1/1 * ? *</CronExpression>
<!-- After this number of days, data will be permanently deleted from archival tables.
Data retention period must be in number of DAYS -->
<RetentionPeriod>365</RetentionPeriod>
</PurgingTask>
</ArchivalTask>
</ArchivalConfiguration>
<GeoLocationConfiguration> <GeoLocationConfiguration>
<Enabled>false</Enabled> <Enabled>false</Enabled>
</GeoLocationConfiguration> </GeoLocationConfiguration>
@ -107,6 +137,16 @@
</Operations> </Operations>
</PublishOperationResponse> </PublishOperationResponse>
</OperationAnalyticsConfiguration> </OperationAnalyticsConfiguration>
<!--This configuration used to configure the options for remote device control feature -->
<RemoteSessionConfiguration>
<Enabled>true</Enabled>
<RemoteSessionServerUrl>wss://localhost:9443</RemoteSessionServerUrl>
<MaximumHTTPConnectionPerHost>2</MaximumHTTPConnectionPerHost>
<MaximumTotalHTTPConnections>100</MaximumTotalHTTPConnections>
<MaximumMessagesPerSecond>20</MaximumMessagesPerSecond>
<SessionIdleTimeOut>15</SessionIdleTimeOut>
<MaximumMessageBufferSize>640</MaximumMessageBufferSize>
</RemoteSessionConfiguration>
<DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration> <DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

@ -46,6 +46,11 @@
<AdminUsername>admin</AdminUsername> <AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword> <AdminPassword>admin</AdminPassword>
</IdentityConfiguration> </IdentityConfiguration>
<KeyManagerConfiguration>
<ServerUrl>https://localhost:9443</ServerUrl>
<AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword>
</KeyManagerConfiguration>
<PolicyConfiguration> <PolicyConfiguration>
<MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<MonitoringEnable>true</MonitoringEnable> <MonitoringEnable>true</MonitoringEnable>
@ -88,10 +93,60 @@
<Enable>false</Enable> <Enable>false</Enable>
<ExpiryTime>86400</ExpiryTime> <ExpiryTime>86400</ExpiryTime>
</CertificateCacheConfiguration> </CertificateCacheConfiguration>
<ArchivalConfiguration>
<DataSourceConfiguration>
<JndiLookupDefinition>
<Name>jdbc/DM_ARCHIVAL_DS</Name>
</JndiLookupDefinition>
</DataSourceConfiguration>
<ArchivalTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivalTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 0 1/1 * ? *</CronExpression>
<!-- How many days of data should we keep in transactional tables? Must be in number of days -->
<RetentionPeriod>30</RetentionPeriod>
<ExecutionBatchSize>1000</ExecutionBatchSize>
<PurgingTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivedDataDeletionTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 3 1/1 * ? *</CronExpression>
<!-- After this number of days, data will be permanently deleted from archival tables.
Data retention period must be in number of DAYS -->
<RetentionPeriod>365</RetentionPeriod>
</PurgingTask>
</ArchivalTask>
</ArchivalConfiguration>
<GeoLocationConfiguration> <GeoLocationConfiguration>
<isEnabled>false</isEnabled> <Enabled>false</Enabled>
<PublishLocationOperationResponse>false</PublishLocationOperationResponse>
</GeoLocationConfiguration> </GeoLocationConfiguration>
<OperationAnalyticsConfiguration>
<PublishLocationResponse>false</PublishLocationResponse>
<PublishDeviceInfoResponse>false</PublishDeviceInfoResponse>
<PublishOperationResponse>
<Enabled>false</Enabled>
<Operations>
<!-- Publish specific operation responses -->
<!--
<Operation>BATTERY_LEVEL</Operation>
<Operation>CHECK_LOCK_STATUS</Operation>
-->
<!-- use wildcard '*' to publish all responses -->
<Operation>*</Operation>
</Operations>
</PublishOperationResponse>
</OperationAnalyticsConfiguration>
<!--This configuration used to configure the options for remote device control feature -->
<RemoteSessionConfiguration>
<Enabled>true</Enabled>
<RemoteSessionServerUrl>wss://localhost:9443</RemoteSessionServerUrl>
<MaximumHTTPConnectionPerHost>2</MaximumHTTPConnectionPerHost>
<MaximumTotalHTTPConnections>100</MaximumTotalHTTPConnections>
<MaximumMessagesPerSecond>20</MaximumMessagesPerSecond>
<SessionIdleTimeOut>15</SessionIdleTimeOut>
<MaximumMessageBufferSize>640</MaximumMessageBufferSize>
</RemoteSessionConfiguration>
<DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration> <DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

@ -93,10 +93,51 @@
<Enable>false</Enable> <Enable>false</Enable>
<ExpiryTime>86400</ExpiryTime> <ExpiryTime>86400</ExpiryTime>
</CertificateCacheConfiguration> </CertificateCacheConfiguration>
<ArchivalConfiguration>
<DataSourceConfiguration>
<JndiLookupDefinition>
<Name>jdbc/DM_ARCHIVAL_DS</Name>
</JndiLookupDefinition>
</DataSourceConfiguration>
<ArchivalTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivalTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 0 1/1 * ? *</CronExpression>
<!-- How many days of data should we keep in transactional tables? Must be in number of days -->
<RetentionPeriod>30</RetentionPeriod>
<ExecutionBatchSize>1000</ExecutionBatchSize>
<PurgingTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivedDataDeletionTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 3 1/1 * ? *</CronExpression>
<!-- After this number of days, data will be permanently deleted from archival tables.
Data retention period must be in number of DAYS -->
<RetentionPeriod>365</RetentionPeriod>
</PurgingTask>
</ArchivalTask>
</ArchivalConfiguration>
<GeoLocationConfiguration> <GeoLocationConfiguration>
<isEnabled>false</isEnabled> <Enabled>false</Enabled>
<PublishLocationOperationResponse>false</PublishLocationOperationResponse>
</GeoLocationConfiguration> </GeoLocationConfiguration>
<OperationAnalyticsConfiguration>
<PublishLocationResponse>false</PublishLocationResponse>
<PublishDeviceInfoResponse>false</PublishDeviceInfoResponse>
<PublishOperationResponse>
<Enabled>false</Enabled>
<Operations>
<!-- Publish specific operation responses -->
<!--
<Operation>BATTERY_LEVEL</Operation>
<Operation>CHECK_LOCK_STATUS</Operation>
-->
<!-- use wildcard '*' to publish all responses -->
<Operation>*</Operation>
</Operations>
</PublishOperationResponse>
</OperationAnalyticsConfiguration>
<!--This configuration used to configure the options for remote device control feature -->
<RemoteSessionConfiguration> <RemoteSessionConfiguration>
<Enabled>true</Enabled> <Enabled>true</Enabled>
<RemoteSessionServerUrl>wss://localhost:9443</RemoteSessionServerUrl> <RemoteSessionServerUrl>wss://localhost:9443</RemoteSessionServerUrl>

@ -25,41 +25,128 @@
</JndiLookupDefinition> </JndiLookupDefinition>
</DataSourceConfiguration> </DataSourceConfiguration>
</ManagementRepository> </ManagementRepository>
<EmailClientConfiguration> <PushNotificationConfiguration>
<minimumThread>8</minimumThread> <SchedulerBatchSize>1000</SchedulerBatchSize>
<maximumThread>100</maximumThread> <SchedulerBatchDelayMills>60000</SchedulerBatchDelayMills>
<keepAliveTime>20</keepAliveTime> <SchedulerTaskInitialDelay>60000</SchedulerTaskInitialDelay>
<ThreadQueueCapacity>1000</ThreadQueueCapacity> <SchedulerTaskEnabled>true</SchedulerTaskEnabled>
</EmailClientConfiguration> <PushNotificationProviders>
<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.FCMBasedPushNotificationProvider</Provider>
<!--<Provider>org.wso2.carbon.device.mgt.mobile.impl.ios.apns.APNSBasedPushNotificationProvider</Provider>-->
<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.MQTTBasedPushNotificationProvider</Provider>
<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.HTTPBasedPushNotificationProvider</Provider>
<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.XMPPBasedPushNotificationProvider</Provider>
</PushNotificationProviders>
</PushNotificationConfiguration>
<PullNotificationConfiguration>
<Enabled>false</Enabled>
</PullNotificationConfiguration>
<IdentityConfiguration> <IdentityConfiguration>
<ServerUrl>https://localhost:9443</ServerUrl> <ServerUrl>https://localhost:9443</ServerUrl>
<AdminUsername>admin</AdminUsername> <AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword> <AdminPassword>admin</AdminPassword>
</IdentityConfiguration> </IdentityConfiguration>
<KeyManagerConfiguration>
<ServerUrl>https://localhost:9443</ServerUrl>
<AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword>
</KeyManagerConfiguration>
<PolicyConfiguration> <PolicyConfiguration>
<monitoringClass>org.wso2.carbon.policy.mgt</monitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<monitoringEnable>true</monitoringEnable> <MonitoringEnable>true</MonitoringEnable>
<monitoringFrequency>60000</monitoringFrequency> <MonitoringFrequency>60000</MonitoringFrequency>
<maxRetries>5</maxRetries> <MaxRetries>5</MaxRetries>
<minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable> <MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable>
<minRetriesToMarkInactive>20</minRetriesToMarkInactive> <MinRetriesToMarkInactive>20</MinRetriesToMarkInactive>
<!--<PolicyEvaluationPoint>Simple</PolicyEvaluationPoint>--> <!--Set the policy evaluation point name-->
<!--Simple -> Simple policy evaluation point-->
<!--Merged -> Merged policy evaluation point -->
<PolicyEvaluationPoint>Simple</PolicyEvaluationPoint> <PolicyEvaluationPoint>Simple</PolicyEvaluationPoint>
<CacheEnable>true</CacheEnable> <CacheEnable>true</CacheEnable>
</PolicyConfiguration> </PolicyConfiguration>
<!--This specifies whether to enable the DeviceStatus Task in this node.--> <!-- Default Page size configuration for paginated DM APIs-->
<PaginationConfiguration>
<DeviceListPageSize>20</DeviceListPageSize>
<GroupListPageSize>20</GroupListPageSize>
<NotificationListPageSize>20</NotificationListPageSize>
<ActivityListPageSize>20</ActivityListPageSize>
<OperationListPageSize>20</OperationListPageSize>
<TopicListPageSize>20</TopicListPageSize>
</PaginationConfiguration>
<!--This specifies whether to enable the DeviceStatus Task in this node. In clustered setup only master node
should have to run this task.-->
<DeviceStatusTaskConfig> <DeviceStatusTaskConfig>
<Enable>true</Enable> <Enable>true</Enable>
</DeviceStatusTaskConfig> </DeviceStatusTaskConfig>
<!--This controls the in-memory device cache which is local to this node. Setting it enable will activate the
device caching for upto configured expiry-time in seconds. In clustered setup all worker nodes can enable the
device-cache to improve performance. -->
<DeviceCacheConfiguration> <DeviceCacheConfiguration>
<Enable>true</Enable> <Enable>true</Enable>
<ExpiryTime>300</ExpiryTime> <ExpiryTime>600</ExpiryTime>
<!--This configuration specifies the number of cache entries in device cache. default capacity is 10000 entries.
This can be configured to higher number if cache eviction happens due to large number of devices in the
server environment-->
<Capacity>10000</Capacity>
</DeviceCacheConfiguration> </DeviceCacheConfiguration>
<PushNotificationConfiguration> <CertificateCacheConfiguration>
<SchedulerBatchSize>100</SchedulerBatchSize> <Enable>true</Enable>
<SchedulerBatchDelayMills>2000</SchedulerBatchDelayMills> <ExpiryTime>86400</ExpiryTime>
<SchedulerTaskInitialDelay>10</SchedulerTaskInitialDelay> </CertificateCacheConfiguration>
<SchedulerTaskEnabled>false</SchedulerTaskEnabled> <ArchivalConfiguration>
</PushNotificationConfiguration> <DataSourceConfiguration>
<JndiLookupDefinition>
<Name>jdbc/DM_ARCHIVAL_DS</Name>
</JndiLookupDefinition>
</DataSourceConfiguration>
<ArchivalTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivalTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 0 1/1 * ? *</CronExpression>
<!-- How many days of data should we keep in transactional tables? Must be in number of days -->
<RetentionPeriod>30</RetentionPeriod>
<ExecutionBatchSize>1000</ExecutionBatchSize>
<PurgingTask>
<Enabled>false</Enabled>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivedDataDeletionTask</TaskClass>
<!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 3 1/1 * ? *</CronExpression>
<!-- After this number of days, data will be permanently deleted from archival tables.
Data retention period must be in number of DAYS -->
<RetentionPeriod>365</RetentionPeriod>
</PurgingTask>
</ArchivalTask>
</ArchivalConfiguration>
<GeoLocationConfiguration>
<Enabled>false</Enabled>
</GeoLocationConfiguration>
<OperationAnalyticsConfiguration>
<PublishLocationResponse>false</PublishLocationResponse>
<PublishDeviceInfoResponse>false</PublishDeviceInfoResponse>
<PublishOperationResponse>
<Enabled>false</Enabled>
<Operations>
<!-- Publish specific operation responses -->
<!--
<Operation>BATTERY_LEVEL</Operation>
<Operation>CHECK_LOCK_STATUS</Operation>
-->
<!-- use wildcard '*' to publish all responses -->
<Operation>*</Operation>
</Operations>
</PublishOperationResponse>
</OperationAnalyticsConfiguration>
<!--This configuration used to configure the options for remote device control feature -->
<RemoteSessionConfiguration>
<Enabled>true</Enabled>
<RemoteSessionServerUrl>wss://localhost:9443</RemoteSessionServerUrl>
<MaximumHTTPConnectionPerHost>2</MaximumHTTPConnectionPerHost>
<MaximumTotalHTTPConnections>100</MaximumTotalHTTPConnections>
<MaximumMessagesPerSecond>20</MaximumMessagesPerSecond>
<SessionIdleTimeOut>15</SessionIdleTimeOut>
<MaximumMessageBufferSize>640</MaximumMessageBufferSize>
</RemoteSessionConfiguration>
<DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

@ -46,6 +46,11 @@
<AdminUsername>admin</AdminUsername> <AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword> <AdminPassword>admin</AdminPassword>
</IdentityConfiguration> </IdentityConfiguration>
<KeyManagerConfiguration>
<ServerUrl>https://localhost:9443</ServerUrl>
<AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword>
</KeyManagerConfiguration>
<PolicyConfiguration> <PolicyConfiguration>
<MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<MonitoringEnable>true</MonitoringEnable> <MonitoringEnable>true</MonitoringEnable>
@ -88,11 +93,6 @@
<Enable>false</Enable> <Enable>false</Enable>
<ExpiryTime>86400</ExpiryTime> <ExpiryTime>86400</ExpiryTime>
</CertificateCacheConfiguration> </CertificateCacheConfiguration>
<GeoLocationConfiguration>
<isEnabled>false</isEnabled>
<PublishLocationOperationResponse>false</PublishLocationOperationResponse>
</GeoLocationConfiguration>
<DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration>
<ArchivalConfiguration> <ArchivalConfiguration>
<DataSourceConfiguration> <DataSourceConfiguration>
<JndiLookupDefinition> <JndiLookupDefinition>
@ -112,11 +112,41 @@
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivedDataDeletionTask</TaskClass> <TaskClass>org.wso2.carbon.device.mgt.core.task.impl.ArchivedDataDeletionTask</TaskClass>
<!-- Cron expression to run the task at specified time --> <!-- Cron expression to run the task at specified time -->
<CronExpression>0 0 3 1/1 * ? *</CronExpression> <CronExpression>0 0 3 1/1 * ? *</CronExpression>
<!-- After this number of days, data will be permanantly deleted from archival tables. <!-- After this number of days, data will be permanently deleted from archival tables.
Data retention period must be in number of DAYS --> Data retention period must be in number of DAYS -->
<RetentionPeriod>365</RetentionPeriod> <RetentionPeriod>365</RetentionPeriod>
</PurgingTask> </PurgingTask>
</ArchivalTask> </ArchivalTask>
</ArchivalConfiguration> </ArchivalConfiguration>
<GeoLocationConfiguration>
<Enabled>false</Enabled>
</GeoLocationConfiguration>
<OperationAnalyticsConfiguration>
<PublishLocationResponse>false</PublishLocationResponse>
<PublishDeviceInfoResponse>false</PublishDeviceInfoResponse>
<PublishOperationResponse>
<Enabled>false</Enabled>
<Operations>
<!-- Publish specific operation responses -->
<!--
<Operation>BATTERY_LEVEL</Operation>
<Operation>CHECK_LOCK_STATUS</Operation>
-->
<!-- use wildcard '*' to publish all responses -->
<Operation>*</Operation>
</Operations>
</PublishOperationResponse>
</OperationAnalyticsConfiguration>
<!--This configuration used to configure the options for remote device control feature -->
<RemoteSessionConfiguration>
<Enabled>true</Enabled>
<RemoteSessionServerUrl>wss://localhost:9443</RemoteSessionServerUrl>
<MaximumHTTPConnectionPerHost>2</MaximumHTTPConnectionPerHost>
<MaximumTotalHTTPConnections>100</MaximumTotalHTTPConnections>
<MaximumMessagesPerSecond>20</MaximumMessagesPerSecond>
<SessionIdleTimeOut>15</SessionIdleTimeOut>
<MaximumMessageBufferSize>640</MaximumMessageBufferSize>
</RemoteSessionConfiguration>
<DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

Loading…
Cancel
Save