question: public void handleRequest ( RequestContext rc ) throws CLIException { super . handleRequest ( rc ) ; ldapLogin ( ) ; SSOToken adminSSOToken = getAdminSSOToken ( ) ; IOutput outputWriter = getOutputWriter ( ) ; String realm = getStringOptionValue ( IArgument . REALM_NAME ) ; String patternType = getStringOptionValue ( IArgument . AGENT_TYPE ) ; String filter = getStringOptionValue ( IArgument . FILTER ) ; if ( patternType == null ) { patternType = "" ; } if ( ( filter == null ) || ( filter . length ( ) == 0 ) ) { filter = "*" ; } String [ ] params = { realm , patternType , filter } ; writeLog ( LogWriter . LOG_ACCESS , Level . INFO , "ATTEMPT_LIST_AGENTS" , params ) ; try { AMIdentityRepository amir = new AMIdentityRepository ( adminSSOToken , realm ) ; IdSearchResults isr = amir . searchIdentities ( IdType . AGENTONLY , filter , new IdSearchControl ( ) ) ; Set results = isr . getSearchResults ( ) ; if ( ( results != null ) && ! results . isEmpty ( ) ) { for ( Iterator i = results . iterator ( ) ; i . hasNext ( ) ; ) { AMIdentity amid = ( AMIdentity ) i . next ( ) ; if ( ! matchType ( amid , patternType ) ) { i . remove ( ) ; } } } if ( ( results != null ) && ! results . isEmpty ( ) ) { for ( Iterator i = results . iterator ( ) ; i . hasNext ( ) ; ) { AMIdentity amid = ( AMIdentity ) i . next ( ) ; Object [ ] args = { amid . getName ( ) , amid . getUniversalId ( ) } ; outputWriter . printlnMessage ( MessageFormat . format ( getResourceString ( "format-search-agent-results" ) , args ) ) ; } } else { outputWriter . printlnMessage ( getResourceString ( "search-agent-no-entries" ) ) ; } writeLog ( LogWriter . LOG_ACCESS , Level . INFO , "SUCCEED_LIST_AGENTS" , params ) ; } catch ( IdRepoException e ) { String [ ] args = { realm , patternType , filter , e . getMessage ( ) } ; debugError ( "ListAgents.handleRequest" , e ) ; writeLog ( LogWriter . LOG_ERROR , Level . INFO , "FAILED_LIST_AGENTS" , args ) ; throw new CLIException ( e , ExitCodes . REQUEST_CANNOT_BE_PROCESSED ) ; } catch ( SSOException e ) { String [ ] args = { realm , patternType , filter , e . getMessage ( ) } ; debugError ( "ListAgents.handleRequest" , e ) ; writeLog ( LogWriter . LOG_ERROR , Level . INFO , "FAILED_LIST_AGENTS" , args ) ; throw new CLIException ( e , ExitCodes . REQUEST_CANNOT_BE_PROCESSED ) ; } }
target:  Services a Commandline Request.