* @throws org.wso2.carbon.identity.base.IdentityException
* throws
*/
public PaginatedPolicySetDTO getAllPolicies(String policyTypeFilter, String policySearchString,
int pageNumber) throws IdentityException {
PolicyStoreReader policyReader;
List<PolicyDTO> policyDTOList = new ArrayList<PolicyDTO>();
EntitlementEngine.getInstance(getGovernanceUserRegistry(), CarbonContext.getCurrentContext().getTenantId());
policyReader = new PolicyStoreReader(new PolicyStore(getGovernanceUserRegistry()));
PolicyDTO[] policyDTOs = policyReader.readAllPolicyDTOs();
for (PolicyDTO policyDTO : policyDTOs){
// Filter out services based on service type
if (!policyTypeFilter.equals("ALL") && !policyTypeFilter.equals(policyDTO.getPolicyType())) {
continue;