protected FoundAgent resolve ( ClientObject client , int agentId , String resolver ) { com . threerings . presents . dobj . DObject dobj = _omgr . getObject ( agentId ) ; if ( dobj == null ) { log . warning ( "Non-existent agent" , "function" , resolver , "agentId" , agentId ) ; return null ; } if ( ! ( dobj instanceof AgentObject ) ) { log . warning ( "Object not an agent" , "function" , resolver , "obj" , dobj . getClass ( ) ) ; return null ; } AgentObject agent = ( AgentObject ) dobj ; Bureau bureau = _bureaus . get ( agent . bureauId ) ; if ( bureau == null ) { log . warning ( "Bureau not found for agent" , "function" , resolver , "agent" , agent . which ( ) ) ; return null ; } if ( ! bureau . agentStates . containsKey ( agent ) ) { log . warning ( "Bureau does not have agent" , "function" , resolver , "agent" , agent . which ( ) ) ; return null ; } if ( client != null && bureau . clientObj != client ) { log . warning ( "Masquerading request" , "function" , resolver , "agent" , agent . which ( ) , "client" , bureau . clientObj , "client" , client ) ; return null ; } return new FoundAgent ( bureau , agent , bureau . agentStates . get ( agent ) ) ; }
Does lots of null checks and lookups and resolves the given information into FoundAgent .