Enable the new configuration for testing

4.x.x
kamidu 7 years ago
parent 2505d4907a
commit 33b27234a0

@ -39,6 +39,7 @@
<PolicyConfiguration> <PolicyConfiguration>
<monitoringClass>org.wso2.carbon.policy.mgt</monitoringClass> <monitoringClass>org.wso2.carbon.policy.mgt</monitoringClass>
<monitoringEnable>true</monitoringEnable> <monitoringEnable>true</monitoringEnable>
<CacheEnable>true</CacheEnable>
<monitoringFrequency>60000</monitoringFrequency> <monitoringFrequency>60000</monitoringFrequency>
<maxRetries>5</maxRetries> <maxRetries>5</maxRetries>
<minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable> <minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable>

@ -49,6 +49,7 @@
<PolicyConfiguration> <PolicyConfiguration>
<MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<MonitoringEnable>true</MonitoringEnable> <MonitoringEnable>true</MonitoringEnable>
<CacheEnable>true</CacheEnable>
<MonitoringFrequency>60000</MonitoringFrequency> <MonitoringFrequency>60000</MonitoringFrequency>
<MaxRetries>5</MaxRetries> <MaxRetries>5</MaxRetries>
<MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable> <MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable>

@ -49,6 +49,7 @@
<PolicyConfiguration> <PolicyConfiguration>
<MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<MonitoringEnable>true</MonitoringEnable> <MonitoringEnable>true</MonitoringEnable>
<CacheEnable>true</CacheEnable>
<MonitoringFrequency>60000</MonitoringFrequency> <MonitoringFrequency>60000</MonitoringFrequency>
<MaxRetries>5</MaxRetries> <MaxRetries>5</MaxRetries>
<MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable> <MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable>

@ -54,6 +54,7 @@
<PolicyConfiguration> <PolicyConfiguration>
<MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<MonitoringEnable>true</MonitoringEnable> <MonitoringEnable>true</MonitoringEnable>
<CacheEnable>true</CacheEnable>
<MonitoringFrequency>60000</MonitoringFrequency> <MonitoringFrequency>60000</MonitoringFrequency>
<MaxRetries>5</MaxRetries> <MaxRetries>5</MaxRetries>
<MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable> <MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable>

