private boolean userExists(String userID) throws IdRepoException, SSOException {
  AMIdentityRepository amIdRepo=getAMIdentityRepository(getRequestOrg());
  IdSearchControl idsc=new IdSearchControl();
  idsc.setRecursive(true);
  idsc.setTimeOut(0);
  idsc.setAllReturnAttributes(true);
  Set results=Collections.EMPTY_SET;
  try {
    idsc.setMaxResults(0);
    IdSearchResults searchResults=amIdRepo.searchIdentities(IdType.USER,userID,idsc);
    if (searchResults != null) {
      results=searchResults.getSearchResults();
    }
  }
 catch (  IdRepoException e) {
    if (debug.messageEnabled()) {
      debug.message("IdRepoException : Error searching " + " Identities with username : " + e.getMessage());
    }
  }
  return !results.isEmpty();
}

private boolean userExists ( String userID ) throws IdRepoException , SSOException { AMIdentityRepository amIdRepo = getAMIdentityRepository ( getRequestOrg ( ) ) ; IdSearchControl idsc = new IdSearchControl ( ) ; idsc . setRecursive ( true ) ; idsc . setTimeOut ( 0 ) ; idsc . setAllReturnAttributes ( true ) ; Set results = Collections . EMPTY_SET ; try { idsc . setMaxResults ( 0 ) ; IdSearchResults searchResults = amIdRepo . searchIdentities ( IdType . USER , userID , idsc ) ; if ( searchResults != null ) { results = searchResults . getSearchResults ( ) ; } } catch ( IdRepoException e ) { if ( debug . messageEnabled ( ) ) { debug . message ( "IdRepoException : Error searching " + " Identities with username : " + e . getMessage ( ) ) ; } } return ! results . isEmpty ( ) ; }
check if user exists
