mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Adding partial commit to add a interface for plugins to implement to notify devices for monotoring
This commit is contained in:
parent
dea6d12173
commit
388701c3a2
@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.common;
|
||||
public class EnrolmentInfo {
|
||||
|
||||
public enum Status {
|
||||
CREATED, ACTIVE, INACTIVE, UNCLAIMED, SUSPENDED, BLOCKED, REMOVED
|
||||
CREATED, ACTIVE, INACTIVE, UNREACHABLE, UNCLAIMED, SUSPENDED, BLOCKED, REMOVED
|
||||
}
|
||||
|
||||
public enum OwnerShip {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
package org.wso2.carbon.policy.mgt.common.spi;
|
||||
|
||||
import org.wso2.carbon.device.mgt.common.Device;
|
||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceFeature;
|
||||
import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException;
|
||||
@ -28,6 +29,8 @@ import java.util.List;
|
||||
|
||||
public interface PolicyMonitoringService {
|
||||
|
||||
void notifyDevices(List<Device> devices) throws PolicyComplianceException;
|
||||
|
||||
List<ComplianceFeature> checkPolicyCompliance(DeviceIdentifier deviceIdentifier, Policy policy, Object response)
|
||||
throws PolicyComplianceException;
|
||||
}
|
||||
|
||||
@ -19,15 +19,36 @@
|
||||
|
||||
package org.wso2.carbon.policy.mgt.core.impl;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||
import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
|
||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
||||
import org.wso2.carbon.device.mgt.core.dao.EnrolmentDAO;
|
||||
import org.wso2.carbon.policy.mgt.common.Policy;
|
||||
import org.wso2.carbon.policy.mgt.common.monitor.ComplianceDecisionPoint;
|
||||
import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException;
|
||||
import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager;
|
||||
import org.wso2.carbon.policy.mgt.core.mgt.impl.PolicyManagerImpl;
|
||||
|
||||
public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
|
||||
|
||||
private static final Log log = LogFactory.getLog(ComplianceDecisionPointImpl.class);
|
||||
|
||||
private EnrolmentDAO enrolmentDAO;
|
||||
private DeviceDAO deviceDAO;
|
||||
|
||||
private PolicyManager policyManager;
|
||||
|
||||
public ComplianceDecisionPointImpl() {
|
||||
enrolmentDAO = DeviceManagementDAOFactory.getEnrollmentDAO();
|
||||
deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
|
||||
policyManager = new PolicyManagerImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNoneComplianceRule(Policy policy) throws PolicyComplianceException {
|
||||
return null;
|
||||
return policy.getCompliance();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,7 +87,8 @@ public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateDevicePolicyCompliance(DeviceIdentifier deviceIdentifier, Policy policy) throws PolicyComplianceException {
|
||||
public void validateDevicePolicyCompliance(DeviceIdentifier deviceIdentifier, Policy policy) throws
|
||||
PolicyComplianceException {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user