mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
* Refactored addPolicy
This commit is contained in:
parent
c703b5070f
commit
acc159d132
@ -62,6 +62,8 @@ public interface PolicyAdministratorPoint {
|
||||
|
||||
List<Policy> getPolicies() throws PolicyManagementException;
|
||||
|
||||
Policy getPolicy(int policyId) throws PolicyManagementException;
|
||||
|
||||
/**
|
||||
* This method gives the device specific policy.
|
||||
*
|
||||
|
||||
@ -445,11 +445,11 @@ public class PolicyDAOImpl implements PolicyDAO {
|
||||
resultSet = stmt.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
|
||||
policy.setId(policyId);
|
||||
policy.setPolicyName(resultSet.getString("NAME"));
|
||||
policy.setTenantId(resultSet.getInt("TENANT_ID"));
|
||||
policy.setPriorityId(resultSet.getInt("PRIORITY"));
|
||||
policy.setProfileId(resultSet.getInt("PROFILE_ID"));
|
||||
}
|
||||
return policy;
|
||||
|
||||
|
||||
@ -83,6 +83,10 @@ public class PolicyAdministratorPointImpl implements PolicyAdministratorPoint {
|
||||
return policyManager.getPolicies();
|
||||
}
|
||||
|
||||
@Override public Policy getPolicy(int policyId) throws PolicyManagementException {
|
||||
return policyManager.getPolicy(policyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Policy> getPoliciesOfDevice(DeviceIdentifier deviceIdentifier) throws PolicyManagementException {
|
||||
return policyManager.getPoliciesOfDevice(deviceIdentifier);
|
||||
|
||||
@ -372,7 +372,7 @@ public class PolicyManagerImpl implements PolicyManager {
|
||||
policyDAO.getTimesOfPolicy(policy);
|
||||
policyDAO.getLocationsOfPolicy(policy);
|
||||
|
||||
Profile profile = profileDAO.getProfiles(policy.getProfile().getProfileId());
|
||||
Profile profile = profileDAO.getProfiles(policy.getProfileId());
|
||||
|
||||
policy.setProfile(profile);
|
||||
policy.setRoles(roleNames);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user