@Override public GetResponse get(GetRequest getRequest) throws IOException { try { return transportClient.get(getRequest).get(); } catch (Exception e) { throw new IOException(e); } }
Assert.assertTrue(tc.get(new GetRequest("searchguard", "sg", "config")).actionGet().isExists()); Assert.assertTrue(tc.get(new GetRequest("searchguard","sg","internalusers")).actionGet().isExists()); Assert.assertTrue(tc.get(new GetRequest("searchguard","sg","roles")).actionGet().isExists()); Assert.assertTrue(tc.get(new GetRequest("searchguard","sg","rolesmapping")).actionGet().isExists()); Assert.assertTrue(tc.get(new GetRequest("searchguard","sg","actiongroups")).actionGet().isExists()); Assert.assertFalse(tc.get(new GetRequest("searchguard","sg","rolesmapping_xcvdnghtu165759i99465")).actionGet().isExists()); Assert.assertTrue(tc.get(new GetRequest("searchguard","sg","config")).actionGet().isExists());
/** * 非同期でドキュメントを取得. * @param index インデックス名 * @param type タイプ名 * @param id ドキュメントのID * @param routingId routingId * @param realtime リアルタイムモードなら真 * @return 非同期応答 */ public ActionFuture<GetResponse> asyncGet(String index, String type, String id, String routingId, boolean realtime) { GetRequest req = new GetRequest(index, type, id); if (routingFlag) { req = req.routing(routingId); } req.realtime(realtime); ActionFuture<GetResponse> ret = esTransportClient.get(req); this.fireEvent(Event.afterRequest, index, type, id, null, "Get"); return ret; }