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.identity.oauth.stub.dto,
org.wso2.carbon.ndatasource.core, org.wso2.carbon.ndatasource.core,
org.wso2.carbon.apimgt.impl, org.wso2.carbon.apimgt.impl,
org.wso2.carbon.ntask.core.*,
org.wso2.carbon.ntask.common,
org.wso2.carbon.ndatasource.core, org.wso2.carbon.ndatasource.core,
org.apache.axis2.transport.mail, org.apache.axis2.transport.mail,
org.apache.catalina, org.apache.catalina,
@ -216,6 +218,18 @@
<groupId>org.wso2.tomcat</groupId> <groupId>org.wso2.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId> <artifactId>tomcat-servlet-api</artifactId>
</dependency> </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> </dependencies>
</project> </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.email.EmailConfigurations;
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.policy.PolicyConfiguration; 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.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@ -31,44 +32,54 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "ManagementRepository") @XmlRootElement(name = "ManagementRepository")
public class DeviceManagementConfigRepository { public class DeviceManagementConfigRepository {
private DataSourceConfig dataSourceConfig; private DataSourceConfig dataSourceConfig;
private EmailConfigurations emailConfigurations; private EmailConfigurations emailConfigurations;
private IdentityConfigurations identityConfigurations; private IdentityConfigurations identityConfigurations;
private PolicyConfiguration policyConfiguration; private PolicyConfiguration policyConfiguration;
private TaskConfiguration taskConfiguration;
@XmlElement(name = "DataSourceConfiguration", required = true) @XmlElement(name = "DataSourceConfiguration", required = true)
public DataSourceConfig getDataSourceConfig() { public DataSourceConfig getDataSourceConfig() {
return dataSourceConfig; return dataSourceConfig;
} }
public void setDataSourceConfig(DataSourceConfig dataSourceConfig) { public void setDataSourceConfig(DataSourceConfig dataSourceConfig) {
this.dataSourceConfig = dataSourceConfig; this.dataSourceConfig = dataSourceConfig;
} }
@XmlElement(name = "EmailClientConfiguration", required = true) @XmlElement(name = "EmailClientConfiguration", required = true)
public EmailConfigurations getEmailConfigurations() { public EmailConfigurations getEmailConfigurations() {
return emailConfigurations; return emailConfigurations;
} }
public void setEmailConfigurations(EmailConfigurations emailConfigurations) { public void setEmailConfigurations(EmailConfigurations emailConfigurations) {
this.emailConfigurations = emailConfigurations; this.emailConfigurations = emailConfigurations;
} }
@XmlElement(name = "IdentityConfiguration", required = true) @XmlElement(name = "IdentityConfiguration", required = true)
public IdentityConfigurations getIdentityConfigurations() { public IdentityConfigurations getIdentityConfigurations() {
return identityConfigurations; return identityConfigurations;
} }
public void setIdentityConfigurations(IdentityConfigurations identityConfigurations) { public void setIdentityConfigurations(IdentityConfigurations identityConfigurations) {
this.identityConfigurations = identityConfigurations; this.identityConfigurations = identityConfigurations;
} }
@XmlElement(name = "PolicyConfiguration", required = true) @XmlElement(name = "PolicyConfiguration", required = true)
public PolicyConfiguration getPolicyConfiguration() { public PolicyConfiguration getPolicyConfiguration() {
return policyConfiguration; return policyConfiguration;
} }
public void setPolicyConfiguration(PolicyConfiguration policyConfiguration) { public void setPolicyConfiguration(PolicyConfiguration policyConfiguration) {
this.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.app.mgt.config.AppManagementConfig;
import org.wso2.carbon.device.mgt.core.config.license.LicenseConfig; import org.wso2.carbon.device.mgt.core.config.license.LicenseConfig;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; 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.registry.core.service.RegistryService;
import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.user.core.tenant.TenantManager; import org.wso2.carbon.user.core.tenant.TenantManager;
@ -46,6 +47,7 @@ public class DeviceManagementDataHolder {
private ConfigurationContextService configurationContextService; private ConfigurationContextService configurationContextService;
private HashMap<String,Boolean> requireDeviceAuthorization = new HashMap<>(); private HashMap<String,Boolean> requireDeviceAuthorization = new HashMap<>();
private DeviceAccessAuthorizationService deviceAccessAuthorizationService; private DeviceAccessAuthorizationService deviceAccessAuthorizationService;
private TaskService taskService;
private static DeviceManagementDataHolder thisInstance = new DeviceManagementDataHolder(); private static DeviceManagementDataHolder thisInstance = new DeviceManagementDataHolder();
@ -164,4 +166,12 @@ public class DeviceManagementDataHolder {
DeviceAccessAuthorizationService deviceAccessAuthorizationService) { DeviceAccessAuthorizationService deviceAccessAuthorizationService) {
this.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.w3c.dom.Document;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
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.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.TransactionManagementException; import org.wso2.carbon.device.mgt.common.TransactionManagementException;
import org.wso2.carbon.device.mgt.core.config.datasource.DataSourceConfig; 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 javax.xml.parsers.DocumentBuilderFactory;
import java.io.File; import java.io.File;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap; import java.util.*;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
public final class DeviceManagerUtil { public final class DeviceManagerUtil {
@ -167,4 +165,17 @@ public final class DeviceManagerUtil {
return ctx.getTenantId(); 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> <minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable>
<minRetriesToMarkInactive>20</minRetriesToMarkInactive> <minRetriesToMarkInactive>20</minRetriesToMarkInactive>
</PolicyConfiguration> </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> </ManagementRepository>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

Loading…
Cancel
Save