<prompt> Unda programu ya Java inayoingiliana na Elasticsearch ili kuhifadhi na kurejesha maelezo kuhusu vitabu kichwa, mwandishi, tarehe ya kuchapishwa. Tekeleza shughuli za CRUD na toa kiolesura rahisi cha mstari wa amri kwa watumiaji kuingiliana na hifadhidata ya kitabu.PLINFORMAT  <response>: agiza org.elasticsearch.action.ActionListener;agiza org.elasticsearch.action.delete.DeleteRequest;agiza org.elasticsearch.action.get.GetRequest;agiza org.elasticsearch.action.index.IndexRequest;agiza org.elasticsearch.action.update.UpdateRequest;agiza org.elasticsearch.client.RequestOptions;agiza org.elasticsearch.client.RestClient;agiza org.elasticsearch.client.RestHighLevelClient;agiza org.elasticsearch.common.xcontent.XContentBuilder;agiza org.elasticsearch.common.xcontent.XContentFactory;agiza java.io.BufferedReader;agiza java.io.IOException;agiza java.io.InputStreamReader;agiza java.util.Map;Kitabu cha darasa la umma kitambulisho cha Kamba ya kibinafsi; Kichwa cha Kamba ya kibinafsi; mwandishi wa kamba ya kibinafsi; Tarehe ya uchapishaji wa Kamba ya kibinafsi; Wajenzi, wapataji, wawekaji, na mbinu za toString.class class ElasticsearchClient mteja binafsi wa RestHighLevelClient; public ElasticsearchClientJina la mpangishaji wa kamba, bandari ya ndani this.client new RestHighLevelClient RestClient.builderHttpHost mpyajina la mwenyeji, bandari, http; Shughuli za CRUD Unda hati ya kitabu public void createBookkitabu cha kitabu, ActionListener msikilizaji inarusha IOException Mjenzi wa XContentBuilder XContentFactory.jsonBuilder; builder.startObject; builder.fieldkichwa, book.getTitle; builder.fieldmwandishi, book.getAuthor; builder.fieldpublicationDate, book.getPublicationDate; mjenzi.endObject; Ombi la IndexRequest new IndexRequestvitabu; request.idbook.getId.chanzomjenzi; client.indexAsyncombi, RequestOptions.DEFAULT, msikilizaji; Rejesha kitabu kwa kitambulisho Public Book getBookByIdString id hutupa IOException GetRequest getRequest new GetRequestvitabu, kitambulisho; GetResponse getResponse client.getgetRequest, RequestOptions.DEFAULT; ikiwa !getResponse.isExists kurudi null; Ramani sourceAsMap getResponse.getSourceAsMap; Kichwa cha kamba Kamba sourceAsMap.getkichwa; Mwandishi wa kamba String sourceAsMap.getmwandishi; Uchapishaji wa kambaTarehe Kamba sourceAsMap.getpublicationDate; rudisha Kitabu kipya kitambulisho, kichwa, mwandishi, tarehe ya uchapishaji; Sasisha kitabu sasisho la utupu wa ummaKitabukitabu cha kitabu, Msikilizaji wa ActionListener hutupa IOException Mjenzi wa XContentBuilder XContentFactory.jsonBuilder; builder.startObject; builder.fieldkichwa, book.getTitle; builder.fieldmwandishi, book.getAuthor; builder.fieldpublicationDate, book.getPublicationDate; mjenzi.endObject; UpdateRequest request new UpdateRequestvitabu, book.getId.docmjenzi; client.updateAsyncombi, RequestOptions.DEFAULT, msikilizaji; Futa kitabu kwa kitambulisho utupu wa umma deleteBookByIdString id, ActionListener msikilizaji DeleteRequest request new DeleteRequestvitabu, kitambulisho; client.deleteAsyncombi, RequestOptions.DEFAULT, msikilizaji; darasa kuu la umma public static void mainString args inarusha IOException ElasticsearchClient client new ElasticsearchClientlocalhost, 9200; Kisomaji cha BufferedReader BufferedReader mpyampya ya InputStreamReaderSystem.in; Mstari wa kamba; wakati line reader.readLine ! null Kamba sehemu line.splits; ikiwa sehemu.length 0 itaendelea; Amri ya kamba sehemu0; kubadili amri kesi unda: Shikilia operesheni ya kuunda mapumziko; kesi kupata: Kushughulikia kupata operesheni mapumziko; kesi sasisho: Hushughulikia operesheni ya sasisho mapumziko; kesi kufuta: Hushughulikia operesheni ya kufuta mapumziko; chaguo-msingi: System.out.printlnAmri isiyojulikana: amri; 