public Collection<HFCAIdentity> getHFCAIdentities(User registrar) throws IdentityException, InvalidArgumentException {
        if (registrar == null) {
            throw new InvalidArgumentException("Registrar should be a valid member");
        }

        logger.debug(format("identity  url: %s, registrar: %s", url, registrar.getName()));

        try {
            JsonObject result = httpGet(HFCAIdentity.HFCA_IDENTITY, registrar);

            Collection<HFCAIdentity> allIdentities = new ArrayList<>();

            JsonArray identities = result.getJsonArray("identities");
            if (identities != null && !identities.isEmpty()) {
                for (int i = 0; i < identities.size(); i++) {
                    JsonObject identity = identities.getJsonObject(i);
                    HFCAIdentity idObj = new HFCAIdentity(identity);
                    allIdentities.add(idObj);
                }
            }

            logger.debug(format("identity  url: %s, registrar: %s done.", url, registrar));
            return allIdentities;
        } catch (HTTPException e) {
            String msg = format("[HTTP Status Code: %d] - Error while getting all users from url '%s': %s", e.getStatusCode(), url, e.getMessage());
            IdentityException identityException = new IdentityException(msg, e);
            logger.error(msg);
            throw identityException;
        } catch (Exception e) {
            String msg = format("Error while getting all users from url '%s': %s", url, e.getMessage());
            IdentityException identityException = new IdentityException(msg, e);
            logger.error(msg);
            throw identityException;
        }

    }
public Collection < HFCAIdentity > getHFCAIdentities ( User registrar ) throws IdentityException , InvalidArgumentException { if ( registrar == null ) { throw new InvalidArgumentException ( "Registrar should be a valid member" ) ; } logger . debug ( format ( "identity  url: %s, registrar: %s" , url , registrar . getName ( ) ) ) ; try { JsonObject result = httpGet ( HFCAIdentity . HFCA_IDENTITY , registrar ) ; Collection < HFCAIdentity > allIdentities = new ArrayList < > ( ) ; JsonArray identities = result . getJsonArray ( "identities" ) ; if ( identities != null && ! identities . isEmpty ( ) ) { for ( int i = 0 ; i < identities . size ( ) ; i ++ ) { JsonObject identity = identities . getJsonObject ( i ) ; HFCAIdentity idObj = new HFCAIdentity ( identity ) ; allIdentities . add ( idObj ) ; } } logger . debug ( format ( "identity  url: %s, registrar: %s done." , url , registrar ) ) ; return allIdentities ; } catch ( HTTPException e ) { String msg = format ( "[HTTP Status Code: %d] - Error while getting all users from url '%s': %s" , e . getStatusCode ( ) , url , e . getMessage ( ) ) ; IdentityException identityException = new IdentityException ( msg , e ) ; logger . error ( msg ) ; throw identityException ; } catch ( Exception e ) { String msg = format ( "Error while getting all users from url '%s': %s" , url , e . getMessage ( ) ) ; IdentityException identityException = new IdentityException ( msg , e ) ; logger . error ( msg ) ; throw identityException ; } }
gets all identities that the registrar is allowed to see

@param registrar The identity of the registrar (i.e. who is performing the registration).
@return the identity that was requested
@throws IdentityException        if adding an identity fails.
@throws InvalidArgumentException Invalid (null) argument specified