Doing a partial commit

4.x.x
geethkokila 9 years ago
parent ac9acbef82
commit 7a809c1c01

@ -80,6 +80,8 @@
org.wso2.carbon.identity.oauth.stub.dto,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.apimgt.impl,
org.wso2.carbon.ntask.core.*,
org.wso2.carbon.ntask.common,
org.wso2.carbon.ndatasource.core,
org.apache.axis2.transport.mail,
org.apache.catalina,
@ -216,6 +218,18 @@
<groupId>org.wso2.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
</dependency>
<!--Ntask dependencies-->
<dependency>
<groupId>org.wso2.carbon.commons</groupId>
<artifactId>org.wso2.carbon.ntask.core</artifactId>
</dependency>
<!--&lt;!&ndash;Data dependencies&ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.wso2.carbon.data</groupId>-->
<!--<artifactId>org.wso2.carbon.dataservices.sql.driver</artifactId>-->
<!--</dependency>-->
</dependencies>
</project>

@ -21,6 +21,7 @@ import org.wso2.carbon.device.mgt.core.config.datasource.DataSourceConfig;
import org.wso2.carbon.device.mgt.core.config.email.EmailConfigurations;
import org.wso2.carbon.device.mgt.core.config.identity.IdentityConfigurations;
import org.wso2.carbon.device.mgt.core.config.policy.PolicyConfiguration;
import org.wso2.carbon.device.mgt.core.config.task.TaskConfiguration;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@ -35,6 +36,7 @@ public class DeviceManagementConfigRepository {
private EmailConfigurations emailConfigurations;
private IdentityConfigurations identityConfigurations;
private PolicyConfiguration policyConfiguration;
private TaskConfiguration taskConfiguration;
@XmlElement(name = "DataSourceConfiguration", required = true)
public DataSourceConfig getDataSourceConfig() {
@ -71,4 +73,13 @@ public class DeviceManagementConfigRepository {
public void setPolicyConfiguration(PolicyConfiguration policyConfiguration) {
this.policyConfiguration = policyConfiguration;
}
@XmlElement(name = "TaskConfiguration", required = true)
public TaskConfiguration getTaskConfiguration() {
return taskConfiguration;
}
public void setTaskConfiguration(TaskConfiguration taskConfiguration) {
this.taskConfiguration = taskConfiguration;
}
}

@ -25,6 +25,7 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager;
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfig;
import org.wso2.carbon.device.mgt.core.config.license.LicenseConfig;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.ntask.core.service.TaskService;
import org.wso2.carbon.registry.core.service.RegistryService;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.user.core.tenant.TenantManager;
@ -46,6 +47,7 @@ public class DeviceManagementDataHolder {
private ConfigurationContextService configurationContextService;
private HashMap<String,Boolean> requireDeviceAuthorization = new HashMap<>();
private DeviceAccessAuthorizationService deviceAccessAuthorizationService;
private TaskService taskService;
private static DeviceManagementDataHolder thisInstance = new DeviceManagementDataHolder();
@ -164,4 +166,12 @@ public class DeviceManagementDataHolder {
DeviceAccessAuthorizationService deviceAccessAuthorizationService) {
this.deviceAccessAuthorizationService = deviceAccessAuthorizationService;
}
public TaskService getTaskService() {
return taskService;
}
public void setTaskService(TaskService taskService) {
this.taskService = taskService;
}
}

@ -22,6 +22,7 @@ import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.TransactionManagementException;
import org.wso2.carbon.device.mgt.core.config.datasource.DataSourceConfig;
@ -37,10 +38,7 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.*;
public final class DeviceManagerUtil {
@ -167,4 +165,17 @@ public final class DeviceManagerUtil {
return ctx.getTenantId();
}
public static List<DeviceIdentifier> convertDevices(List<Device> devices) {
List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
for (Device device : devices) {
DeviceIdentifier identifier = new DeviceIdentifier();
identifier.setId(device.getDeviceIdentifier());
identifier.setType(device.getType());
deviceIdentifiers.add(identifier);
}
return deviceIdentifiers;
}
}

@ -45,6 +45,25 @@
<minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable>
<minRetriesToMarkInactive>20</minRetriesToMarkInactive>
</PolicyConfiguration>
<TaskConfiguration>
<Enable>true</Enable>
<Frequency>600000</Frequency>
<TaskClass>org.wso2.carbon.device.mgt.core.task.impl.DeviceDetailsRetrieverTask</TaskClass>
<Operations>
<Operation>
<Name>DEVICE_INFO</Name>
<RecurrentTimes>1</RecurrentTimes>
</Operation>
<Operation>
<Name>APPLICATION_LIST</Name>
<RecurrentTimes>5</RecurrentTimes>
</Operation>
<Operation>
<Name>LOCATION</Name>
<RecurrentTimes>1</RecurrentTimes>
</Operation>
</Operations>
</TaskConfiguration>
</ManagementRepository>
</DeviceMgtConfiguration>

Loading…
Cancel
Save