public AgentRoster getAgentRoster ( ) throws NotConnectedException , InterruptedException { if ( agentRoster == null ) { agentRoster = new AgentRoster ( connection , workgroupJID ) ; } // This might be the first time the user has asked for the roster. If so, we // want to wait up to 2 seconds for the server to send back the list of agents. // This behavior shields API users from having to worry about the fact that the // operation is asynchronous, although they'll still have to listen for changes // to the roster. int elapsed = 0 ; while ( ! agentRoster . rosterInitialized && elapsed <= 2000 ) { try { Thread . sleep ( 500 ) ; } catch ( Exception e ) { // Ignore } elapsed += 500 ; } return agentRoster ; }
Returns the agent roster for the workgroup which contains .