@Test public void getAll() throws Exception { LOG.info( "\n===ModuleDaoTest.getAll===\n" ); List<Module> modules = ESSuiteTest.moduleDao.getAll(); for ( Module m : modules ) { LOG.info( m.toString() ); } assertEquals( "Wrong number of modules in elasticsearch", 2, modules.size() ); }
public List<Module> getAll() { SearchResponse response = elasticSearchClient .getClient() .prepareSearch( DAO_INDEX_KEY ) .setTypes( DAO_TYPE_KEY ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); LOG.debug( "response: {}", response ); ArrayList<Module> modules = new ArrayList<Module>(); for ( SearchHit hit : response.getHits().hits() ) { modules.add( toModule( hit ) ); } return modules; }
ModuleDao extends Dao { public List<Module> getAll() { SearchResponse response = elasticSearchClient .getClient() .prepareSearch( DAO_INDEX_KEY ) .setTypes( DAO_TYPE_KEY ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); LOG.debug( "response: {}", response ); ArrayList<Module> modules = new ArrayList<Module>(); for ( SearchHit hit : response.getHits().hits() ) { modules.add( toModule( hit ) ); } return modules; } }
ModuleDao extends Dao { public List<Module> getAll() { SearchResponse response = elasticSearchClient .getClient() .prepareSearch( DAO_INDEX_KEY ) .setTypes( DAO_TYPE_KEY ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); LOG.debug( "response: {}", response ); ArrayList<Module> modules = new ArrayList<Module>(); for ( SearchHit hit : response.getHits().hits() ) { modules.add( toModule( hit ) ); } return modules; } @Inject  ModuleDao( IElasticSearchClient elasticSearchClient ); }
ModuleDao extends Dao { public List<Module> getAll() { SearchResponse response = elasticSearchClient .getClient() .prepareSearch( DAO_INDEX_KEY ) .setTypes( DAO_TYPE_KEY ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); LOG.debug( "response: {}", response ); ArrayList<Module> modules = new ArrayList<Module>(); for ( SearchHit hit : response.getHits().hits() ) { modules.add( toModule( hit ) ); } return modules; } @Inject  ModuleDao( IElasticSearchClient elasticSearchClient ); boolean save( Module module ); Module get( String id ); List<Module> getAll(); }
ModuleDao extends Dao { public List<Module> getAll() { SearchResponse response = elasticSearchClient .getClient() .prepareSearch( DAO_INDEX_KEY ) .setTypes( DAO_TYPE_KEY ) .setSize( MAX_RESULT_SIZE ) .execute() .actionGet(); LOG.debug( "response: {}", response ); ArrayList<Module> modules = new ArrayList<Module>(); for ( SearchHit hit : response.getHits().hits() ) { modules.add( toModule( hit ) ); } return modules; } @Inject  ModuleDao( IElasticSearchClient elasticSearchClient ); boolean save( Module module ); Module get( String id ); List<Module> getAll(); static final String DAO_INDEX_KEY; static final String DAO_TYPE_KEY; }