@ -44,9 +44,6 @@ import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderServiceImp
import org.wso2.carbon.policy.mgt.common.*; import org.wso2.carbon.policy.mgt.common.*;
import org.wso2.carbon.policy.mgt.core.cache.impl.PolicyCacheManagerImpl; import org.wso2.carbon.policy.mgt.core.cache.impl.PolicyCacheManagerImpl;
import org.wso2.carbon.policy.mgt.core.dao.*; import org.wso2.carbon.policy.mgt.core.dao.*;
import org.wso2.carbon.policy.mgt.core.enforcement.PolicyDelegationException;
import org.wso2.carbon.policy.mgt.core.enforcement.PolicyEnforcementDelegator;
import org.wso2.carbon.policy.mgt.core.enforcement.PolicyEnforcementDelegatorImpl;
import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder; import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder;
import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager; import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager;
import org.wso2.carbon.policy.mgt.core.mgt.ProfileManager; import org.wso2.carbon.policy.mgt.core.mgt.ProfileManager;
@ -60,7 +57,6 @@ import java.util.*;
public class PolicyManagerImpl implements PolicyManager { public class PolicyManagerImpl implements PolicyManager {
private PolicyDAO policyDAO; private PolicyDAO policyDAO;
private PolicyManager policyManager;
private ProfileDAO profileDAO; private ProfileDAO profileDAO;
private FeatureDAO featureDAO; private FeatureDAO featureDAO;
private ProfileManager profileManager; private ProfileManager profileManager;
@ -73,7 +69,6 @@ public class PolicyManagerImpl implements PolicyManager {
this.featureDAO = PolicyManagementDAOFactory.getFeatureDAO(); this.featureDAO = PolicyManagementDAOFactory.getFeatureDAO();
this.policyConfiguration = DeviceConfigurationManager.getInstance().getDeviceManagementConfig().getPolicyConfiguration(); this.policyConfiguration = DeviceConfigurationManager.getInstance().getDeviceManagementConfig().getPolicyConfiguration();
this.profileManager = new ProfileManagerImpl(); this.profileManager = new ProfileManagerImpl();
this.policyManager = new PolicyManagerImpl();
} }
@Override @Override
@ -282,7 +277,7 @@ public class PolicyManagerImpl implements PolicyManager {
if (policyConfiguration.getCacheEnable()) { if (policyConfiguration.getCacheEnable()) {
existingPolicies = PolicyCacheManagerImpl.getInstance().getAllPolicies(); existingPolicies = PolicyCacheManagerImpl.getInstance().getAllPolicies();
} else { } else {
existingPolicies = policyManager.getPolicies(); existingPolicies = this.getPolicies();
} }
PolicyManagementDAOFactory.beginTransaction(); PolicyManagementDAOFactory.beginTransaction();
bool = policyDAO.updatePolicyPriorities(policies); bool = policyDAO.updatePolicyPriorities(policies);
@ -698,7 +693,7 @@ public class PolicyManagerImpl implements PolicyManager {
if (policyConfiguration.getCacheEnable()) { if (policyConfiguration.getCacheEnable()) {
tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies(); tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies();
} else { } else {
tempPolicyList = policyManager.getPolicies(); tempPolicyList = this.getPolicies();
} }
for (Policy policy : tempPolicyList) { for (Policy policy : tempPolicyList) {
@ -723,7 +718,7 @@ public class PolicyManagerImpl implements PolicyManager {
if (policyConfiguration.getCacheEnable()) { if (policyConfiguration.getCacheEnable()) {
allPolicies = PolicyCacheManagerImpl.getInstance().getAllPolicies(); allPolicies = PolicyCacheManagerImpl.getInstance().getAllPolicies();
} else { } else {
allPolicies = policyManager.getPolicies(); allPolicies = this.getPolicies();
} }
for (Policy policy : allPolicies) { for (Policy policy : allPolicies) {
@ -770,7 +765,7 @@ public class PolicyManagerImpl implements PolicyManager {
if (policyConfiguration.getCacheEnable()) { if (policyConfiguration.getCacheEnable()) {
tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies(); tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies();
} else { } else {
tempPolicyList = policyManager.getPolicies(); tempPolicyList = this.getPolicies();
} }
for (Policy policy : tempPolicyList) { for (Policy policy : tempPolicyList) {
@ -805,7 +800,7 @@ public class PolicyManagerImpl implements PolicyManager {
if (policyConfiguration.getCacheEnable()) { if (policyConfiguration.getCacheEnable()) {
tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies(); tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies();
} else { } else {
tempPolicyList = policyManager.getPolicies(); tempPolicyList = this.getPolicies();
} }
for (Policy policy : tempPolicyList) { for (Policy policy : tempPolicyList) {

@ -39,6 +39,7 @@
<PolicyConfiguration> <PolicyConfiguration>
<monitoringClass>org.wso2.carbon.policy.mgt</monitoringClass> <monitoringClass>org.wso2.carbon.policy.mgt</monitoringClass>
<monitoringEnable>true</monitoringEnable> <monitoringEnable>true</monitoringEnable>
<CacheEnable>true</CacheEnable>
<monitoringFrequency>60000</monitoringFrequency> <monitoringFrequency>60000</monitoringFrequency>
<maxRetries>5</maxRetries> <maxRetries>5</maxRetries>
<minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable> <minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable>

@ -54,6 +54,7 @@
<PolicyConfiguration> <PolicyConfiguration>
<MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass> <MonitoringClass>org.wso2.carbon.policy.mgt</MonitoringClass>
<MonitoringEnable>true</MonitoringEnable> <MonitoringEnable>true</MonitoringEnable>
<CacheEnable>true</CacheEnable>
<MonitoringFrequency>60000</MonitoringFrequency> <MonitoringFrequency>60000</MonitoringFrequency>
<MaxRetries>5</MaxRetries> <MaxRetries>5</MaxRetries>
<MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable> <MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable>

Loading…
Cancel
Save