public SearchResults search ( OmdbParameters searchParams ) throws OMDBException { SearchResults resultList ; if ( ! searchParams . has ( Param . APIKEY ) ) { searchParams . add ( Param . APIKEY , this . apiKey ) ; } String url = OmdbUrlBuilder . create ( searchParams ) ; LOG . trace ( "URL: {}" , url ) ; // Get the JSON String jsonData = requestWebPage ( OmdbUrlBuilder . generateUrl ( url ) ) ; // Process the JSON into an object try { resultList = mapper . readValue ( jsonData , SearchResults . class ) ; } catch ( IOException ex ) { throw new OMDBException ( ApiExceptionType . MAPPING_FAILED , jsonData , 0 , url , ex ) ; } return resultList ; }
Execute a search using the passed parameters .