public List<String> search(CrestQuery crestQuery,Map<String,Set<String>> searchModifiers,SSOToken admin) throws ResourceException {
  List<String> rv=new ArrayList<>();
  try {
    String realm="/";
    String objectType="User";
    if (searchModifiers != null) {
      realm=attractValues("realm",searchModifiers,"/");
      objectType=attractValues("objecttype",searchModifiers,"User");
    }
    AMIdentityRepository repo=getRepo(admin,realm);
    IdType idType=getIdType(objectType);
    if (idType != null) {
      List<AMIdentity> objList=fetchAMIdentities(idType,crestQuery,false,repo,searchModifiers);
      if (objList != null && !objList.isEmpty()) {
        List<String> names=getNames(realm,idType,objList);
        if (!names.isEmpty()) {
          for (          String name : names) {
            rv.add(name);
          }
        }
      }
    }
 else {
      debug.error("IdentityServicesImpl:search unsupported IdType" + objectType);
      throw new BadRequestException("search unsupported IdType: " + objectType);
    }
  }
 catch (  IdRepoException e) {
    debug.error("IdentityServicesImpl:search",e);
    throw new InternalServerErrorException(e.getMessage());
  }
catch (  SSOException e) {
    debug.error("IdentityServicesImpl:search",e);
    throw new InternalServerErrorException(e.getMessage());
  }
catch (  ObjectNotFound e) {
    debug.error("IdentityServicesImpl:search",e);
    throw new NotFoundException(e.getMessage());
  }
  return rv;
}

public List < String > search ( CrestQuery crestQuery , Map < String , Set < String > > searchModifiers , SSOToken admin ) throws ResourceException { List < String > rv = new ArrayList < > ( ) ; try { String realm = "/" ; String objectType = "User" ; if ( searchModifiers != null ) { realm = attractValues ( "realm" , searchModifiers , "/" ) ; objectType = attractValues ( "objecttype" , searchModifiers , "User" ) ; } AMIdentityRepository repo = getRepo ( admin , realm ) ; IdType idType = getIdType ( objectType ) ; if ( idType != null ) { List < AMIdentity > objList = fetchAMIdentities ( idType , crestQuery , false , repo , searchModifiers ) ; if ( objList != null && ! objList . isEmpty ( ) ) { List < String > names = getNames ( realm , idType , objList ) ; if ( ! names . isEmpty ( ) ) { for ( String name : names ) { rv . add ( name ) ; } } } } else { debug . error ( "IdentityServicesImpl:search unsupported IdType" + objectType ) ; throw new BadRequestException ( "search unsupported IdType: " + objectType ) ; } } catch ( IdRepoException e ) { debug . error ( "IdentityServicesImpl:search" , e ) ; throw new InternalServerErrorException ( e . getMessage ( ) ) ; } catch ( SSOException e ) { debug . error ( "IdentityServicesImpl:search" , e ) ; throw new InternalServerErrorException ( e . getMessage ( ) ) ; } catch ( ObjectNotFound e ) { debug . error ( "IdentityServicesImpl:search" , e ) ; throw new NotFoundException ( e . getMessage ( ) ) ; } return rv ; }
searches the identity repository to find all identities that match the search criteria .
