if(allexists) returnval.add(next.getId()); } }catch(Exception e){}
}catch(Exception e){ error("Error getting authorized entity profile ids: ", e); }
    public Collection getAuthorizedEndEntityProfileIds(Admin admin){      ArrayList returnval = new ArrayList();      Collection result = null;            HashSet authorizedcaids = new HashSet(getAuthorizationSession().getAuthorizedCAIds(admin));      try{        if(getAuthorizationSession().isAuthorizedNoLog(admin, "/super_administrator"))          returnval.add(new Integer(SecConst.EMPTY_ENDENTITYPROFILE));      }catch(AuthorizationDeniedException e){}                try{        result = profiledatahome.findAll();        Iterator i = result.iterator();        while(i.hasNext()){          EndEntityProfileDataLocal next = (EndEntityProfileDataLocal) i.next();          // Check if all profiles available CAs exists in authorizedcaids.          String[] availablecas = next.getProfile().getValue(EndEntityProfile.AVAILCAS, 0).split(EndEntityProfile.SPLITCHAR);          boolean allexists = true;          for(int j=0; j < availablecas.length; j++){            if(!authorizedcaids.contains( new Integer(availablecas[j]))){              allexists = false;              break;            }          }                    if(allexists)            returnval.add(next.getId());        }      }catch(Exception e){}      return returnval;    } // getAuthorizedEndEntityProfileNames