public Message waitFor ( String server , SearchCriteria criteria ) throws IOException , MailosaurException { HashMap < String , String > query = new HashMap < String , String > ( ) ; query . put ( "server" , server ) ; return client . request ( "POST" , "api/messages/await" , criteria , query ) . parseAs ( Message . class ) ; }
Wait for a specific message . Returns as soon as an message matching the specified search criteria is found .